base-files: keep sysupgrade.tgz until /etc/init.d/done has been called
authorFelix Fietkau <nbd@openwrt.org>
Sun, 22 Mar 2015 15:11:20 +0000 (15:11 +0000)
committerFelix Fietkau <nbd@openwrt.org>
Sun, 22 Mar 2015 15:11:20 +0000 (15:11 +0000)
This makes interrupted boots after sysupgrade more reliable

Signed-off-by: Felix Fietkau <nbd@openwrt.org>
SVN-Revision: 44941

package/base-files/files/etc/init.d/done
package/base-files/files/lib/preinit/80_mount_root

index b254aff31501dc8ad31063cc8b1495994eedf106..ed75e4022fdad4ac1dd425fbb67929575ecc508f 100755 (executable)
@@ -4,6 +4,7 @@
 START=95
 boot() {
        [ -d /tmp/root ] && mount_root done
+       rm -f /sysupgrade.tgz
 
        # process user commands
        [ -f /etc/rc.local ] && {
index 0292d82d4abe9c4451f1932e2581425a040109e6..f3fe788e198729613d97f0f6179b78663db333f3 100644 (file)
@@ -8,10 +8,7 @@ do_mount_root() {
        [ -f /sysupgrade.tgz ] && {
                echo "- config restore -"
                cd /
-               mv sysupgrade.tgz /tmp
-               tar xzf /tmp/sysupgrade.tgz
-               rm -f /tmp/sysupgrade.tgz
-               sync
+               tar xzf /sysupgrade.tgz
        }
 }