base-files: fix error message during boot
[openwrt/openwrt.git] / package / base-files / files / lib / preinit / 80_mount_root
index cc8781687e1ba47a2e85424b9952fb7bc1389978..f3fe788e198729613d97f0f6179b78663db333f3 100644 (file)
@@ -3,8 +3,13 @@
 # Copyright (C) 2010 Vertical Communications
 
 do_mount_root() {
-    boot_run_hook preinit_mount_root
-}   
-
-boot_hook_add preinit_main do_mount_root
+       mount_root
+       boot_run_hook preinit_mount_root
+       [ -f /sysupgrade.tgz ] && {
+               echo "- config restore -"
+               cd /
+               tar xzf /sysupgrade.tgz
+       }
+}
 
+[ "$INITRAMFS" = "1" ] || boot_hook_add preinit_main do_mount_root