summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--hooks/filesystems1
-rw-r--r--init26
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}")
diff --git a/init b/init
index 3896e68..97b7b88 100644
--- a/init
+++ b/init
@@ -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