[Solved] Kernel loglevel

For discussions about programming, programming questions/advice, and projects that don't really have anything to do with Puppy.
Post Reply
Message
Author
User avatar
MinHundHettePerro
Posts: 852
Joined: Thu 05 Feb 2009, 22:22
Location: SE

[Solved] Kernel loglevel

#1 Post by MinHundHettePerro »

In most puppies the kernel loglevel is set to:

Code: Select all

# cat /proc/sys/kernel/printk
3	4	1	3
due to (I think) compiling the kernel with the BK kernel printk.c.patch (or iguleder's lower_verbosity.patch):

Code: Select all

--- kernel/printk.c	2010-02-24 18:52:17.000000000 +0000
+++ kernel/printk.cNEW	2010-03-02 17:28:42.000000000 +0000
@@ -58,7 +58,7 @@
 
 /* We show everything that is MORE important than this.. */
 #define MINIMUM_CONSOLE_LOGLEVEL 1 /* Minimum loglevel we let people use */
-#define DEFAULT_CONSOLE_LOGLEVEL 7 /* anything MORE serious than KERN_DEBUG */
+#define DEFAULT_CONSOLE_LOGLEVEL 3 /* anything MORE serious than KERN_ERR */
 
 DECLARE_WAIT_QUEUE_HEAD(log_wait);
Could the same loglevel be set without applying the above-mentioned printk.c.patch when compiling the kernel (and without adding loglevel=x on the boot kernel-line)
by issuing

Code: Select all

# echo "3 4 1 3" > /proc/sys/kernel/printk
in /etc/rc.d/rc.sysinit?

Just scratching my head here ... :? :? :)/MHHP
Last edited by MinHundHettePerro on Thu 04 Sep 2014, 20:28, edited 1 time in total.
[color=green]Celeron 2.8 GHz, 1 GB, i82845, many ptns, modes 12, 13
Dual Xeon 3.2 GHz, 1 GB, nvidia quadro nvs 285[/color]
Slackos & 214X, ... and Q6xx
[color=darkred]Nämen, vaf....[/color] [color=green]ln -s /dev/null MHHP[/color]

amigo
Posts: 2629
Joined: Mon 02 Apr 2007, 06:52

#2 Post by amigo »

Yup. However, by the time that rc.sysinit is run, all the boot-time messages/errors will have already been printed. It's a harmless little patch which is easily applied and as un-intrusive as they get.

User avatar
MinHundHettePerro
Posts: 852
Joined: Thu 05 Feb 2009, 22:22
Location: SE

#3 Post by MinHundHettePerro »

Thanks, amigo!

I have nothing against the patch at all, it's just me trying to learn more about procfs.

A follow-up question then pops up (using printk as example):
If, say, some loglevel values were written to /proc/sys/kernel/printk just after the mounting of proc in initrd_/init would they be carried over the umounting of proc just before the switchroot and the repeated mounting of proc in /etc/rc.d/rc.sysinit? Or does mounting proc again mean that it carries some pristine values?

Wondering .../MHHP
[color=green]Celeron 2.8 GHz, 1 GB, i82845, many ptns, modes 12, 13
Dual Xeon 3.2 GHz, 1 GB, nvidia quadro nvs 285[/color]
Slackos & 214X, ... and Q6xx
[color=darkred]Nämen, vaf....[/color] [color=green]ln -s /dev/null MHHP[/color]

amigo
Posts: 2629
Joined: Mon 02 Apr 2007, 06:52

#4 Post by amigo »

That's a very good question -I'm sure you'll have fun finding out! Nearly everything under /proc survives a remount -I think only references to the root device change.

User avatar
MinHundHettePerro
Posts: 852
Joined: Thu 05 Feb 2009, 22:22
Location: SE

#5 Post by MinHundHettePerro »

amigo wrote:That's a very good question -I'm sure you'll have fun finding out!
Yes, I did :).
amigo wrote:Nearly everything under /proc survives a remount -I think only references to the root device change.
Yes, so it seems. I tried writing to a few (harmless) files in /proc and the values written survived.

Cheers :)/MHHP
[color=green]Celeron 2.8 GHz, 1 GB, i82845, many ptns, modes 12, 13
Dual Xeon 3.2 GHz, 1 GB, nvidia quadro nvs 285[/color]
Slackos & 214X, ... and Q6xx
[color=darkred]Nämen, vaf....[/color] [color=green]ln -s /dev/null MHHP[/color]

Post Reply