From patchwork Wed Nov 20 17:41:21 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Subject: [Alternative] fff-web: Do not remove uploaded binary on sysupgrade failure From: Fabian Blaese X-Patchwork-Id: 1222 Message-Id: <20191120174121.1709820-1-fabian@blaese.de> To: franken-dev@freifunk.net Date: Wed, 20 Nov 2019 18:41:21 +0100 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 Reviewed-by: Christian Dresel --- 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 "" fi %>