diff options
author | Kees Cook <keescook@chromium.org> | 2013-11-12 18:08:49 -0500 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2013-11-12 22:09:13 -0500 |
commit | 6b80239447f6785b719345e8913af420d8ec0818 (patch) | |
tree | fdf049770237f77a86c3d9e41b1382e4d3628f5c /kernel | |
parent | 8f6b2ae49a84841c4bcf00cff35752b223c3f8d6 (diff) |
printk: report console names during cut-over
This reports the names of 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>
Acked-by: Frederic Weisbecker <fweisbec@gmail.com>
Cc: Joe Perches <joe@perches.com>
Cc: Tejun Heo <tj@kernel.org>
Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'kernel')
-rw-r--r-- | kernel/printk/printk.c | 19 |
1 files changed, 9 insertions, 10 deletions
diff --git a/kernel/printk/printk.c b/kernel/printk/printk.c index b4e8500afdb3..555ad2d445b4 100644 --- a/kernel/printk/printk.c +++ b/kernel/printk/printk.c | |||
@@ -2358,21 +2358,18 @@ void register_console(struct console *newcon) | |||
2358 | * users know there might be something in the kernel's log buffer that | 2358 | * users know there might be something in the kernel's log buffer that |
2359 | * went to the bootconsole (that they do not see on the real console) | 2359 | * went to the bootconsole (that they do not see on the real console) |
2360 | */ | 2360 | */ |
2361 | printk(KERN_INFO "%sconsole [%s%d] enabled\n", | ||
2362 | (newcon->flags & CON_BOOT) ? "boot" : "" , | ||
2363 | newcon->name, newcon->index); | ||
2361 | if (bcon && | 2364 | if (bcon && |
2362 | ((newcon->flags & (CON_CONSDEV | CON_BOOT)) == CON_CONSDEV) && | 2365 | ((newcon->flags & (CON_CONSDEV | CON_BOOT)) == CON_CONSDEV) && |
2363 | !keep_bootcon) { | 2366 | !keep_bootcon) { |
2364 | /* we need to iterate through twice, to make sure we print | 2367 | /* We need to iterate through all boot consoles, to make |
2365 | * everything out, before we unregister the console(s) | 2368 | * sure we print everything out, before we unregister them. |
2366 | */ | 2369 | */ |
2367 | printk(KERN_INFO "console [%s%d] enabled, bootconsole disabled\n", | ||
2368 | newcon->name, newcon->index); | ||
2369 | for_each_console(bcon) | 2370 | for_each_console(bcon) |
2370 | if (bcon->flags & CON_BOOT) | 2371 | if (bcon->flags & CON_BOOT) |
2371 | unregister_console(bcon); | 2372 | unregister_console(bcon); |
2372 | } else { | ||
2373 | printk(KERN_INFO "%sconsole [%s%d] enabled\n", | ||
2374 | (newcon->flags & CON_BOOT) ? "boot" : "" , | ||
2375 | newcon->name, newcon->index); | ||
2376 | } | 2373 | } |
2377 | } | 2374 | } |
2378 | EXPORT_SYMBOL(register_console); | 2375 | EXPORT_SYMBOL(register_console); |
@@ -2382,6 +2379,10 @@ int unregister_console(struct console *console) | |||
2382 | struct console *a, *b; | 2379 | struct console *a, *b; |
2383 | int res; | 2380 | int res; |
2384 | 2381 | ||
2382 | printk(KERN_INFO "%sconsole [%s%d] disabled\n", | ||
2383 | (console->flags & CON_BOOT) ? "boot" : "" , | ||
2384 | console->name, console->index); | ||
2385 | |||
2385 | res = _braille_unregister_console(console); | 2386 | res = _braille_unregister_console(console); |
2386 | if (res) | 2387 | if (res) |
2387 | return res; | 2388 | return res; |
@@ -2421,8 +2422,6 @@ static int __init printk_late_init(void) | |||
2421 | 2422 | ||
2422 | for_each_console(con) { | 2423 | for_each_console(con) { |
2423 | if (!keep_bootcon && con->flags & CON_BOOT) { | 2424 | if (!keep_bootcon && con->flags & CON_BOOT) { |
2424 | printk(KERN_INFO "turn off boot console %s%d\n", | ||
2425 | con->name, con->index); | ||
2426 | unregister_console(con); | 2425 | unregister_console(con); |
2427 | } | 2426 | } |
2428 | } | 2427 | } |