From: Matthias Kunze <Matthias.Kunze@gmx-topmail.de>

Add a boot-time option to set the loglevel.  We already have `quiet' and
`debug', which set it to specific levels.  This is better.  

Signed-off-by: Andrew Morton <akpm@osdl.org>
---

 25-akpm/Documentation/kernel-parameters.txt |   14 ++++++++++++++
 25-akpm/init/main.c                         |    8 ++++++++
 2 files changed, 22 insertions(+)

diff -puN Documentation/kernel-parameters.txt~loglevel-boot-option Documentation/kernel-parameters.txt
--- 25/Documentation/kernel-parameters.txt~loglevel-boot-option	2005-02-28 14:56:22.000000000 -0800
+++ 25-akpm/Documentation/kernel-parameters.txt	2005-02-28 14:57:25.000000000 -0800
@@ -653,6 +653,20 @@ running once the system is up.
 	logibm.irq=	[HW,MOUSE] Logitech Bus Mouse Driver
 			Format: <irq>
 
+	loglevel=	All Kernel Messages with a loglevel smaller than the
+			console loglevel will be printed to the console. It can
+			also be changed with klogd or other programs. The
+			loglevels are defined as follows:
+
+			0 (KERN_EMERG)		system is unusable
+			1 (KERN_ALERT)		action must be taken immediately
+			2 (KERN_CRIT)		critical conditions
+			3 (KERN_ERR)		error conditions
+			4 (KERN_WARNING)	warning conditions
+			5 (KERN_NOTICE)		normal but significant condition
+			6 (KERN_INFO)		informational
+			7 (KERN_DEBUG)		debug-level messages
+
 	log_buf_len=n	Sets the size of the printk ring buffer, in bytes.
 			Format is n, nk, nM.  n must be a power of two.  The
 			default is set in kernel config.
diff -puN init/main.c~loglevel-boot-option init/main.c
--- 25/init/main.c~loglevel-boot-option	2005-02-28 14:56:22.000000000 -0800
+++ 25-akpm/init/main.c	2005-02-28 14:56:22.000000000 -0800
@@ -209,6 +209,14 @@ static int __init quiet_kernel(char *str
 __setup("debug", debug_kernel);
 __setup("quiet", quiet_kernel);
 
+static int __init loglevel(char *str)
+{
+	get_option(&str, &console_loglevel);
+	return 1;
+}
+
+__setup("loglevel=", loglevel);
+
 /*
  * Unknown boot options get handed to init, unless they look like
  * failed parameters
_