r8222 - in trunk: BOOK BOOK/chapter01 BOOK/chapter07 bootscripts bootscripts/lfs/init.d

dnicholson at linuxfromscratch.org dnicholson at linuxfromscratch.org
Wed Jul 18 06:26:34 PDT 2007


Author: dnicholson
Date: 2007-07-18 07:26:34 -0600 (Wed, 18 Jul 2007)
New Revision: 8222

Added:
   trunk/bootscripts/lfs/init.d/consolelog
Modified:
   trunk/BOOK/chapter01/changelog.xml
   trunk/BOOK/chapter07/console.xml
   trunk/BOOK/general.ent
   trunk/bootscripts/ChangeLog
   trunk/bootscripts/Makefile
   trunk/bootscripts/lfs/init.d/modules
Log:
Add the consolelog bootscript and remove printk handling in modules script


Modified: trunk/BOOK/chapter01/changelog.xml
===================================================================
--- trunk/BOOK/chapter01/changelog.xml	2007-07-17 20:09:10 UTC (rev 8221)
+++ trunk/BOOK/chapter01/changelog.xml	2007-07-18 13:26:34 UTC (rev 8222)
@@ -156,6 +156,16 @@
     </listitem>
 
     <listitem>
+      <para>2007-07-18</para>
+      <itemizedlist>
+        <listitem>
+          <para>[dnicholson] - Described the configuration of the consolelog
+          bootscript.</para>
+        </listitem>
+      </itemizedlist>
+    </listitem>
+
+    <listitem>
       <para>2007-06-12</para>
       <itemizedlist>
         <listitem>
@@ -177,7 +187,7 @@
         <listitem>
           <para>[ken] - Upgrade to tar-1.17, fixes
           <ulink url="&lfs-ticket-root;2029">#2029</ulink>.</para>
-	</listitem>
+        </listitem>
       </itemizedlist>
     </listitem>
 

Modified: trunk/BOOK/chapter07/console.xml
===================================================================
--- trunk/BOOK/chapter07/console.xml	2007-07-17 20:09:10 UTC (rev 8221)
+++ trunk/BOOK/chapter07/console.xml	2007-07-18 13:26:34 UTC (rev 8222)
@@ -16,14 +16,16 @@
   </indexterm>
 
   <para>This section discusses how to configure the <command>console</command>
-  bootscript that sets up the keyboard map and the console font. If non-ASCII
-  characters (e.g., the copyright sign, the British pound sign and Euro symbol)
-  will not be used and the keyboard is a U.S. one, skip this section. Without
+  and <command>consolelog</command> bootscripts that set up the keyboard map,
+  console font and console kernel log level. If non-ASCII characters (e.g.,
+  the copyright sign, the British pound sign and Euro symbol) will not be used
+  and the keyboard is a U.S. one, much of this section can be skipped. Without
   the configuration file, the <command>console</command> bootscript will do
   nothing.</para>
 
-  <para>The <command>console</command> script reads the
-  <filename>/etc/sysconfig/console</filename> file for configuration information.
+  <para>The <command>console</command>  and <command>consolelog</command>
+  script reads the <filename>/etc/sysconfig/console</filename> file for
+  configuration information.
   Decide which keymap and screen font will be used. Various language-specific
   HOWTOs can also help with this, see <ulink
   url="http://www.tldp.org/HOWTO/HOWTO-INDEX/other-lang.html"/>. If still in
@@ -38,6 +40,15 @@
   <variablelist>
 
     <varlistentry>
+      <term>LOGLEVEL</term>
+      <listitem>
+        <para>This variable specifies the log level for kernel messages sent
+        to the console as set by <command>dmesg</command>. Valid levels are
+        from "1" (no messages) to "8". The default level is "7".</para>
+      </listitem>
+    </varlistentry>
+
+    <varlistentry>
       <term>KEYMAP</term>
       <listitem>
         <para>This variable specifies the arguments for the

Modified: trunk/BOOK/general.ent
===================================================================
--- trunk/BOOK/general.ent	2007-07-17 20:09:10 UTC (rev 8221)
+++ trunk/BOOK/general.ent	2007-07-18 13:26:34 UTC (rev 8222)
@@ -1,6 +1,6 @@
 <?xml version="1.0" encoding="ISO-8859-1"?>
-<!ENTITY version "SVN-20070714">
-<!ENTITY releasedate "July 14, 2007">
+<!ENTITY version "SVN-20070718">
+<!ENTITY releasedate "July 18, 2007">
 <!ENTITY milestone "6.3">
 <!ENTITY generic-version "development"> <!-- Use "development", "testing", or "x.y[-pre{x}]" -->
 

Modified: trunk/bootscripts/ChangeLog
===================================================================
--- trunk/bootscripts/ChangeLog	2007-07-17 20:09:10 UTC (rev 8221)
+++ trunk/bootscripts/ChangeLog	2007-07-18 13:26:34 UTC (rev 8222)
@@ -1,3 +1,10 @@
+2007-07-18	Dan Nicholson	<dnicholson at linuxfromscratch.org>
+	* Makefile, lfs/init.d/consolelog: New bootscript controlling the
+	  kernel log level on the console. This is controlled by the LOGLEVEL
+	  variable in /etc/sysconfig/console.
+	* lfs/init.d/modules: Remove the log level handling since this is
+	  done in the consolelog script now.
+
 2007-06-16	Dan Nicholson	<dnicholson at linuxfromscratch.org>
 	* lfs/init.d/mountfs, lfs/init.d/mountkernfs, lfs/init.d/setclock,
 	  lfs/init.d/modules, lfs/sysconfig/network-devices/if{up,down}:

