lkml.org 
[lkml]   [2013]   [Sep]   [20]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
Date
From
Subject[PATCH RESEND] printk: report boot console names during cut-over
This reports the names of boot consoles as they're being disabled to
help identify which is which during cut-over. Helps answer the question
"which boot console actually got activated?" once the regular console
is running, mostly when debugging boot console failures.

Signed-off-by: Kees Cook <keescook@chromium.org>
---
kernel/printk/printk.c | 16 ++++++++++------
1 file changed, 10 insertions(+), 6 deletions(-)

diff --git a/kernel/printk/printk.c b/kernel/printk/printk.c
index b4e8500..0dc54c9 100644
--- a/kernel/printk/printk.c
+++ b/kernel/printk/printk.c
@@ -2361,14 +2361,18 @@ void register_console(struct console *newcon)
if (bcon &&
((newcon->flags & (CON_CONSDEV | CON_BOOT)) == CON_CONSDEV) &&
!keep_bootcon) {
- /* we need to iterate through twice, to make sure we print
- * everything out, before we unregister the console(s)
+ /* We need to iterate through all boot consoles, to make
+ * sure we print everything out, before we unregister them.
*/
- printk(KERN_INFO "console [%s%d] enabled, bootconsole disabled\n",
- newcon->name, newcon->index);
- for_each_console(bcon)
- if (bcon->flags & CON_BOOT)
+ for_each_console(bcon) {
+ if (bcon->flags & CON_BOOT) {
+ printk(KERN_INFO "console [%s%d] enabled, "
+ "bootconsole [%s%d] disabled\n",
+ newcon->name, newcon->index,
+ bcon->name, bcon->index);
unregister_console(bcon);
+ }
+ }
} else {
printk(KERN_INFO "%sconsole [%s%d] enabled\n",
(newcon->flags & CON_BOOT) ? "boot" : "" ,
--
1.7.9.5

--
Kees Cook
Chrome OS Security


\
 
 \ /
  Last update: 2013-09-20 17:41    [W:0.054 / U:0.516 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site