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.