Re: [PATCH v5 1/2] ttynull: Add an option to allow ttynull to be used as a console device
From: Andy Shevchenko
Date: Fri Feb 28 2025 - 14:00:27 EST
On Fri, Feb 28, 2025 at 6:39 AM Adam Simonelli <adamsimonelli@xxxxxxxxx> wrote:
>
> On Wednesday, February 26, 2025 2:22:20 PM EST Andy Shevchenko wrote:
> > On Wed, Feb 26, 2025 at 3:39 PM Adam Simonelli <adamsimonelli@xxxxxxxxx> wrote:
...
> > Just a side note: strstr() is fragile as theoretically "console=" can
> > be part of an argument unrelated to the console, like
> > foo="bar,baz,console=10,key=value". Although I haven't checked if this
> > is allowed by cmdline parser (lib/cmdline.c).
> >
> Dang, good call. As a crude test, console=ttynull= results in a panic, so it
> does look like it allows ='s in parameter values, as it looks like it is
> handling the =...
>
> Gotta find a better way to parse it if I'm to do the `add_preferred_console`
> route, Maybe I can try get_option...
It's rather next_arg() and its derivatives. I dunno if we have a
helper for the "give me an array of this options from the command
line", but it might be somewhere lurking as a static function. If that
is the case, one may make it global and visible to other C-files
inside the kernel.
> What do you think of the placement of it too?
No particular ideas.
--
With Best Regards,
Andy Shevchenko