From 8d3d72a68c8b1857ecf8b252e75f1e90adcc67a6 Mon Sep 17 00:00:00 2001 From: Harald Hoyer Date: Thu, 5 Sep 2013 09:57:48 +0200 Subject: [PATCH] no more global $CMDLINE Do not use the global variable CMDLINE anymore. Use CMDLINE=$(getcmdline) --- modules.d/40network/net-lib.sh | 2 -- modules.d/80cms/cmsifup.sh | 1 - modules.d/90dmsquash-live/dmsquash-live-root.sh | 2 +- modules.d/90livenet/parse-livenet.sh | 1 - modules.d/99base/dracut-lib.sh | 10 ++++++---- modules.d/99fs-lib/fs-lib.sh | 2 ++ 6 files changed, 9 insertions(+), 9 deletions(-) diff --git a/modules.d/40network/net-lib.sh b/modules.d/40network/net-lib.sh index 82c4f723..5b629172 100644 --- a/modules.d/40network/net-lib.sh +++ b/modules.d/40network/net-lib.sh @@ -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() diff --git a/modules.d/80cms/cmsifup.sh b/modules.d/80cms/cmsifup.sh index c19f2c88..b3616504 100755 --- a/modules.d/80cms/cmsifup.sh +++ b/modules.d/80cms/cmsifup.sh @@ -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" diff --git a/modules.d/90dmsquash-live/dmsquash-live-root.sh b/modules.d/90dmsquash-live/dmsquash-live-root.sh index 14e84e14..8951f80c 100755 --- a/modules.d/90dmsquash-live/dmsquash-live-root.sh +++ b/modules.d/90dmsquash-live/dmsquash-live-root.sh @@ -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 diff --git a/modules.d/90livenet/parse-livenet.sh b/modules.d/90livenet/parse-livenet.sh index 365eca19..6c847baa 100755 --- a/modules.d/90livenet/parse-livenet.sh +++ b/modules.d/90livenet/parse-livenet.sh @@ -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 ]' > \ diff --git a/modules.d/99base/dracut-lib.sh b/modules.d/99base/dracut-lib.sh index ef8c5a3c..74d7d352 100755 --- a/modules.d/99base/dracut-lib.sh +++ b/modules.d/99base/dracut-lib.sh @@ -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