]> git.ipfire.org Git - thirdparty/dracut.git/commitdiff
dracut-lib: getarg(), getargs() read command line also from /etc/cmdline
authorHarald Hoyer <harald@redhat.com>
Fri, 24 Jul 2009 11:42:10 +0000 (13:42 +0200)
committerHarald Hoyer <harald@redhat.com>
Sat, 25 Jul 2009 09:09:35 +0000 (11:09 +0200)
Also honor parameters in /etc/cmdline.

getarg(): If the argument is first fround in /proc/cmdline, then it is
used

modules.d/99base/dracut-lib.sh

index f007fccf8f9109607cddca6ae28956e579d53486..b4dd731301a89e5af446e12944d0aac0656eef95 100644 (file)
@@ -1,6 +1,10 @@
 getarg() {
     local o line
-    [ "$CMDLINE" ] || read CMDLINE </proc/cmdline;
+    if [ -z "$CMDLINE" ]; then
+       read CMDLINE_ETC </etc/cmdline;
+       read CMDLINE </proc/cmdline;
+       CMDLINE="$CMDLINE $CMDLINE_ETC"
+    fi
     for o in $CMDLINE; do
        [ "$o" = "$1" ] && return 0
        [ "${o%%=*}" = "${1%=}" ] && { echo ${o#*=}; return 0; }
@@ -10,7 +14,11 @@ getarg() {
 
 getargs() {
     local o line found
-    [ "$CMDLINE" ] || read CMDLINE </proc/cmdline;
+    if [ -z "$CMDLINE" ]; then
+       read CMDLINE_ETC </etc/cmdline;
+       read CMDLINE </proc/cmdline;
+       CMDLINE="$CMDLINE $CMDLINE_ETC"
+    fi
     for o in $CMDLINE; do
        [ "$o" = "$1" ] && return 0
        if [ "${o%%=*}" = "${1%=}" ]; then