From: Harald Hoyer Date: Mon, 11 Apr 2011 11:59:03 +0000 (+0200) Subject: base/init: set DRACUT_QUIET based on "loglevel" and "quiet" X-Git-Tag: 011~101 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=a6c34848eb18e129f10d52fcb1bb4beb9f5322de;p=thirdparty%2Fdracut.git base/init: set DRACUT_QUIET based on "loglevel" and "quiet" --- diff --git a/modules.d/99base/init b/modules.d/99base/init index 7727e4b8b..37e1bc43b 100755 --- a/modules.d/99base/init +++ b/modules.d/99base/init @@ -77,8 +77,19 @@ RD_DEBUG="" [ -c /dev/null ] || mknod -m 0666 /dev/null c 1 3 # mount some important things -mount -t proc -o nosuid,noexec,nodev /proc /proc >/dev/null 2>&1 -mount -t sysfs -o nosuid,noexec,nodev /sys /sys >/dev/null 2>&1 +[ ! -d /proc/self ] && \ + mount -t proc -o nosuid,noexec,nodev /proc /proc >/dev/null 2>&1 + +[ ! -d /sys/kernel ] && \ + mount -t sysfs -o nosuid,noexec,nodev /sys /sys >/dev/null 2>&1 + +setdebug + +if [ "$RD_DEBUG" = "yes" ]; then + getarg quiet && DRACUT_QUIET="yes" + a=$(getarg loglevel=) + [ -n "$a" ] && [ $a -ge 8 ] && unset DRACUT_QUIET +fi if [ -x /lib/systemd/systemd-timestamp ]; then RD_TIMESTAMP=$(/lib/systemd/systemd-timestamp) @@ -131,8 +142,7 @@ ln -fs /run/lock /var/lock cp -ar /var/run.bak/* /run/ 2>/dev/null cp -ar /var/lock.bak/* /run/lock/ 2>/dev/null -if getargbool 0 rd.debug -y rdinitdebug -y rdnetdebug; then - getarg quiet && DRACUT_QUIET="yes" +if [ "$RD_DEBUG" = "yes" ]; then mkfifo /run/initramfs/initlog.pipe loginit $DRACUT_QUIET /dev/console 2>&1 & exec >/run/initramfs/initlog.pipe 2>&1 @@ -140,8 +150,6 @@ else exec 0<>/dev/console 1<>/dev/console 2<>/dev/console fi -setdebug - source_conf /etc/conf.d # run scriptlets to parse the command line @@ -318,6 +326,7 @@ while pidof udevd >/dev/null 2>&1; do HARD="-9" done +set +x # Turn off debugging for this section # Clean up the environment for i in $(export -p); do i=${i#declare -x} @@ -335,9 +344,9 @@ for i in $(export -p); do done initargs="" - read CLINE /dev/null ; then + set +x # Turn off debugging for this section ignoreargs="console BOOT_IMAGE" # only pass arguments after init= to the init CLINE=${CLINE#*init=} @@ -351,6 +360,7 @@ if getarg init= >/dev/null ; then done unset CLINE else + set +x # Turn off debugging for this section set $CLINE shift for x in "$@"; do