base-files: fix error message during boot
[openwrt/openwrt.git] / package / base-files / files / lib / preinit / 80_mount_root
index ad24fb8ace70707e434c9980d948399834ce160f..f3fe788e198729613d97f0f6179b78663db333f3 100644 (file)
@@ -3,8 +3,13 @@
 # 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 /
+               tar xzf /sysupgrade.tgz
+       }
 }
 
-boot_hook_add preinit_main do_mount_root
-
+[ "$INITRAMFS" = "1" ] || boot_hook_add preinit_main do_mount_root