Third attempt at new Unslung linuxrc
authorRod Whitby <rod@whitby.id.au>
Sat, 30 Apr 2005 13:18:11 +0000 (13:18 +0000)
committerRod Whitby <rod@whitby.id.au>
Sat, 30 Apr 2005 13:18:11 +0000 (13:18 +0000)
BKrev: 42738593YJar6dTLvCHT9lLLlZPtEg

packages/nslu2-binary-only/unslung-rootfs-2.3r25/linuxrc

index bdf8401..c86bad2 100644 (file)
@@ -117,14 +117,14 @@ if [ $prefroot = "jffs2" ] ; then
 fi
 
 
+/bin/umount /proc
+
 # Pivot to the desired rootfs and run the initial executable.
 
 runboot=
 
 if [ -n "$mounted" ] ; then
 
-    /bin/umount /proc
-
     cd $mounted
 
     if [ -x ./linuxrc -o -L ./linuxrc ] ; then
@@ -140,8 +140,11 @@ if [ -n "$mounted" ] ; then
     /sbin/pivot_root . initrd
 
     exec /usr/sbin/chroot . $runboot < /dev/console 1> /dev/console 2> /dev/console
-fi
 
-/bin/umount /proc
+else
+
+    exec /bin/init
+
+fi
 
 exit 0