From: Masami Hiramatsu <mhiramat@kernel.org>
To: Steven Rostedt <rostedt@goodmis.org>
Cc: Alistair Delva <adelva@google.com>,
mhiramat@kernel.org, linux-doc@vger.kernel.org,
LKML <linux-kernel@vger.kernel.org>
Subject: [PATCH 0/3] bootconfig: Add value override operator
Date: Thu, 16 Jul 2020 01:00:21 +0900 [thread overview]
Message-ID: <159482882056.126704.15508672095852220119.stgit@devnote2> (raw)
Hi,
Here is a seires of value-override operator support for bootconfig.
Currently, the bootconfig syntax supports normal assignment operator
("=") and value append operator ("+="), but there is no way to
override (or update) existing value.
This patch adds the value override operator (":=") to update the
existing value with another value. For example,
key.word = value1
key.word := value2, value3
In this case, the 2nd "key.word" config overwrites the 1st one.
Thus this is equal to;
key.word = value2, value3
Note that it is still not allowed to override a subkey with
a value, and a value with a subkey. This means the following
case is not allowed.
key.word = value1
key := value2 # Error!
With this change, if the bootloader wants to change some value
in the default bootconfig, it doesn't need to parse the existing
bootconfig, but it can just append the new configs at the tail
of the bootconfig and update the footer (size, checksum and magic
word).
Thank you,
---
Masami Hiramatsu (3):
lib/bootconfig: Add override operator support
tools/bootconfig: Add testcases for value override operator
Documentation: bootconfig: Add bootconfig override operator
Documentation/admin-guide/bootconfig.rst | 11 +++++++++
lib/bootconfig.c | 33 ++++++++++++++++++--------
tools/bootconfig/samples/bad-override.bconf | 3 ++
tools/bootconfig/samples/bad-override2.bconf | 3 ++
tools/bootconfig/samples/good-override.bconf | 6 +++++
tools/bootconfig/test-bootconfig.sh | 13 ++++++++++
6 files changed, 59 insertions(+), 10 deletions(-)
create mode 100644 tools/bootconfig/samples/bad-override.bconf
create mode 100644 tools/bootconfig/samples/bad-override2.bconf
create mode 100644 tools/bootconfig/samples/good-override.bconf
--
Masami Hiramatsu (Linaro) <mhiramat@kernel.org>
next reply other threads:[~2020-07-15 16:00 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-07-15 16:00 Masami Hiramatsu [this message]
2020-07-15 16:00 ` [PATCH 1/3] lib/bootconfig: Add override operator support Masami Hiramatsu
2020-07-15 16:00 ` [PATCH 2/3] tools/bootconfig: Add testcases for value override operator Masami Hiramatsu
2020-07-15 16:00 ` [PATCH 3/3] Documentation: bootconfig: Add bootconfig " Masami Hiramatsu
2020-07-15 20:45 ` [PATCH 0/3] bootconfig: Add value " Steven Rostedt
2020-07-15 22:38 ` Masami Hiramatsu
2020-07-16 0:02 ` Steven Rostedt
2020-07-16 1:27 ` Masami Hiramatsu
2020-07-30 0:56 ` 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=159482882056.126704.15508672095852220119.stgit@devnote2 \
--to=mhiramat@kernel.org \
--cc=adelva@google.com \
--cc=linux-doc@vger.kernel.org \
--cc=linux-kernel@vger.kernel.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;
as well as URLs for NNTP newsgroup(s).