diff options
author | Dirk von Suchodoletz | 2006-01-20 01:54:30 +0100 |
---|---|---|
committer | Dirk von Suchodoletz | 2006-01-20 01:54:30 +0100 |
commit | 0b2c8e82d02c600f2fc395947e7317f3b4d20f25 (patch) | |
tree | 56c453a1ddf8b7d6675857d8dd13906a41071ad4 | |
parent | dxsinitrd: mehr zeug in kommandozeilenparameter (diff) | |
download | core-0b2c8e82d02c600f2fc395947e7317f3b4d20f25.tar.gz core-0b2c8e82d02c600f2fc395947e7317f3b4d20f25.tar.xz core-0b2c8e82d02c600f2fc395947e7317f3b4d20f25.zip |
Abstimmung der Debuglevel (siehe auch /trac Wiki)
git-svn-id: http://svn.openslx.org/svn/openslx/dxs/ld4@26 95ad53e4-c205-0410-b2fa-d234c58c8868
-rwxr-xr-x | initrd/initrd-stuff/bin/hwautocfg | 5 | ||||
-rwxr-xr-x | initrd/initrd-stuff/bin/servconfig | 5 | ||||
-rw-r--r-- | initrd/initrd-stuff/etc/functions | 13 | ||||
-rwxr-xr-x | initrd/initrd-stuff/init | 11 |
4 files changed, 26 insertions, 8 deletions
diff --git a/initrd/initrd-stuff/bin/hwautocfg b/initrd/initrd-stuff/bin/hwautocfg index 8afbb74e..8630dfb3 100755 --- a/initrd/initrd-stuff/bin/hwautocfg +++ b/initrd/initrd-stuff/bin/hwautocfg @@ -4,7 +4,7 @@ # script for linux diskless clients, using hwconfig from # knoppix as base tool # -# Author(s): Dirk von Suchodoletz <dirk@goe.net>, 16-01-2006 +# Author(s): Dirk von Suchodoletz <dirk@goe.net>, 20-01-2006 # Blabla # Blub # @@ -258,6 +258,9 @@ fi . /etc/sysconfig/config . /etc/distro-functions +# heavy debugging output in level 3 and above ... +[ $DEBUGLEVEL -gt 2 ] && set -x + # set X11 configuration file if [ -n "${D_XF86CONFFILE}" ] ; then D_XF86CONFFILE="/mnt/${D_XF86CONFFILE}" diff --git a/initrd/initrd-stuff/bin/servconfig b/initrd/initrd-stuff/bin/servconfig index 0ac46875..11b13998 100755 --- a/initrd/initrd-stuff/bin/servconfig +++ b/initrd/initrd-stuff/bin/servconfig @@ -4,7 +4,7 @@ # for linux diskless clients (executed within initial # ramdisk) # -# Author(s): Dirk von Suchodoletz <dirk@goe.net>, 17-01-2006 +# Author(s): Dirk von Suchodoletz <dirk@goe.net>, 20-01-2006 # Blabla # Blub # @@ -23,6 +23,9 @@ # get location of logfile definition . /mnt/etc/${D_SYSCONFDIR}/logfile +# heavy debugging output in level 3 and above ... +[ $DEBUGLEVEL -gt 2 ] && set -x + ####################################################################### # copy distro specific scripts, programs, libraries and configs cp -a /etc/sysconfig/files/* /mnt & diff --git a/initrd/initrd-stuff/etc/functions b/initrd/initrd-stuff/etc/functions index 6eca05c1..e0e3bfbd 100644 --- a/initrd/initrd-stuff/etc/functions +++ b/initrd/initrd-stuff/etc/functions @@ -1,9 +1,18 @@ ####################################################################### # produce error message and if $2 is empty run (debug) shell error() { -echo -e "An error occured during execution of $0 script:\n\n$1\n" +local message="An error occured during execution of $0 script:\n\n$1\n" +# check if LOGFILE is already defined +[ -z "${LOGFILE}" ] && LOGFILE="/dev/null" +# check if LOGFILE is really writeable +[ -n "${LOGFILE}" ] && [ -w /mnt/${LOGFILE} ] || LOGFILE="/dev/null" +# if nonfatal error else fatal error message and shell if [ -n "$2" ] ; then - echo -e "This error is not fatal - continuing ...\n" +[ "$DEBUGLEVEL" -ge 1 ] && \ + echo -e "{$message} This error is not fatal - continuing ...\n" \ + >> /mnt/${LOGFILE} +[ "$DEBUGLEVEL" -gt 1 ] && \ + echo -e "{$message} This error is not fatal - continuing ...\n" else echo -e "Running shell for debugging purposes now ...\n" /bin/sh diff --git a/initrd/initrd-stuff/init b/initrd/initrd-stuff/init index 4f983390..3654c51c 100755 --- a/initrd/initrd-stuff/init +++ b/initrd/initrd-stuff/init @@ -2,8 +2,8 @@ . /etc/functions || ( echo -e "The functions file contains a lot of script \ functionality. Without this\ninit script will not run." && exit 1 ) # configuration settings (several file and directory variables) -. /etc/sysconfig/config || error " The distribution \ -specific configuration file could not be found" +. /etc/sysconfig/config || ( echo -e " The distribution \ +specific configuration file could not be found" && exit 1 ) date export PATH=/bin:/sbin:/usr/bin/:/usr/sbin @@ -126,13 +126,16 @@ echo "Setting debuglevel to ${DEBUGLEVEL}" export MODPRV=" " export LOGFILE if [ "${DEBUGLEVEL}" -gt 0 ] ; then - # if LOGFILE should be used within initial ramdisk add '/mnt' in fron + # if LOGFILE should be used within initial ramdisk add '/mnt' in front # of the variable LOGFILE="/var/log/dxs-boot.log" + [ "${DEBUGLEVEL}" -eq 2 ] && MODPRV="-v" [ "${DEBUGLEVEL}" -gt 2 ] && { set -x # modprobe should be verbose - MODPRV="-v"; } + MODPRV="-v"; + # and the kernel too + echo "7 7 7 7" >/proc/sys/kernel/printk; } else # switch off most of kernel debug output echo "0 0 0 0" >/proc/sys/kernel/printk |