Browse Source

no more global $CMDLINE

Do not use the global variable CMDLINE anymore. Use
CMDLINE=$(getcmdline)
master
Harald Hoyer 12 years ago
parent
commit
8d3d72a68c
  1. 2
      modules.d/40network/net-lib.sh
  2. 1
      modules.d/80cms/cmsifup.sh
  3. 2
      modules.d/90dmsquash-live/dmsquash-live-root.sh
  4. 1
      modules.d/90livenet/parse-livenet.sh
  5. 10
      modules.d/99base/dracut-lib.sh
  6. 2
      modules.d/99fs-lib/fs-lib.sh

2
modules.d/40network/net-lib.sh

@ -250,8 +250,6 @@ ibft_to_cmdline() { @@ -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()

1
modules.d/80cms/cmsifup.sh

@ -32,7 +32,6 @@ fi @@ -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"

2
modules.d/90dmsquash-live/dmsquash-live-root.sh

@ -57,7 +57,7 @@ det_img_fs() { @@ -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

1
modules.d/90livenet/parse-livenet.sh

@ -11,7 +11,6 @@ if [ -n "$updates" ]; then @@ -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 ]' > \

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

@ -99,11 +99,12 @@ killall_proc_mountpoint() { @@ -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() { @@ -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() { @@ -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() { @@ -258,7 +260,7 @@ _dogetargs() {
local _o _found _key
unset _o
unset _found
_getcmdline
CMDLINE=$(getcmdline)
_key="$1"
set --
for _o in $CMDLINE; do

2
modules.d/99fs-lib/fs-lib.sh

@ -226,6 +226,8 @@ write_fs_tab() { @@ -226,6 +226,8 @@ write_fs_tab() {
fi

_rw=0

CMDLINE=$(getcmdline)
for _o in $CMDLINE; do
case $_o in
rw)

Loading…
Cancel
Save