Modified: trunk/bootscripts/Makefile
===================================================================
--- trunk/bootscripts/Makefile	2007-07-17 20:09:10 UTC (rev 8221)
+++ trunk/bootscripts/Makefile	2007-07-18 13:26:34 UTC (rev 8222)
@@ -27,6 +27,7 @@
 	install -m ${CONFMODE} lfs/init.d/functions ${EXTDIR}/rc.d/init.d/
 	install -m ${MODE} lfs/init.d/halt          ${EXTDIR}/rc.d/init.d/
 	install -m ${MODE} lfs/init.d/console       ${EXTDIR}/rc.d/init.d/
+	install -m ${MODE} lfs/init.d/consolelog    ${EXTDIR}/rc.d/init.d/
 	install -m ${MODE} lfs/init.d/localnet      ${EXTDIR}/rc.d/init.d/
 	install -m ${MODE} lfs/init.d/modules       ${EXTDIR}/rc.d/init.d/
 	install -m ${MODE} lfs/init.d/mountfs       ${EXTDIR}/rc.d/init.d/
@@ -67,6 +68,7 @@
 	ln -sf ../init.d/localnet    ${EXTDIR}/rc.d/rc6.d/S90localnet
 	ln -sf ../init.d/reboot      ${EXTDIR}/rc.d/rc6.d/S99reboot
 	ln -sf ../init.d/mountkernfs ${EXTDIR}/rc.d/rcsysinit.d/S00mountkernfs
+	ln -sf ../init.d/consolelog  ${EXTDIR}/rc.d/rcsysinit.d/S02consolelog
 	ln -sf ../init.d/modules     ${EXTDIR}/rc.d/rcsysinit.d/S05modules
 	ln -sf ../init.d/udev        ${EXTDIR}/rc.d/rcsysinit.d/S10udev
 	ln -sf ../init.d/swap        ${EXTDIR}/rc.d/rcsysinit.d/S20swap

Added: trunk/bootscripts/lfs/init.d/consolelog
===================================================================
--- trunk/bootscripts/lfs/init.d/consolelog	                        (rev 0)
+++ trunk/bootscripts/lfs/init.d/consolelog	2007-07-18 13:26:34 UTC (rev 8222)
@@ -0,0 +1,61 @@
+#!/bin/sh
+# Begin $rc_base/init.d/consolelog
+
+########################################################################
+#
+# Description : Set the kernel log level for the console
+#
+# Authors     : Dan Nicholson - dnicholson at linuxfromscratch.org
+#
+# Version     : 00.00
+#
+# Notes       : /proc must be mounted before this can run
+#
+########################################################################
+
+. /etc/sysconfig/rc
+. ${rc_functions}
+
+# set the default loglevel
+LOGLEVEL=7
+if [ -r /etc/sysconfig/console ]; then
+	. /etc/sysconfig/console
+fi
+
+case "${1}" in
+	start)
+		case "$LOGLEVEL" in
+		[1-8])
+			boot_mesg "Setting the console log level to ${LOGLEVEL}..."
+			dmesg -n $LOGLEVEL
+			evaluate_retval
+			;;
+		*)
+			boot_mesg "Console log level '${LOGLEVEL}' is invalid" ${FAILURE}
+			echo_failure
+			;;
+		esac
+		;;
+	status)
+		# Read the current value if possible
+		if [ -r /proc/sys/kernel/printk ]; then
+			read level line < /proc/sys/kernel/printk
+		else
+			boot_mesg "Can't read the current console log level" ${FAILURE}
+			echo_failure
+		fi
+
+		# Print the value
+		if [ -n "$level" ]; then
+			${ECHO} -e "${INFO}The current console log level" \
+				"is ${level}${NORMAL}"
+		fi
+		;;
+
+	*)
+		echo "Usage: ${0} {start|status}"
+		exit 1
+		;;
+esac
+
+# End $rc_base/init.d/consolelog


Property changes on: trunk/bootscripts/lfs/init.d/consolelog
___________________________________________________________________
Name: svn:executable
   + *

Modified: trunk/bootscripts/lfs/init.d/modules
===================================================================
--- trunk/bootscripts/lfs/init.d/modules	2007-07-17 20:09:10 UTC (rev 8221)
+++ trunk/bootscripts/lfs/init.d/modules	2007-07-18 13:26:34 UTC (rev 8222)
@@ -21,20 +21,6 @@
 case "${1}" in
 	start)
 
-		# If proc is mounted, find the current kernel
-		# message level 
-		if [ -f /proc/sys/kernel/printk ]; then
-			prev_msg=`cat /proc/sys/kernel/printk | \
-					sed 'l 1' | sed -n '2~0p' | \
-					sed 's/\\\//'`
-		else 
-			prev_msg="6"
-		fi
-
-		# Now set the message level to 1 so not to make too 
-		# much noise when loading modules
-		dmesg -n 1
-
 		# Only try to load modules if the user has actually given us
 		# some modules to load.
 		if egrep -qv '^(#|$)' /etc/sysconfig/modules 2>/dev/null
@@ -80,8 +66,6 @@
 			exec 0>&9 9>&-
 
 		fi
-		# Set the kernel message level back to it's previous value.
-		dmesg -n "${prev_msg}"
 		;;
 	*)
 		echo "Usage: ${0} {start}"




More information about the lfs-book mailing list