Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 158139
b: refs/heads/master
c: 8259cf4
h: refs/heads/master
i:
  158137: 9eef190
  158135: c2cb47a
v: v3
  • Loading branch information
Robin Getz authored and Ingo Molnar committed Jul 10, 2009
1 parent f60d4f1 commit 1ea7d5e
Show file tree
Hide file tree
Showing 2 changed files with 30 additions and 16 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 4d09161196c9a836eacea4b36e2f217bc34894cf
refs/heads/master: 8259cf4342029aad37660e524178c8858f48b0ab
44 changes: 29 additions & 15 deletions trunk/kernel/printk.c
Original file line number Diff line number Diff line change
Expand Up @@ -1240,22 +1240,14 @@ void register_console(struct console *newcon)
if (!(newcon->flags & CON_ENABLED))
return;

if (bcon && ((newcon->flags & (CON_CONSDEV | CON_BOOT)) == CON_CONSDEV)) {
/* we need to iterate through twice, to make sure we print
* everything out, before we unregister the console(s)
*/
printk(KERN_INFO "console handover:");
for_each_console(bcon)
printk("boot [%s%d] ", bcon->name, bcon->index);
printk(" -> real [%s%d]\n", newcon->name, newcon->index);
for_each_console(bcon)
unregister_console(bcon);
/*
* If we have a bootconsole, and are switching to a real console,
* don't print everything out again, since when the boot console, and
* the real console are the same physical device, it's annoying to
* see the beginning boot messages twice
*/
if (bcon && ((newcon->flags & (CON_CONSDEV | CON_BOOT)) == CON_CONSDEV))
newcon->flags &= ~CON_PRINTBUFFER;
} else {
printk(KERN_INFO "%sconsole [%s%d] enabled\n",
(newcon->flags & CON_BOOT) ? "boot" : "" ,
newcon->name, newcon->index);
}

/*
* Put this console in the list - keep the
Expand All @@ -1281,6 +1273,28 @@ void register_console(struct console *newcon)
spin_unlock_irqrestore(&logbuf_lock, flags);
}
release_console_sem();

/*
* By unregistering the bootconsoles after we enable the real console
* we get the "console xxx enabled" message on all the consoles -
* boot consoles, real consoles, etc - this is to ensure that end
* 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)
*/
if (bcon && ((newcon->flags & (CON_CONSDEV | CON_BOOT)) == CON_CONSDEV)) {
/* 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",
(newcon->flags & CON_BOOT) ? "boot" : "" ,
newcon->name, newcon->index);
}
}
EXPORT_SYMBOL(register_console);

Expand Down

0 comments on commit 1ea7d5e

Please sign in to comment.