[Alternative PATCH] fff-web: Do not remove uploaded binary on sysupgrade failure
Christian Dresel
fff at chrisi01.de
Mi Nov 20 18:43:35 CET 2019
Reviewed-by: Christian Dresel <fff at 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 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
> %>
>
-------------- nächster Teil --------------
Ein Dateianhang mit Binärdaten wurde abgetrennt...
Dateiname : signature.asc
Dateityp : application/pgp-signature
Dateigröße : 833 bytes
Beschreibung: OpenPGP digital signature
URL : <https://lists.freifunk.net/pipermail/franken-dev-freifunk.net/attachments/20191120/f545ad93/attachment.sig>
Mehr Informationen über die Mailingliste franken-dev