From: Michael Prokop Date: Sun, 20 Jan 2008 18:53:56 +0000 (+0100) Subject: Update config_log() + config_debug() X-Git-Tag: 0.8.3 X-Git-Url: https://git.grml.org/?p=grml-autoconfig.git;a=commitdiff_plain;h=b04d499bbcaaebb4167def16ac650ed27355fef8 Update config_log() + config_debug() --- diff --git a/autoconfig.functions b/autoconfig.functions index 5442b8c..cd3c764 100755 --- a/autoconfig.functions +++ b/autoconfig.functions @@ -4,7 +4,7 @@ # Authors: grml-team (grml.org), (c) Klaus Knopper , (c) Michael Prokop # Bug-Reports: see http://grml.org/bugs/ # License: This file is licensed under the GPL v2. -# Latest change: Mon Jän 14 21:34:16 CET 2008 [mika] +# Latest change: Son Jän 20 19:51:41 CET 2008 [mika] ################################################################################ # {{{ path, variables, signals, umask, zsh @@ -116,26 +116,27 @@ fi # {{{ debug config_debug(){ - if checkbootparam "debug"; then - BOOTDEBUG="yes" - fi - if stringinstring "BOOT_IMAGE=debug " "$CMDLINE" ; then - BOOTDEBUG="yes" - fi + checkbootparam "debug" && BOOTDEBUG="yes" + stringinstring "BOOT_IMAGE=debug " "$CMDLINE" && BOOTDEBUG="yes" + rundebugshell(){ if [ -n "$BOOTDEBUG" ]; then - einfo "Starting intermediate shell stage $stage as requested by \"debug\" option." - eindent - if [ -r /etc/grml/screenrc ] ; then - einfo "Starting GNU screen to be able to use a full featured shell environment." - einfo "Just exit the shells (and therefore screen) to continue boot process..." - /bin/zsh -c "screen -c /etc/grml/screenrc" - else - einfo "Notice that the shell does not provide job handling: ctrl-z, bg and fg won't work!" - einfo "Just exit the shell to continue boot process..." - /bin/zsh - fi - eoutdent + einfo "Starting intermediate shell stage $stage as requested by \"debug\" option." + if [ grep -q "debug=noscreen" "$CMDLINE" ] ; then + /bin/zsh + else + eindent + if [ -r /etc/grml/screenrc ] ; then + einfo "Starting GNU screen to be able to use a full featured shell environment." + einfo "Just exit the shells (and therefore screen) to continue boot process..." + /bin/zsh -c "screen -c /etc/grml/screenrc" + else + einfo "Notice that the shell does not provide job handling: ctrl-z, bg and fg won't work!" + einfo "Just exit the shell to continue boot process..." + /bin/zsh + fi + eoutdent + fi fi } } @@ -143,16 +144,16 @@ config_debug(){ # {{{ log config_log(){ -if checkbootparam "log"; then - export DEBUG="/tmp/grml.log.`date +%Y%m%d`" - touch $DEBUG - einfo "Bootparameter log found. Log files: ${DEBUG} and /var/log/boot." - eindent - einfo "Starting bootlogd." - bootlogd -r -c 1>>$DEBUG 2>&1 ; eend $? - eoutdent +if checkbootparam "log" || checkbootparam "debug" ; then + export DEBUG="/tmp/grml.log.`date +%Y%m%d`" + touch $DEBUG + einfo "Bootparameter log found. Log files: ${DEBUG} and /var/log/boot" + eindent + einfo "Starting bootlogd." # known to be *very* unreliable :( + bootlogd -r -c 1>>$DEBUG 2>&1 ; eend $? + eoutdent else - DEBUG="/dev/null" + DEBUG="/dev/null" fi } # }}} diff --git a/debian/changelog b/debian/changelog index 55e5947..6c59378 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,11 @@ +grml-autoconfig (0.8.3) unstable; urgency=low + + * config_log(): log as well if bootoption debug is present + * config_debug(): support bootoption debug=noscreen to be able to + run a non-screen session + + -- Michael Prokop Sun, 20 Jan 2008 19:52:14 +0100 + grml-autoconfig (0.8.2) unstable; urgency=low * grml-autoconfig scripts: if an "auto" configured device can be found in diff --git a/grml-autoconfig b/grml-autoconfig index 83cb54f..8c79617 100755 --- a/grml-autoconfig +++ b/grml-autoconfig @@ -4,7 +4,7 @@ # Authors: grml-team (grml.org), (c) Michael Prokop # Bug-Reports: see http://grml.org/bugs/ # License: This file is licensed under the GPL v2. -# Latest change: Sam Nov 03 17:22:09 CET 2007 [mika] +# Latest change: Son Jän 20 19:44:11 CET 2008 [mika] ################################################################################ # http://wiki.debian.org/LSBInitScripts => @@ -77,16 +77,16 @@ if [ -z "$INSTALLED" -a -e /live/cow ] ; then fi if [ -z "$SPLASH" ] ; then - stage=5 - rundebugshell + stage=5 + rundebugshell fi if [ -z "$BOOTDEBUG" ] ; then - einfo "Setting kernel ring buffer to level 2." - echo "2" > /proc/sys/kernel/printk ; eend $? + einfo "Setting kernel ring buffer to level 2." + echo "2" > /proc/sys/kernel/printk ; eend $? else - einfo "Setting kernel ring buffer to level 6. Adjust manually via running dmesg -n \$VALUE." - echo "6" > /proc/sys/kernel/printk ; eend $? + einfo "Setting kernel ring buffer to level 6. Adjust manually via running dmesg -n \$VALUE." + echo "6" > /proc/sys/kernel/printk ; eend $? fi checkvalue $CONFIG_SYSLOG && config_syslog @@ -282,15 +282,15 @@ checkvalue $CONFIG_XSTARTUP && config_x_startup # {{{ debug if [ -z "$SPLASH" ] ; then - stage=6 - rundebugshell + stage=6 + rundebugshell fi if [ -n "$BOOTDEBUG" ] ; then - CMDLINE="$(cat /proc/cmdline)" - [ -d /cdrom/bootparams/ ] && CMDLINE="$CMDLINE $(cat /cdrom/bootparams/*)" - einfo "Bootoption debug detected. Printing kernel command line:" - echo "$CMDLINE" + CMDLINE="$(cat /proc/cmdline)" + [ -d /cdrom/bootparams/ ] && CMDLINE="$CMDLINE $(cat /cdrom/bootparams/*)" + einfo "Bootoption debug detected. Printing kernel command line:" + echo "$CMDLINE" fi # }}}