no more global $CMDLINE

Do not use the global variable CMDLINE anymore. Use
CMDLINE=$(getcmdline)
master
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 echo $mac > /tmp/net.${dev}.has_ibft_config
done done
) >> /etc/cmdline.d/40-ibft.conf ) >> /etc/cmdline.d/40-ibft.conf
# reread cmdline
unset CMDLINE
} }


parse_iscsi_root() parse_iscsi_root()

View File

@ -32,7 +32,6 @@ fi
echo "nameserver=$i" echo "nameserver=$i"
done done
} > /etc/cmdline.d/80-cms.conf } > /etc/cmdline.d/80-cms.conf
unset CMDLINE


[ -e "/tmp/net.ifaces" ] && read IFACES < /tmp/net.ifaces [ -e "/tmp/net.ifaces" ] && read IFACES < /tmp/net.ifaces
IFACES="$IFACES $DEVICE" IFACES="$IFACES $DEVICE"

View File

@ -57,7 +57,7 @@ det_img_fs() {
} }


modprobe squashfs modprobe squashfs

CMDLINE=$(getcmdline)
for arg in $CMDLINE; do case $arg in ro|rw) liverw=$arg ;; esac; done for arg in $CMDLINE; do case $arg in ro|rw) liverw=$arg ;; esac; done
# mount the backing of the live image first # mount the backing of the live image first
mkdir -m 0755 -p /run/initramfs/live 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 # make sure network comes up even if we're doing a local live device
if [ -z "$netroot" ]; then if [ -z "$netroot" ]; then
echo > /tmp/net.ifaces echo > /tmp/net.ifaces
unset CMDLINE
fi fi
echo "$updates" > /tmp/liveupdates.info echo "$updates" > /tmp/liveupdates.info
echo '[ -e /tmp/liveupdates.done ]' > \ echo '[ -e /tmp/liveupdates.done ]' > \

View File

@ -99,11 +99,12 @@ killall_proc_mountpoint() {
done done
} }


_getcmdline() { getcmdline() {
local _line local _line
local _i local _i
local CMDLINE_ETC_D
local CMDLINE_ETC
unset _line unset _line
unset CMDLINE_ETC CMDLINE_ETC_D


if [ -e /etc/cmdline ]; then if [ -e /etc/cmdline ]; then
while read -r _line; do while read -r _line; do
@ -120,6 +121,7 @@ _getcmdline() {
read -r CMDLINE </proc/cmdline; read -r CMDLINE </proc/cmdline;
CMDLINE="$CMDLINE_ETC_D $CMDLINE_ETC $CMDLINE" CMDLINE="$CMDLINE_ETC_D $CMDLINE_ETC $CMDLINE"
fi fi
printf "%s" "$CMDLINE"
} }


_dogetarg() { _dogetarg() {
@ -127,7 +129,7 @@ _dogetarg() {
unset _val unset _val
unset _o unset _o
unset _doecho unset _doecho
_getcmdline CMDLINE=$(getcmdline)


for _o in $CMDLINE; do for _o in $CMDLINE; do
if [ "${_o%%=*}" = "${1%%=*}" ]; then if [ "${_o%%=*}" = "${1%%=*}" ]; then
@ -258,7 +260,7 @@ _dogetargs() {
local _o _found _key local _o _found _key
unset _o unset _o
unset _found unset _found
_getcmdline CMDLINE=$(getcmdline)
_key="$1" _key="$1"
set -- set --
for _o in $CMDLINE; do for _o in $CMDLINE; do

View File

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


_rw=0 _rw=0

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