bootscript suggestion

Archaic archaic at linuxfromscratch.org
Thu Apr 16 05:57:11 PDT 2009


The kernel printk level is initially chosen before the consolelog script
runs, yet that script demands that the choice is also made in
/etc/sysconfig/console else it may override your initial decision. If
someone uses 'quiet' on the kernel cmdline, they've made their choice
and, IMO, should not have to make it again. /etc/sysconfig/console need
only exist when someone wants something other than 7 or 4. IOW, it is a
fallback. That's fine as long as the default is the current level chosen
before this script runs. Here is my proposed change (which also
optionally handles the incorrect usage scenario in the 2nd hunk):

--- consolelog.orig	2009-04-16 08:41:16.000000000 -0400
+++ consolelog	2009-04-16 08:46:01.000000000 -0400
@@ -17,7 +17,7 @@
 . ${rc_functions}
 
 # set the default loglevel
-LOGLEVEL=7
+read LOGLEVEL OTHER </proc/sys/kernel/printk
 if [ -r /etc/sysconfig/console ]; then
 	. /etc/sysconfig/console
 fi
@@ -31,7 +31,8 @@
 			evaluate_retval
 			;;
 		*)
-			boot_mesg "Console log level '${LOGLEVEL}' is invalid" ${FAILURE}
+			boot_mesg "Console log level '${LOGLEVEL}' is invalid. Using default of 7..." ${FAILURE}
+			dmesg -n 7
 			echo_failure
 			;;
 		esac


-- 
Archaic




More information about the lfs-dev mailing list