remove some redundant code
[openwrt/svn-archive/archive.git] / package / base-files / files / etc / preinit
index 452209ff9094e42ea7540d66152cda507128b277..66bb1a5cc18fbc76c1d5822da9ca1917c4301b3a 100755 (executable)
@@ -59,17 +59,20 @@ set_state preinit
 echo "$HOTPLUG" > /proc/sys/kernel/hotplug
 eval ${FAILSAFE:+failsafe}
 lock -w /tmp/.failsafe
-mount_root
-[ -f /sysupgrade.tgz ] && {
-       echo "- config restore -"
-       cd /
-       mv sysupgrade.tgz /tmp
-       tar xzf /tmp/sysupgrade.tgz
-       rm -f /tmp/sysupgrade.tgz
-       sync
-}
 
-echo "- init -"
+if [ -z "$INITRAMFS" ]; then
+       mount_root
+       [ -f /sysupgrade.tgz ] && {
+               echo "- config restore -"
+               cd /
+               mv sysupgrade.tgz /tmp
+               tar xzf /tmp/sysupgrade.tgz
+               rm -f /tmp/sysupgrade.tgz
+               sync
+       }
+
+       echo "- init -"
        
-killall hotplug2
-exec /sbin/init
+       killall hotplug2
+       exec /sbin/init
+fi