From: Masami Hiramatsu <mhiramat@kernel.org>
To: Geert Uytterhoeven <geert@linux-m68k.org>
Cc: Randy Dunlap <rdunlap@infradead.org>,
Masami Hiramatsu <mhiramat@kernel.org>,
Steven Rostedt <rostedt@goodmis.org>,
Borislav Petkov <bp@alien8.de>,
LKML <linux-kernel@vger.kernel.org>,
Ingo Molnar <mingo@kernel.org>,
Andrew Morton <akpm@linux-foundation.org>,
Peter Zijlstra <peterz@infradead.org>
Subject: Re: [PATCH v3 1/2] bootconfig: Prohibit re-defining value on same key
Date: Sat, 22 Feb 2020 23:41:47 +0900 [thread overview]
Message-ID: <20200222234147.7525a2d527ebbf53f06b5734@kernel.org> (raw)
In-Reply-To: <CAMuHMdURcRPXo7Q-2E7bS7X9w73NvYP8ffdJeNk37wdQgVxThw@mail.gmail.com>
On Sat, 22 Feb 2020 10:31:17 +0100
Geert Uytterhoeven <geert@linux-m68k.org> wrote:
> 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.
Right, it actually depends on how the option is defined and its handler.
If the option is defined with module_param*() macros, those will be
overwritten.
But if it is defined with __setup() or early_param(), the handler function
will be called repeatedly. Thus, overwrite or append or skip later one
depends on the option handler.
I think the bootconfig is a bit different from legacy command line at
this moment. The legacy command line can be modified by bootloader,
whereas the bootconfig is a single text file which user can update
each value. Of course bootloader will support the bootconfig to append
some key-values in the future.
So I would like to introduce another "overwrite" operator (":=") and
"assign default" operator ("?=") too. With those operators, the
bootloader can just add their own key-value without decoding the
current bootconfig.
Thank you,
--
Masami Hiramatsu <mhiramat@kernel.org>
next prev parent reply other threads:[~2020-02-22 14:41 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-02-21 8:13 [PATCH v3 0/2] bootconfig: Syntax updates Masami Hiramatsu
2020-02-21 8:13 ` [PATCH v3 1/2] bootconfig: Prohibit re-defining value on same key Masami Hiramatsu
2020-02-22 4:20 ` Randy Dunlap
2020-02-22 9:31 ` Geert Uytterhoeven
2020-02-22 14:41 ` Masami Hiramatsu [this message]
2020-02-22 16:24 ` Randy Dunlap
2020-02-21 8:13 ` [PATCH v3 2/2] bootconfig: Add append value operator support Masami Hiramatsu
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20200222234147.7525a2d527ebbf53f06b5734@kernel.org \
--to=mhiramat@kernel.org \
--cc=akpm@linux-foundation.org \
--cc=bp@alien8.de \
--cc=geert@linux-m68k.org \
--cc=linux-kernel@vger.kernel.org \
--cc=mingo@kernel.org \
--cc=peterz@infradead.org \
--cc=rdunlap@infradead.org \
--cc=rostedt@goodmis.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox