Message ID | 20191120174121.1709820-1-fabian@blaese.de |
---|---|
State | Accepted |
Headers | show |
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 %>
Reviewed-by: Christian Dresel <fff@chrisi01.de> On 20.11.19 18:41, Fabian Bläse wrote: > 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> > --- > 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 > %> >
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> --- src/packages/fff/fff-web/files/www/ssl/cgi-bin/upgrade.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)