From: Harald Hoyer Date: Fri, 25 Mar 2011 12:32:02 +0000 (+0100) Subject: base/dracut-lib.sh: s/RDDEBUG/RD_DEBUG/g X-Git-Tag: 009~21 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=9e7a3bf2423ccbce290c1fd3241ecd067da7e738;p=thirdparty%2Fdracut.git base/dracut-lib.sh: s/RDDEBUG/RD_DEBUG/g RDDEBUG would be unset by the environment cleanup in init and logging would be turned off afterwards. --- diff --git a/modules.d/99base/dracut-lib.sh b/modules.d/99base/dracut-lib.sh index c870bd238..a5406ab95 100755 --- a/modules.d/99base/dracut-lib.sh +++ b/modules.d/99base/dracut-lib.sh @@ -69,24 +69,24 @@ getarg() { case $1 in -y) if _dogetarg $2; then echo 1 - [ "$RDDEBUG" = "yes" ] && set -x + [ "$RD_DEBUG" = "yes" ] && set -x return 0 fi shift 2;; -n) if _dogetarg $2; then echo 0; - [ "$RDDEBUG" = "yes" ] && set -x + [ "$RD_DEBUG" = "yes" ] && set -x return 1 fi shift 2;; *) if _dogetarg $1; then - [ "$RDDEBUG" = "yes" ] && set -x + [ "$RD_DEBUG" = "yes" ] && set -x return 0; fi shift;; esac done - [ "$RDDEBUG" = "yes" ] && set -x + [ "$RD_DEBUG" = "yes" ] && set -x return 1 } @@ -134,10 +134,10 @@ getargs() { done if [ -n "$_val" ]; then echo -n $_val - [ "$RDDEBUG" = "yes" ] && set -x + [ "$RD_DEBUG" = "yes" ] && set -x return 0 fi - [ "$RDDEBUG" = "yes" ] && set -x + [ "$RD_DEBUG" = "yes" ] && set -x return 1; } @@ -195,16 +195,16 @@ splitsep() { } setdebug() { - if [ -z "$RDDEBUG" ]; then + if [ -z "$RD_DEBUG" ]; then if [ -e /proc/cmdline ]; then - RDDEBUG=no + RD_DEBUG=no if getargbool 0 rd.debug -y rdinitdebug -y rdnetdebug; then - RDDEBUG=yes + RD_DEBUG=yes fi fi - export RDDEBUG + export RD_DEBUG fi - [ "$RDDEBUG" = "yes" ] && set -x + [ "$RD_DEBUG" = "yes" ] && set -x } setdebug diff --git a/modules.d/99base/init b/modules.d/99base/init index ffab217d9..2b8cfd9d1 100755 --- a/modules.d/99base/init +++ b/modules.d/99base/init @@ -386,6 +386,7 @@ fi if [ -f /etc/capsdrop ]; then . /etc/capsdrop info "Calling $INIT with capabilities $CAPS_INIT_DROP dropped." + unset RD_DEBUG exec /usr/sbin/capsh --drop="$CAPS_INIT_DROP" -- -c "exec /sbin/switch_root \"$NEWROOT\" \"$INIT\" $initargs" || { warn "Command:" warn capsh --drop=$CAPS_INIT_DROP -- -c exec switch_root "$NEWROOT" "$INIT" $initargs @@ -393,6 +394,7 @@ if [ -f /etc/capsdrop ]; then emergency_shell } else + unset RD_DEBUG exec /sbin/switch_root "$NEWROOT" "$INIT" $initargs || { warn "Something went very badly wrong in the initramfs. Please " warn "file a bug against dracut."