no more global $CMDLINE

Do not use the global variable CMDLINE anymore. Use
CMDLINE=$(getcmdline)
This commit is contained in:
Harald Hoyer 2013-09-05 09:57:48 +02:00
parent b2fab575dc
commit 8d3d72a68c
6 changed files with 9 additions and 9 deletions

View 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()

View File

@ -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"

View File

@ -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

View File

@ -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 ]' > \

View File

@ -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

View File

@ -226,6 +226,8 @@ write_fs_tab() {
fi
_rw=0
CMDLINE=$(getcmdline)
for _o in $CMDLINE; do
case $_o in
rw)