[Alternative PATCH] fff-web: Do not remove uploaded binary on sysupgrade failure

Fabian Bläse fabian at blaese.de
Mi Nov 20 18:41:21 CET 2019


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 at blaese.de>
---
 src/packages/fff/fff-web/files/www/ssl/cgi-bin/upgrade.html | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/packages/fff/fff-web/files/www/ssl/cgi-bin/upgrade.html b/src/packages/fff/fff-web/files/www/ssl/cgi-bin/upgrade.html
index e2b0a57..5fe1526 100755
--- a/src/packages/fff/fff-web/files/www/ssl/cgi-bin/upgrade.html
+++ b/src/packages/fff/fff-web/files/www/ssl/cgi-bin/upgrade.html
@@ -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
 %>
-- 
2.24.0



Mehr Informationen über die Mailingliste franken-dev