From: Andrey Borzenkov Date: Thu, 4 Mar 2010 13:02:43 +0000 (+0100) Subject: Pass init argument(s) to real init X-Git-Tag: 005~24 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=b63fd4d905fcf42f163298bbd03c3b70aad24388;p=thirdparty%2Fdracut.git Pass init argument(s) to real init Common wisdom to enter single user on Linux is to edit command line and add "single". This was not possible because switch_root was always called with empty init arguments. Collect them from command line and pass to real init when switching root. Signed-off-by: Andrey Borzenkov --- diff --git a/modules.d/99base/init b/modules.d/99base/init index 3b719c28d..ab7aafe29 100755 --- a/modules.d/99base/init +++ b/modules.d/99base/init @@ -259,10 +259,10 @@ done initargs="" +read CLINE /dev/null ; then ignoreargs="console BOOT_IMAGE" # only pass arguments after init= to the init - read CLINE /dev/null ; then initargs="$initargs $x" done unset CLINE +else + set $CLINE + shift + for x in "$@"; do + case "$x" in + [0-9]|s|S|single|emergency|auto ) + initargs="$initargs $x" + ;; + esac + done fi # Debug: Copy state