lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite for Android: free password hash cracker in your pocket
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <alpine.LNX.1.10.0804270510010.20150@fbirervta.pbzchgretzou.qr>
Date:	Sun, 27 Apr 2008 05:10:38 +0200 (CEST)
From:	Jan Engelhardt <jengelh@...putergmbh.de>
To:	Linux Kernel Mailing List <linux-kernel@...r.kernel.org>
Subject: [3/3] Re: Colored Kernel Output for 2.6.25

commit 872d296f6521ecdcbddd3ffe74d7565abfa8c3fa
Author: Jan Engelhardt <jengelh@...putergmbh.de>
Date:   Sun Apr 27 03:55:17 2008 +0200

    Colored kernel message output (3/3)
    
    Ref-From: Miguel Botón
    
    I modified your lastest patch a little bit so now you can set the
    message color for each log level in the kernel config.
    
    References: http://lkml.org/lkml/2007/10/6/105
    
    Signed-off-by: Jan Engelhardt <jengelh@....de>
---
 drivers/char/Kconfig |   86 +++++++++++++++++++++++++++++++++++------
 drivers/char/vt.c    |   16 ++++----
 2 files changed, 81 insertions(+), 21 deletions(-)

diff --git a/drivers/char/Kconfig b/drivers/char/Kconfig
index 3f5877e..600c75a 100644
--- a/drivers/char/Kconfig
+++ b/drivers/char/Kconfig
@@ -58,28 +58,20 @@ config VT_CONSOLE
 
 	  If unsure, say Y.
 
-config VT_CKO
+menuconfig VT_CKO
 	bool "Colored kernel message output"
 	depends on VT_CONSOLE
 	---help---
 	This option enables kernel messages to be emitted in
 	colors other than the default.
+	You can also change the colors at run-time, or set them at boot-time
+	using the "vt.printk_color" option.
+
 	This option enlarges your kernel by approximately 1/2 KB.
 
 	If unsure, say N.
 
-config VT_PRINTK_COLOR
-	hex "Colored kernel message output"
-	range 0x00 0xFF
-	depends on VT_CKO
-	default 0x07
-	---help---
-	This option defines with which color kernel messages will be
-	printed to the console. This applies to all log levels.
-	You can change the colors at run-time, or set them at boot-time
-	using the "vt.printk_color" option.
-
-	The value you need to enter here is the value is composed
+	The value you need to enter is the value is composed
 	(OR-ed) of a foreground and a background color.
 
 	Foreground:
@@ -103,6 +95,74 @@ config VT_PRINTK_COLOR
 
 	For example, 0x1F would yield white on red.
 
+if VT_CKO
+
+config VT_PRINTK_EMERG_COLOR
+	hex 'Color for "emergency" level'
+	range 0x00 0xFF
+	default 0x07
+	---help---
+	This option defines in which color kernel emergency messages
+	will be printed to the console.
+
+config VT_PRINTK_ALERT_COLOR
+	hex 'Color for "alert" level'
+	range 0x00 0xFF
+	default 0x07
+	---help---
+	This option defines in which color kernel alert messages
+	will be printed to the console.
+
+config VT_PRINTK_CRIT_COLOR
+	hex 'Color for "critical" level'
+	range 0x00 0xFF
+	default 0x07
+	---help---
+	This option defines in which color critical kernel messages
+	will be printed to the console.
+
+config VT_PRINTK_ERROR_COLOR
+	hex 'Color for "error" level'
+	range 0x00 0xFF
+	default 0x07
+	---help---
+	This option defines in which color kernel error messages
+	will be printed to the console.
+
+config VT_PRINTK_WARNING_COLOR
+	hex 'Color for "warning" level'
+	range 0x00 0xFF
+	default 0x07
+	---help---
+	This option defines in which color kernel warning messages
+	will be printed to the console.
+
+config VT_PRINTK_NOTICE_COLOR
+	hex 'Color for "notice" level'
+	range 0x00 0xFF
+	default 0x07
+	---help---
+	This option defines in which color kernel notices
+	will be printed to the console.
+
+config VT_PRINTK_INFO_COLOR
+	hex 'Color for "info" level'
+	range 0x00 0xFF
+	default 0x07
+	---help---
+	This option defines in which color informational kernel messages
+	will be printed to the console.
+
+config VT_PRINTK_DEBUG_COLOR
+	hex 'Color for "debug" level'
+	range 0x00 0xFF
+	default 0x07
+	---help---
+	This option defines in which color kernel debugging messages
+	will be printed to the console.
+
+endif # VT_CKO
+
 config HW_CONSOLE
 	bool
 	depends on VT && !S390 && !UML
diff --git a/drivers/char/vt.c b/drivers/char/vt.c
index 75ca0cf..a3f2ff3 100644
--- a/drivers/char/vt.c
+++ b/drivers/char/vt.c
@@ -2395,14 +2395,14 @@ struct tty_driver *console_driver;
 
 #ifdef CONFIG_VT_CKO
 static unsigned int printk_color[8] __read_mostly = {
-	CONFIG_VT_PRINTK_COLOR, /* KERN_EMERG */
-	CONFIG_VT_PRINTK_COLOR, /* KERN_ALERT */
-	CONFIG_VT_PRINTK_COLOR, /* KERN_CRIT */
-	CONFIG_VT_PRINTK_COLOR, /* KERN_ERR */
-	CONFIG_VT_PRINTK_COLOR, /* KERN_WARNING */
-	CONFIG_VT_PRINTK_COLOR, /* KERN_NOTICE */
-	CONFIG_VT_PRINTK_COLOR, /* KERN_INFO */
-	CONFIG_VT_PRINTK_COLOR, /* KERN_DEBUG */
+	CONFIG_VT_PRINTK_EMERG_COLOR,
+	CONFIG_VT_PRINTK_ALERT_COLOR,
+	CONFIG_VT_PRINTK_CRIT_COLOR,
+	CONFIG_VT_PRINTK_ERROR_COLOR,
+	CONFIG_VT_PRINTK_WARNING_COLOR,
+	CONFIG_VT_PRINTK_NOTICE_COLOR,
+	CONFIG_VT_PRINTK_INFO_COLOR,
+	CONFIG_VT_PRINTK_DEBUG_COLOR,
 };
 module_param_array(printk_color, uint, NULL, S_IRUGO | S_IWUSR);
 
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