From 70af505f05e0903f7b57dd34d18a8935e0dcb93b Mon Sep 17 00:00:00 2001 From: Alejandro Mery Date: Mon, 25 Feb 2008 03:15:26 +0000 Subject: [PATCH] Improved early's init to give 2s more if $root is not yet available after udevsettle, and fixed typo on init='s handling --- target/early/initramfs/init.sh | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/target/early/initramfs/init.sh b/target/early/initramfs/init.sh index 1cc24b2..ea423e0 100644 --- a/target/early/initramfs/init.sh +++ b/target/early/initramfs/init.sh @@ -18,7 +18,7 @@ export PATH=/usr/bin:/usr/sbin:/bin:/sbin modules= root= mode= -initrd=/sbin/init +init=/sbin/init NOCOLOR= initargs="$*" @@ -96,6 +96,9 @@ fi if [ -n "$root" ]; then udevsettle + # give it a second chance to appear (delay 2s) + [ -e "$root" ] || sleep 2; + if [ -e "$root" ]; then /lib/udev/vol_id "$root" > /tmp/$$.vol_id . /tmp/$$.vol_id @@ -110,7 +113,7 @@ if [ -n "$root" ]; then fi # wait for /sbin/init -while [ ! -x "/rootfs$initrd" ]; do +while [ ! -x "/rootfs$init" ]; do echo "Please mount root device on /rootfs and exit to continue" setsid /bin/sh < /dev/console > /dev/console 2> /dev/console done @@ -122,4 +125,4 @@ check mount -t none -o move /sys /rootfs/sys check mount -t none -o move /proc /rootfs/proc status -exec switch_root /rootfs "$initrd" "$initargs" +exec switch_root /rootfs "$init" "$initargs"