diff options
author | Aaron Griffin <aaron@archlinux.org> | 2007-03-07 06:42:56 +0100 |
---|---|---|
committer | Aaron Griffin <aaron@archlinux.org> | 2007-03-07 06:42:56 +0100 |
commit | 6313137a1e3f0c7bd8ed5db1c41a7f7370bf482a (patch) | |
tree | 5631f0f1220156ceef91888a8f2fa9adeda4884c | |
parent | 6a4c36b14aa896147b548eab950a91d7f2774014 (diff) | |
download | mkinitcpio-6313137a1e3f0c7bd8ed5db1c41a7f7370bf482a.tar.gz mkinitcpio-6313137a1e3f0c7bd8ed5db1c41a7f7370bf482a.tar.xz |
Changes / suggestions from Jan Peter den Heijer <jpdenheijer@gmail.com>
* Check for root device, drop down to recovery prompt and allow for reboot
* Handle rootdelay in init (before udev is killed), to properly populate devices
git-svn-id: http://projects.archlinux.org/svn/initramfs/mkinitcpio@199 880c04e9-e011-0410-abf7-b926e227c9cd
-rw-r--r-- | hooks/filesystems | 1 | ||||
-rw-r--r-- | init | 26 |
2 files changed, 19 insertions, 8 deletions
diff --git a/hooks/filesystems b/hooks/filesystems index 28c4d0e..a7c9916 100644 --- a/hooks/filesystems +++ b/hooks/filesystems @@ -13,7 +13,6 @@ run_hook () /bin/sleep "${rootdelay}" msg "done." export rootdelay=0 - kinit_params="${kinit_params} rootdelay=0" fi eval $(/bin/parseblock "${root}") @@ -86,6 +86,13 @@ if [ -e "/hooks" ]; then done fi +if [ "${rootdelay}" != "0" ]; then + msg -n "Waiting for devices to settle..." + /bin/sleep "${rootdelay}" + export rootdelay=0 + msg "done." +fi + if [ "${break}" = "y" ]; then echo ":: Break requested, type 'exit' to resume operation" echo " NOTE: klibc contains no 'ls' binary, used 'echo *' instead" @@ -99,14 +106,19 @@ if [ "x${udevpid}" != "x" ]; then /bin/sleep 0.01 fi -msg ":: Initramfs Completed - control passing to kinit" -if [ -f "/message" ]; then - msg "$(cat /message)" -fi - -if [ "$rootdelay" != "0" ]; then - kinit_params="${kinit_params} rootdelay=${rootdelay}" +if [ ! -e "${root}" ]; then + err "Unable to create/detect root device '${root}'" + msg "Dropping to a recovery shell... type 'exit' to reboot" + PS1="ramfs$ " /bin/sh -i + msg "Rebooting..." + /bin/reboot +else + msg ":: Initramfs Completed - control passing to kinit" + if [ -f "/message" ]; then + msg "$(cat /message)" + fi fi echo "/sbin/modprobe" > /proc/sys/kernel/modprobe + exec /bin/kinit -- "root=${root}" ${kinit_params} "${runlevel}" > /dev/null 2>&1 |