base-files: fix cleanup after settings restore
authorRodrigo Balerdi <lanchon@gmail.com>
Tue, 30 Apr 2024 11:25:57 +0000 (08:25 -0300)
committerJohn Crispin <john@phrozen.org>
Thu, 12 Dec 2024 10:01:56 +0000 (11:01 +0100)
Some devices use file '/tmp/sysupgrade.tar' during settings restore and
this potentially big file was not being cleaned up from RAM afterwards.

See: do_mount_root() (base-files/files/lib/preinit/80_mount_root)

Signed-off-by: Rodrigo Balerdi <lanchon@gmail.com>
Link: https://github.com/openwrt/openwrt/pull/15339
Signed-off-by: John Crispin <john@phrozen.org>
package/base-files/files/etc/init.d/done

index 32d6118df760aa0f6780051459b9db4197eee567..77d2721f7d853faff80ad000648396b5da37c52b 100755 (executable)
@@ -5,6 +5,7 @@ START=95
 boot() {
        mount_root done
        rm -f /sysupgrade.tgz && sync
+       rm -f /tmp/sysupgrade.tar && sync
 
        # process user commands
        [ -f /etc/rc.local ] && {