summaryrefslogtreecommitdiff
path: root/packages/initrdscripts/files/init.sh
diff options
context:
space:
mode:
Diffstat (limited to 'packages/initrdscripts/files/init.sh')
-rw-r--r--packages/initrdscripts/files/init.sh15
1 files changed, 10 insertions, 5 deletions
diff --git a/packages/initrdscripts/files/init.sh b/packages/initrdscripts/files/init.sh
index 8b9fe12429..c3b4336e40 100644
--- a/packages/initrdscripts/files/init.sh
+++ b/packages/initrdscripts/files/init.sh
@@ -25,7 +25,7 @@ dev_setup()
}
read_args() {
- CMDLINE=`cat /proc/cmdline`
+ [ -z "$CMDLINE" ] && CMDLINE=`cat /proc/cmdline`
for arg in $CMDLINE; do
optarg=`expr "x$arg" : 'x[^=]*=\(.*\)'`
case $arg in
@@ -40,7 +40,7 @@ read_args() {
}
load_modules() {
- for module in $MODULE_DIR/*; do
+ for module in $MODULE_DIR/$1; do
echo "initramfs: Loading $module module"
source $module
done
@@ -52,14 +52,18 @@ boot_root() {
}
fatal() {
- echo $1
- echo
+ echo $1 >$CONSOLE
+ echo >$CONSOLE
exec sh
}
echo "Starting initramfs boot..."
early_setup
+load_modules '0*'
+
+[ -z "$CONSOLE" ] && CONSOLE="/dev/console"
+
read_args
if [ -n "$rootdelay" ]; then
@@ -69,7 +73,8 @@ fi
dev_setup
-load_modules
+load_modules '[1-9]*'
+
[ -n "$BOOT_ROOT" ] && boot_root
fatal "No valid root device was specified. Please add root=/dev/something to the kernel command-line and try again."