Hello!
I am using an embedded LUA script which has the following line in it:
'if (cmdexec("rm -rf " .. tmpdir .. "/{*,.*}") == false) then'
which results in the following log when I run swupdate:
swupdate.sh[781]: rm: cannot remove '/tmp/tmp.ZV3iZzT4Gg': Device or resource busy
swupdate.sh[781]: sh: line 2: /bin: Is a directory
swupdate.sh[781]: [ERROR] : SWUPDATE failed [0] ERROR lua_interface.c : notify_helper : 725 : rm -rf /tmp/tmp.ZV3iZzT4Gg
swupdate.sh[781]: /{*,.*} returns with error
I also tried to just print it with
'
swupdate.info("rm -rf " .. tmpdir .. "/{*,.*}")'
which produces
swupdate.sh[1591]: [INFO ] : SWUPDATE running : [notify_helper] : rm -rf /tmp/tmp.AtbJHFG5DZ
swupdate.sh[1591]: /{*,.*}
So, this is actually not about how the SWUpdate process executes the command, but about
the string to be executed is not concatenated right, e.g. SWUpdate has it as
two lines instead of a single one:
instead of "rf /tmp/tmp.AtbJHFG5DZ/{*,.*}" it produces
"rf /tmp/tmp.AtbJHFG5DZ" (then new line I guess) and then "/{*,.*}"
Could you please help me understand what is wrong with this?
The same code I run on a host PC executes without an issue,
but refuses to run with swupdate...
cmdexec if from [1]
Thank you in advance,
Oleksandr
[1]
https://github.com/sbabic/meta-swupdate-boards/blob/master/recipes-extended/images/update-image/beaglebone-yocto/emmcsetup.lua#L13