dracut-lib: do not leave debug mode in getarg and getargs

master
Harald Hoyer 2010-01-15 12:34:50 +01:00
parent 0e8b76a57e
commit 4bb570c9a4
1 changed files with 16 additions and 21 deletions

View File

@ -1,5 +1,4 @@
getarg() { getarg() {
set +x
local o line local o line
if [ -z "$CMDLINE" ]; then if [ -z "$CMDLINE" ]; then
if [ -e /etc/cmdline ]; then if [ -e /etc/cmdline ]; then
@ -12,28 +11,12 @@ getarg() {
fi fi
for o in $CMDLINE; do for o in $CMDLINE; do
[ "$o" = "$1" ] && return 0 [ "$o" = "$1" ] && return 0
[ "${o%%=*}" = "${1%=}" ] && { echo ${o#*=}; setdebug; return 0; } [ "${o%%=*}" = "${1%=}" ] && { echo ${o#*=}; return 0; }
done done
setdebug
return 1 return 1
} }


setdebug() {
if [ -z "$RDDEBUG" ]; then
if [ -e /proc/cmdline ]; then
RDDEBUG=no
if getarg rdinitdebug; then
RDDEBUG=yes
fi
fi
fi
[ "$RDDEBUG" = "yes" ] && set -x
}

setdebug

getargs() { getargs() {
set +x
local o line found local o line found
if [ -z "$CMDLINE" ]; then if [ -z "$CMDLINE" ]; then
if [ -e /etc/cmdline ]; then if [ -e /etc/cmdline ]; then
@ -51,11 +34,23 @@ getargs() {
found=1; found=1;
fi fi
done done
[ -n "$found" ] && { setdebug; return 0;} [ -n "$found" ] && return 0
setdebug return 1;
return 1
} }


setdebug() {
if [ -z "$RDDEBUG" ]; then
if [ -e /proc/cmdline ]; then
RDDEBUG=no
if getarg rdinitdebug; then
RDDEBUG=yes
fi
fi
fi
[ "$RDDEBUG" = "yes" ] && set -x
}


source_all() { source_all() {
local f local f
[ "$1" ] && [ -d "/$1" ] || return [ "$1" ] && [ -d "/$1" ] || return