mount_root: prepare base-files
[openwrt/openwrt.git] / package / base-files / files / lib / preinit / 80_mount_root
index 9a99ee91097129205e7cee966ce4bf2ecd0d7c72..0292d82d4abe9c4451f1932e2581425a040109e6 100644 (file)
@@ -3,7 +3,16 @@
 # Copyright (C) 2010 Vertical Communications
 
 do_mount_root() {
-    boot_run_hook preinit_mount_root
+       mount_root
+       boot_run_hook preinit_mount_root
+       [ -f /sysupgrade.tgz ] && {
+               echo "- config restore -"
+               cd /
+               mv sysupgrade.tgz /tmp
+               tar xzf /tmp/sysupgrade.tgz
+               rm -f /tmp/sysupgrade.tgz
+               sync
+       }
 }
 
 [ "$INITRAMFS" = "1" ] || boot_hook_add preinit_main do_mount_root