post script not executed

325 views
Skip to first unread message

Aditya Purohit

unread,
Oct 2, 2017, 2:16:01 AM10/2/17
to swup...@googlegroups.com
I am trying to run an update and run a postscript after installing the bundle.
My sw description file is :

software =
{
    version = "1.0.1";
    dattus = {
        hardware-compatibility: [ "1.0.1" ];
        images: (
            {
                filename = "test2.ext4.img";
                device = "/dev/mmcblk0p5";
                type = "raw";
            }
        );
    scripts: (
      {
        filename = "postscript.sh";
        type = "postinstall";
        }
        );
    };
}


By only sending the image, swupdate works fine.
With post script it is giving the following error

[NOTIFY] : SWUPDATE running :  [extract_next_file] : Copied file:
    filename postscript.sh
    size 123
    checksum 0x2929 VERIFIED

[NOTIFY] : SWUPDATE failed [0] ERROR handlers/shell_scripthandler.c : execute_shell_script : 51 : Execution bit cannot be set for /tmp/scripts/postscript.sh
[NOTIFY] : SWUPDATE failed [0] ERROR corelib/installer.c : install_images : 341 : execute postinstall scripts failed


For simplicity I have kept the postscript as:
#!/bin/bash
logger hey there


I have also noticed that the file postscript.sh is being copied to /tmp instead of /tmp/scripts in runtime. I think this is causing the problem because when I manually copy the file to /tmp/scripts, it works without any issue.


P.S. I have tried changing permissions of postscript.sh and also tried to run swupdate as root.

--
Thanks

Aditya Purohit

Stefano Babic

unread,
Oct 2, 2017, 2:49:58 AM10/2/17
to Aditya Purohit, swup...@googlegroups.com
Hi Aditya,
This was raised just some days ago:

https://groups.google.com/forum/#!searchin/swupdate/preinstall%7Csort:relevance/swupdate/_UwJk2Eu93U/x_PbbUdTBQAJ

>
>
> For simplicity I have kept the postscript as:
> #!/bin/bash
> logger hey there
>
>
> I have also noticed that the file postscript.sh is being copied to /tmp
> instead of /tmp/scripts in runtime. I think this is causing the problem
> because when I manually copy the file to /tmp/scripts, it works without
> any issue.

See discussion in last week.

Best regards,
Stefano Babic


--
=====================================================================
DENX Software Engineering GmbH, Managing Director: Wolfgang Denk
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: +49-8142-66989-53 Fax: +49-8142-66989-80 Email: sba...@denx.de
=====================================================================

Christian Storm

unread,
Oct 2, 2017, 2:56:49 AM10/2/17
to swup...@googlegroups.com
Hi Aditya,
Yes, this was fixed with "[PATCH] installer: extract/remove scripts
respecting SCRIPTS_DIR_SUFFIX" [1] I sent on Thu, 28 Sep 2017 12:09:32 +0200
to this list. It has not been merged to -master by Stefano as we were
discussing whether to keep splitting artifact types in different directories
or not. This has also been reported by Arun Sooraj PS <aruns...@gmail.com>.
I just tried your sw-description with the patch applied and it works.


Kind regards,
Christian

[1] http://patchwork.ozlabs.org/patch/819522/

--
Dr. Christian Storm
Siemens AG, Corporate Technology, CT RDA ITP SES-DE
Otto-Hahn-Ring 6, 81739 München, Germany
Reply all
Reply to author
Forward
0 new messages