]> git.ipfire.org Git - thirdparty/dracut.git/commitdiff
no more global $CMDLINE
authorHarald Hoyer <harald@redhat.com>
Thu, 5 Sep 2013 07:57:48 +0000 (09:57 +0200)
committerHarald Hoyer <harald@redhat.com>
Thu, 5 Sep 2013 07:57:48 +0000 (09:57 +0200)
Do not use the global variable CMDLINE anymore. Use
CMDLINE=$(getcmdline)

modules.d/40network/net-lib.sh
modules.d/80cms/cmsifup.sh
modules.d/90dmsquash-live/dmsquash-live-root.sh
modules.d/90livenet/parse-livenet.sh
modules.d/99base/dracut-lib.sh
modules.d/99fs-lib/fs-lib.sh

index 82c4f7234d3e31fbaef77d125695f98dfef8f557..5b629172a2ddc331e92affd41be82624b94a7ce8 100644 (file)
@@ -250,8 +250,6 @@ ibft_to_cmdline() {
             echo $mac > /tmp/net.${dev}.has_ibft_config
         done
     ) >> /etc/cmdline.d/40-ibft.conf
-    # reread cmdline
-    unset CMDLINE
 }
 
 parse_iscsi_root()
index c19f2c8818860c270904c5ed31db476e6c2d643a..b3616504823f94342c933e20462eb29de955bca3 100755 (executable)
@@ -32,7 +32,6 @@ fi
        echo "nameserver=$i"
     done
 } > /etc/cmdline.d/80-cms.conf
-unset CMDLINE
 
 [ -e "/tmp/net.ifaces" ] && read IFACES < /tmp/net.ifaces
 IFACES="$IFACES $DEVICE"
index 14e84e14bbb1edeb6ca6dbb3e92c276f44495d6d..8951f80cf9b75adef9fece078fd9ae4fd2c32400 100755 (executable)
@@ -57,7 +57,7 @@ det_img_fs() {
 }
 
 modprobe squashfs
-
+CMDLINE=$(getcmdline)
 for arg in $CMDLINE; do case $arg in ro|rw) liverw=$arg ;; esac; done
 # mount the backing of the live image first
 mkdir -m 0755 -p /run/initramfs/live
index 365eca19243e649d6688bff46f48aca2bc3a54db..6c847baabee923d14e0d1dc1e32c1ef9e3675eaf 100755 (executable)
@@ -11,7 +11,6 @@ if [ -n "$updates" ]; then
     # make sure network comes up even if we're doing a local live device
     if [ -z "$netroot" ]; then
        echo > /tmp/net.ifaces
-       unset CMDLINE
     fi
     echo "$updates" > /tmp/liveupdates.info
     echo '[ -e /tmp/liveupdates.done ]' > \
index ef8c5a3c0f43bf3c2ac84f01ef349e8fe92d13a6..74d7d35269ee70e70e85d3210cc9de72bcced748 100755 (executable)
@@ -99,11 +99,12 @@ killall_proc_mountpoint() {
     done
 }
 
-_getcmdline() {
+getcmdline() {
     local _line
     local _i
+    local CMDLINE_ETC_D
+    local CMDLINE_ETC
     unset _line
-    unset CMDLINE_ETC CMDLINE_ETC_D
 
     if [ -e /etc/cmdline ]; then
         while read -r _line; do
@@ -120,6 +121,7 @@ _getcmdline() {
         read -r CMDLINE </proc/cmdline;
         CMDLINE="$CMDLINE_ETC_D $CMDLINE_ETC $CMDLINE"
     fi
+    printf "%s" "$CMDLINE"
 }
 
 _dogetarg() {
@@ -127,7 +129,7 @@ _dogetarg() {
     unset _val
     unset _o
     unset _doecho
-    _getcmdline
+    CMDLINE=$(getcmdline)
 
     for _o in $CMDLINE; do
         if [ "${_o%%=*}" = "${1%%=*}" ]; then
@@ -258,7 +260,7 @@ _dogetargs() {
     local _o _found _key
     unset _o
     unset _found
-    _getcmdline
+    CMDLINE=$(getcmdline)
     _key="$1"
     set --
     for _o in $CMDLINE; do
index 88e734859f9420af02093fc12cd798c2d43a31ce..b60a46e12532c84842676dc1e9dfa8216f369c85 100755 (executable)
@@ -226,6 +226,8 @@ write_fs_tab() {
     fi
 
     _rw=0
+
+    CMDLINE=$(getcmdline)
     for _o in $CMDLINE; do
         case $_o in
             rw)