Browse Source

Improved early's init to give 2s more if $root is not yet available after udevsettle, and fixed typo on init='s handling

karasz/new-early
Alejandro Mery 17 years ago
parent
commit
70af505f05
1 changed files with 6 additions and 3 deletions
  1. +6
    -3
      target/early/initramfs/init.sh

+ 6
- 3
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"

Loading…
Cancel
Save