Re: [PATCH v3 1/2] bootconfig: Prohibit re-defining value on same key

Geert Uytterhoeven
2020-02-22T09:31:33Z

Hi Randy,

On Sat, Feb 22, 2020 at 5:30 AM Randy Dunlap <rdunlap@infradead.org> wrote:
> On 2/21/20 12:13 AM, Masami Hiramatsu wrote:
> > --- a/Documentation/admin-guide/bootconfig.rst
> > +++ b/Documentation/admin-guide/bootconfig.rst
> > @@ -62,7 +62,16 @@ Or more shorter, written as following::
> > In both styles, same key words are automatically merged when parsing it
> > at boot time. So you can append similar trees or key-values.
> >
> > -Note that a sub-key and a value can not co-exist under a parent key.
> > +Same-key Values
> > +---------------
> > +
> > +It is prohibited that two or more values or arraies share a same-key.
>
> I think (?): arrays
>
> > +For example,::
> > +
> > + foo = bar, baz
> > + foo = qux # !ERROR! we can not re-define same key
> > +
> > +Also, a sub-key and a value can not co-exist under a parent key.
> > For example, following config is NOT allowed.::
> >
> > foo = value1
>
>
> I'm pretty sure that the kernel command line allows someone to use
> key=value1 ... key=value2
> and the first setting is just overwritten with value2 (for most "key"s).
>
> Am I wrong? and is this patch saying that bootconfig won't operate like that?

I think so. Both are retained.
A typical example is "console=ttyS0 console=tty", to have the kernel output
on both the serial and the graphical console.

Gr{oetje,eeting}s,

Geert

--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@linux-m68k.org

In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
-- Linus Torvalds