fff-web: Do not remove uploaded binary on sysupgrade failure

For some reason sysupgrade seems to return exit status != 0
even on successful calls. As the binary is removed if
sysupgrade exists with a failure status, it is possible that
it got deleted while a sysupgrade has been in progress.

This removal was added to ensure that only one binary occupies
space in tmpfs (which is stored in memory) when upgrading.
If sysupgrade fails and the user starts another try, the old
binary is overwritten by moving the new one to the same location.

Therefore the removal of binaries on sysupgrade failure can be
removed completely.

Signed-off-by: Fabian Bläse <fabian@blaese.de>
Reviewed-by: Christian Dresel <fff@chrisi01.de>
Acked-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
This commit is contained in:
Fabian Bläse 2019-11-20 18:41:21 +01:00
parent caa248fca1
commit 87f6f9969f
1 changed files with 1 additions and 1 deletions

View File

@ -74,7 +74,7 @@ elif [ "$do_sysupgrade" = "1" ] ; then
echo 3 > /proc/sys/vm/drop_caches
echo "# sysupgrade $args /tmp/uploadedfw.bin"
mv -f "$HASERL_firmware_path" /tmp/uploadedfw.bin
sysupgrade $args /tmp/uploadedfw.bin || rm /tmp/uploadedfw.bin
sysupgrade $args /tmp/uploadedfw.bin
echo "</pre>"
fi
%>