mirror of
https://github.com/torvalds/linux
synced 2024-09-29 07:50:45 +00:00
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>
This commit is contained in:
parent
8f6b2ae49a
commit
6b80239447
|
@ -2358,21 +2358,18 @@ void register_console(struct console *newcon)
|
||||||
* users know there might be something in the kernel's log buffer that
|
* users know there might be something in the kernel's log buffer that
|
||||||
* went to the bootconsole (that they do not see on the real console)
|
* went to the bootconsole (that they do not see on the real console)
|
||||||
*/
|
*/
|
||||||
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)
|
|
||||||
*/
|
|
||||||
printk(KERN_INFO "console [%s%d] enabled, bootconsole disabled\n",
|
|
||||||
newcon->name, newcon->index);
|
|
||||||
for_each_console(bcon)
|
|
||||||
if (bcon->flags & CON_BOOT)
|
|
||||||
unregister_console(bcon);
|
|
||||||
} else {
|
|
||||||
printk(KERN_INFO "%sconsole [%s%d] enabled\n",
|
printk(KERN_INFO "%sconsole [%s%d] enabled\n",
|
||||||
(newcon->flags & CON_BOOT) ? "boot" : "" ,
|
(newcon->flags & CON_BOOT) ? "boot" : "" ,
|
||||||
newcon->name, newcon->index);
|
newcon->name, newcon->index);
|
||||||
|
if (bcon &&
|
||||||
|
((newcon->flags & (CON_CONSDEV | CON_BOOT)) == CON_CONSDEV) &&
|
||||||
|
!keep_bootcon) {
|
||||||
|
/* We need to iterate through all boot consoles, to make
|
||||||
|
* sure we print everything out, before we unregister them.
|
||||||
|
*/
|
||||||
|
for_each_console(bcon)
|
||||||
|
if (bcon->flags & CON_BOOT)
|
||||||
|
unregister_console(bcon);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
EXPORT_SYMBOL(register_console);
|
EXPORT_SYMBOL(register_console);
|
||||||
|
@ -2382,6 +2379,10 @@ int unregister_console(struct console *console)
|
||||||
struct console *a, *b;
|
struct console *a, *b;
|
||||||
int res;
|
int res;
|
||||||
|
|
||||||
|
printk(KERN_INFO "%sconsole [%s%d] disabled\n",
|
||||||
|
(console->flags & CON_BOOT) ? "boot" : "" ,
|
||||||
|
console->name, console->index);
|
||||||
|
|
||||||
res = _braille_unregister_console(console);
|
res = _braille_unregister_console(console);
|
||||||
if (res)
|
if (res)
|
||||||
return res;
|
return res;
|
||||||
|
@ -2421,8 +2422,6 @@ static int __init printk_late_init(void)
|
||||||
|
|
||||||
for_each_console(con) {
|
for_each_console(con) {
|
||||||
if (!keep_bootcon && con->flags & CON_BOOT) {
|
if (!keep_bootcon && con->flags & CON_BOOT) {
|
||||||
printk(KERN_INFO "turn off boot console %s%d\n",
|
|
||||||
con->name, con->index);
|
|
||||||
unregister_console(con);
|
unregister_console(con);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue