Re: [PATCH v7 1/7] printk: Save console options for add_preferred_console_match()

From: Tony Lindgren
Date: Tue Jun 04 2024 - 09:18:08 EST


On Fri, May 31, 2024 at 09:54:42AM +0300, Tony Lindgren wrote:
> On Fri, May 24, 2024 at 06:06:21PM +0200, Petr Mladek wrote:
> > A solution might be to store "devname" separately in
> > struct console_cmdline and allow empty "name". We could
> > implement then a function similar to
> > add_preferred_console_match() which would try to match
> > "devname" and set/update "name", "index" value when matched.
>
> This sounds nice, the empty name can be used to defer consoles that
> are not known early. And on console_setup() we only set the devname
> for such cases.

Yup reserving a slot for a devname console at console_setup() time
in console_commandline[] allows keeping the consoles in the right
order again :)

> To me it seems we additionally still need to save the kernel command
> line position of the console too in struct kernel_cmdline so we can
> set the preferred_console for the deferred cases.

Then with the command line consoles in the right order, there's no need
to save the position separately.

And I think then we can also revert commit b73c9cbe4f1f ("printk: Flag
register_console() if console is set on command line"). But I need to
test the fixes some more before sending out.

Regards,

Tony