summaryrefslogtreecommitdiff
path: root/packages/busybox
diff options
context:
space:
mode:
authorRod Whitby <rod@whitby.id.au>2005-02-20 22:58:14 +0000
committerRod Whitby <rod@whitby.id.au>2005-02-20 22:58:14 +0000
commit400ba9cbac901693cebd7314b8e0d7bab992923d (patch)
treef680bc9946105b63d6bc471bce453c735affb1d3 /packages/busybox
parent7f8f09d73c1b0bee258fddab537a3b8a25f5341a (diff)
Merge bk://nslu2-linux@nslu2-linux.bkbits.net/openembedded
into home.(none):/home/slug/openembedded 2005/02/21 09:27:59+10:30 (none)!rwhitby Switchbox fixes for OpenSlug - test for runboot BKrev: 42191606HMhwE0VUeRSHbVYKOiY3JQ
Diffstat (limited to 'packages/busybox')
-rw-r--r--packages/busybox/switchbox-1.00/linuxrc23
1 files changed, 9 insertions, 14 deletions
diff --git a/packages/busybox/switchbox-1.00/linuxrc b/packages/busybox/switchbox-1.00/linuxrc
index 7ce4adbbdd..850d359000 100644
--- a/packages/busybox/switchbox-1.00/linuxrc
+++ b/packages/busybox/switchbox-1.00/linuxrc
@@ -21,42 +21,34 @@ if [ -z "$mounted" ] && /bin/mount -rt jffs2 /dev/mtdblock4 /mnt/jffs2 ; then
if [ -f /mnt/jffs2/.recovery ] ; then
/bin/echo "Preferred root device is /dev/ram0 (recovery)"
mounted=
- runboot=
prefroot=
elif [ -f /mnt/jffs2/.sda1root ] ; then
/bin/echo "Preferred root device is /dev/sda1 (disk 1)"
mounted=/mnt/newroot
- runboot=/bin/init
prefroot=sda1
elif [ -f /mnt/jffs2/.sda2root ] ; then
/bin/echo "Preferred root device is /dev/sda2 (disk 1)"
mounted=/mnt/newroot
- runboot=/bin/init
prefroot=sda2
elif [ -f /mnt/jffs2/.sdb1root ] ; then
/bin/echo "Preferred root device is /dev/sdb1 (disk 2)"
mounted=/mnt/newroot
- runboot=/bin/init
prefroot=sdb1
elif [ -f /mnt/jffs2/.sdb2root ] ; then
/bin/echo "Preferred root device is /dev/sdb2 (disk 2)"
mounted=/mnt/newroot
- runboot=/bin/init
prefroot=sdb2
elif [ -f /mnt/jffs2/.ramdisk ] ; then
/bin/echo "Preferred root device is /dev/ram1 (maintenence)"
mounted=/mnt/newroot
- runboot=/bin/init
prefroot=maintenence
elif [ -f /mnt/jffs2/.nfsroot ] ; then
/bin/echo "Preferred root device is through NFS"
mounted=/mnt/newroot
- runboot=/linuxrc
prefroot=nfsroot
else
/bin/echo "Preferred root device is jffs2"
mounted=/mnt/jffs2
- runboot=/linuxrc
prefroot=jffs2
fi
fi
@@ -74,7 +66,6 @@ if [ -n "$prefroot" ] ; then
else
/bin/echo "Cant find valid rootfs on /dev/$prefroot, using recovery ..."
mounted=
- runboot=
fi
elif [ $prefroot = "maintenence" ] ; then
@@ -104,7 +95,6 @@ if [ -n "$prefroot" ] ; then
else
/bin/echo "Cant find valid rootfs on ram1, using recovery ..."
mounted=
- runboot=
fi
elif [ $prefroot = "nfsroot" ] ; then
@@ -134,11 +124,9 @@ if [ -n "$prefroot" ] ; then
-L /mnt/newroot/bin/init -o -x /mnt/newroot/bin/init ] ; then
/bin/echo "Root filesystem will be mounted from a NFS root ..."
mounted=/mnt/newroot
- runboot=/linuxrc
else
/bin/echo "Cant find valid NFS rootfs, using recovery ..."
mounted=
- runboot=
fi
else
@@ -146,11 +134,9 @@ if [ -n "$prefroot" ] ; then
-L /mnt/jffs2/bin/init -o -x /mnt/jffs2/bin/init ] ; then
/bin/echo "Root filesystem will be mounted from /dev/mtdblock4 ..."
mounted=/mnt/jffs2
- runboot=/linuxrc
else
/bin/echo "Cant find valid rootfs on jffs2, using recovery ..."
mounted=
- runboot=
fi
fi
fi
@@ -167,6 +153,15 @@ if [ -n "$mounted" ] ; then
umount /proc
cd $mounted
/sbin/pivot_root . initrd
+ if [ -x /linuxrc ] ; then
+ runboot=/linuxrc
+ elif [ -x /sbin/init ] ; then
+ runboot=/sbin/init
+ elif [ -x /bin/init ] ; then
+ runboot=/bin/init
+ else
+ runboot=/bin/sh
+ fi
exec chroot . $runboot < dev/console > dev/console 2>&1
fi