lkml.org 
[lkml]   [2007]   [Aug]   [20]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: Early printk behaviour
Robin Getz wrote:

>> Hmm, yes, should be doable in generic code. Check whenever the current
>> console has CON_BOOT set and if so unregister it.
>
> Something like:
>
> +++ kernel/printk.c (working copy)
> +int __init disable_boot_consoles(void)
> +{
> + struct console *con;
> +
> + for (con = console_drivers; con; con = con->next) {
> + if (con->flags & CON_BOOT) {
> + printk(KERN_INFO "Unregister BootConsole %s%d\n",
> + con->name, con->index);
> + unregister_console(con);
> + }
> + }
> + return 0;
> +}
> +late_initcall(disable_boot_consoles);

Yep, that should work. You can drop the loop though. You can't
register a boot console if another console exists, and the first
non-boot console replaces the boot console, thus you never ever have
more than one console in case the boot console is still active.

The printk should be all lowercase like the other printk's in the file.

Other than that it loosk fine.

cheers,
Gerd

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/

\
 
 \ /
  Last update: 2007-08-20 10:03    [W:0.112 / U:0.468 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site