* [PATCH v2 0/2] bootconfig: Add EBNF definition and more tests
@ 2026-03-14 10:10 Masami Hiramatsu (Google)
2026-03-14 10:10 ` [PATCH v2 1/2] Documentation: bootconfig: Add EBNF definiton of bootconfig Masami Hiramatsu (Google)
2026-03-14 10:10 ` [PATCH v2 2/2] bootconfig: Add more test samples Masami Hiramatsu (Google)
0 siblings, 2 replies; 3+ messages in thread
From: Masami Hiramatsu (Google) @ 2026-03-14 10:10 UTC (permalink / raw)
To: Masami Hiramatsu, Steven Rostedt; +Cc: linux-kernel, linux-trace-kernel
Hi,
Here is the 2nd version of the series to add the EBNF definition and
more parser test cases of bootconfig to formally define the bootconfig
syntax. In this version, I made EBNF part as an independent section
so that someone can refer it easiler.
Previous version is here;
https://lore.kernel.org/all/177347919093.458550.1919253264724868769.stgit@devnote2/
Thanks,
---
Masami Hiramatsu (Google) (2):
Documentation: bootconfig: Add EBNF definiton of bootconfig
bootconfig: Add more test samples
Documentation/admin-guide/bootconfig.rst | 17 +++++++++++++++++
.../samples/bad-array-comment-delimiter.bconf | 2 ++
tools/bootconfig/samples/bad-dot-middle.bconf | 1 +
.../bootconfig/samples/bad-invalid-operator.bconf | 1 +
tools/bootconfig/samples/bad-key-dot-end.bconf | 1 +
tools/bootconfig/samples/bad-unclosed-quote.bconf | 1 +
.../samples/bad-unexpected-close-brace.bconf | 4 ++++
.../samples/exp-good-dot-with-block.bconf | 1 +
.../bootconfig/samples/exp-good-empty-block.bconf | 1 +
.../samples/exp-good-empty-value-sep.bconf | 3 +++
.../samples/exp-good-quoted-newline.bconf | 2 ++
tools/bootconfig/samples/good-dot-with-block.bconf | 3 +++
tools/bootconfig/samples/good-empty-block.bconf | 1 +
.../bootconfig/samples/good-empty-value-sep.bconf | 3 +++
tools/bootconfig/samples/good-quoted-newline.bconf | 2 ++
15 files changed, 43 insertions(+)
create mode 100644 tools/bootconfig/samples/bad-array-comment-delimiter.bconf
create mode 100644 tools/bootconfig/samples/bad-dot-middle.bconf
create mode 100644 tools/bootconfig/samples/bad-invalid-operator.bconf
create mode 100644 tools/bootconfig/samples/bad-key-dot-end.bconf
create mode 100644 tools/bootconfig/samples/bad-unclosed-quote.bconf
create mode 100644 tools/bootconfig/samples/bad-unexpected-close-brace.bconf
create mode 100644 tools/bootconfig/samples/exp-good-dot-with-block.bconf
create mode 100644 tools/bootconfig/samples/exp-good-empty-block.bconf
create mode 100644 tools/bootconfig/samples/exp-good-empty-value-sep.bconf
create mode 100644 tools/bootconfig/samples/exp-good-quoted-newline.bconf
create mode 100644 tools/bootconfig/samples/good-dot-with-block.bconf
create mode 100644 tools/bootconfig/samples/good-empty-block.bconf
create mode 100644 tools/bootconfig/samples/good-empty-value-sep.bconf
create mode 100644 tools/bootconfig/samples/good-quoted-newline.bconf
--
Masami Hiramatsu (Google) <mhiramat@kernel.org>
^ permalink raw reply [flat|nested] 3+ messages in thread
* [PATCH v2 1/2] Documentation: bootconfig: Add EBNF definiton of bootconfig
2026-03-14 10:10 [PATCH v2 0/2] bootconfig: Add EBNF definition and more tests Masami Hiramatsu (Google)
@ 2026-03-14 10:10 ` Masami Hiramatsu (Google)
2026-03-14 10:10 ` [PATCH v2 2/2] bootconfig: Add more test samples Masami Hiramatsu (Google)
1 sibling, 0 replies; 3+ messages in thread
From: Masami Hiramatsu (Google) @ 2026-03-14 10:10 UTC (permalink / raw)
To: Masami Hiramatsu, Steven Rostedt; +Cc: linux-kernel, linux-trace-kernel
From: Masami Hiramatsu (Google) <mhiramat@kernel.org>
Add the EBNF definition to Documentation/admin-guide/bootconfig.rst
as an additional section to formally define the bootconfig syntax.
Signed-off-by: Masami Hiramatsu (Google) <mhiramat@kernel.org>
---
Changes in v2:
- Move EBNF as a separated section.
---
Documentation/admin-guide/bootconfig.rst | 17 +++++++++++++++++
1 file changed, 17 insertions(+)
diff --git a/Documentation/admin-guide/bootconfig.rst b/Documentation/admin-guide/bootconfig.rst
index f712758472d5..41bd1ee92395 100644
--- a/Documentation/admin-guide/bootconfig.rst
+++ b/Documentation/admin-guide/bootconfig.rst
@@ -152,6 +152,23 @@ Note that you can NOT put a comment or a newline between value and delimiter
key = 1 # comment
,2
+EBNF definition
+===============
+
+The syntax is defined in EBNF as follows::
+
+ Config = { Statement }
+ Statement = [ Key [ Assignment | Block ] | Comment ] ( "\n" | ";" )
+ Assignment = ( "=" | "+=" | ":=" ) ValueList
+ ValueList = [ Value { "," [ { ( Comment | "\n" ) } ] Value } ]
+ Block = "{" { Statement } "}"
+ Key = Word { "." Word }
+ Word = [a-zA-Z0-9_-]+
+ Value = QuotedValue | UnquotedValue
+ QuotedValue = "\"" { any_character_except_double_quote } "\""
+ | "'" { any_character_except_single_quote } "'"
+ UnquotedValue = { any_printable_character_except_delimiters }
+ Comment = "#" { any_character_except_newline }
/proc/bootconfig
================
^ permalink raw reply related [flat|nested] 3+ messages in thread
* [PATCH v2 2/2] bootconfig: Add more test samples
2026-03-14 10:10 [PATCH v2 0/2] bootconfig: Add EBNF definition and more tests Masami Hiramatsu (Google)
2026-03-14 10:10 ` [PATCH v2 1/2] Documentation: bootconfig: Add EBNF definiton of bootconfig Masami Hiramatsu (Google)
@ 2026-03-14 10:10 ` Masami Hiramatsu (Google)
1 sibling, 0 replies; 3+ messages in thread
From: Masami Hiramatsu (Google) @ 2026-03-14 10:10 UTC (permalink / raw)
To: Masami Hiramatsu, Steven Rostedt; +Cc: linux-kernel, linux-trace-kernel
From: Masami Hiramatsu (Google) <mhiramat@kernel.org>
Add more test samples for edge cases (empty block, quoted newline,
various error cases) to tools/bootconfig/samples/.
Signed-off-by: Masami Hiramatsu (Google) <mhiramat@kernel.org>
---
Changes in v2:
- Make EBNF as a separated section.
---
| 2 ++
tools/bootconfig/samples/bad-dot-middle.bconf | 1 +
.../bootconfig/samples/bad-invalid-operator.bconf | 1 +
tools/bootconfig/samples/bad-key-dot-end.bconf | 1 +
tools/bootconfig/samples/bad-unclosed-quote.bconf | 1 +
.../samples/bad-unexpected-close-brace.bconf | 4 ++++
.../samples/exp-good-dot-with-block.bconf | 1 +
.../bootconfig/samples/exp-good-empty-block.bconf | 1 +
.../samples/exp-good-empty-value-sep.bconf | 3 +++
.../samples/exp-good-quoted-newline.bconf | 2 ++
tools/bootconfig/samples/good-dot-with-block.bconf | 3 +++
tools/bootconfig/samples/good-empty-block.bconf | 1 +
.../bootconfig/samples/good-empty-value-sep.bconf | 3 +++
tools/bootconfig/samples/good-quoted-newline.bconf | 2 ++
14 files changed, 26 insertions(+)
create mode 100644 tools/bootconfig/samples/bad-array-comment-delimiter.bconf
create mode 100644 tools/bootconfig/samples/bad-dot-middle.bconf
create mode 100644 tools/bootconfig/samples/bad-invalid-operator.bconf
create mode 100644 tools/bootconfig/samples/bad-key-dot-end.bconf
create mode 100644 tools/bootconfig/samples/bad-unclosed-quote.bconf
create mode 100644 tools/bootconfig/samples/bad-unexpected-close-brace.bconf
create mode 100644 tools/bootconfig/samples/exp-good-dot-with-block.bconf
create mode 100644 tools/bootconfig/samples/exp-good-empty-block.bconf
create mode 100644 tools/bootconfig/samples/exp-good-empty-value-sep.bconf
create mode 100644 tools/bootconfig/samples/exp-good-quoted-newline.bconf
create mode 100644 tools/bootconfig/samples/good-dot-with-block.bconf
create mode 100644 tools/bootconfig/samples/good-empty-block.bconf
create mode 100644 tools/bootconfig/samples/good-empty-value-sep.bconf
create mode 100644 tools/bootconfig/samples/good-quoted-newline.bconf
--git a/tools/bootconfig/samples/bad-array-comment-delimiter.bconf b/tools/bootconfig/samples/bad-array-comment-delimiter.bconf
new file mode 100644
index 000000000000..5300cef82aa3
--- /dev/null
+++ b/tools/bootconfig/samples/bad-array-comment-delimiter.bconf
@@ -0,0 +1,2 @@
+key = 1 # comment
+ , 2 # Error: comment between value and its comma delimiter
diff --git a/tools/bootconfig/samples/bad-dot-middle.bconf b/tools/bootconfig/samples/bad-dot-middle.bconf
new file mode 100644
index 000000000000..b3bd19e3c991
--- /dev/null
+++ b/tools/bootconfig/samples/bad-dot-middle.bconf
@@ -0,0 +1 @@
+key..word = value # Double dots are not allowed
diff --git a/tools/bootconfig/samples/bad-invalid-operator.bconf b/tools/bootconfig/samples/bad-invalid-operator.bconf
new file mode 100644
index 000000000000..ca19895bee8a
--- /dev/null
+++ b/tools/bootconfig/samples/bad-invalid-operator.bconf
@@ -0,0 +1 @@
+key ?= value # Unsupported operator
diff --git a/tools/bootconfig/samples/bad-key-dot-end.bconf b/tools/bootconfig/samples/bad-key-dot-end.bconf
new file mode 100644
index 000000000000..57ae39d36e95
--- /dev/null
+++ b/tools/bootconfig/samples/bad-key-dot-end.bconf
@@ -0,0 +1 @@
+key. = value # Key cannot end with a dot
diff --git a/tools/bootconfig/samples/bad-unclosed-quote.bconf b/tools/bootconfig/samples/bad-unclosed-quote.bconf
new file mode 100644
index 000000000000..9384e68d17f6
--- /dev/null
+++ b/tools/bootconfig/samples/bad-unclosed-quote.bconf
@@ -0,0 +1 @@
+key = "unclosed quote
diff --git a/tools/bootconfig/samples/bad-unexpected-close-brace.bconf b/tools/bootconfig/samples/bad-unexpected-close-brace.bconf
new file mode 100644
index 000000000000..a372be395200
--- /dev/null
+++ b/tools/bootconfig/samples/bad-unexpected-close-brace.bconf
@@ -0,0 +1,4 @@
+key {
+ subkey = value
+}
+} # Extra closing brace
diff --git a/tools/bootconfig/samples/exp-good-dot-with-block.bconf b/tools/bootconfig/samples/exp-good-dot-with-block.bconf
new file mode 100644
index 000000000000..ff563ceec024
--- /dev/null
+++ b/tools/bootconfig/samples/exp-good-dot-with-block.bconf
@@ -0,0 +1 @@
+key.subkey.subsubkey = "value";
diff --git a/tools/bootconfig/samples/exp-good-empty-block.bconf b/tools/bootconfig/samples/exp-good-empty-block.bconf
new file mode 100644
index 000000000000..fe460e8e675c
--- /dev/null
+++ b/tools/bootconfig/samples/exp-good-empty-block.bconf
@@ -0,0 +1 @@
+key;
diff --git a/tools/bootconfig/samples/exp-good-empty-value-sep.bconf b/tools/bootconfig/samples/exp-good-empty-value-sep.bconf
new file mode 100644
index 000000000000..266851aae8f2
--- /dev/null
+++ b/tools/bootconfig/samples/exp-good-empty-value-sep.bconf
@@ -0,0 +1,3 @@
+key1 = "";
+key2 = "";
+key3 = "";
diff --git a/tools/bootconfig/samples/exp-good-quoted-newline.bconf b/tools/bootconfig/samples/exp-good-quoted-newline.bconf
new file mode 100644
index 000000000000..2b5166541df6
--- /dev/null
+++ b/tools/bootconfig/samples/exp-good-quoted-newline.bconf
@@ -0,0 +1,2 @@
+key = "value
+that spans multiple lines";
diff --git a/tools/bootconfig/samples/good-dot-with-block.bconf b/tools/bootconfig/samples/good-dot-with-block.bconf
new file mode 100644
index 000000000000..3d9bef7daa2f
--- /dev/null
+++ b/tools/bootconfig/samples/good-dot-with-block.bconf
@@ -0,0 +1,3 @@
+key.subkey {
+ subsubkey = value
+} # Combination of dot-notation and block syntax
diff --git a/tools/bootconfig/samples/good-empty-block.bconf b/tools/bootconfig/samples/good-empty-block.bconf
new file mode 100644
index 000000000000..8c390f37b177
--- /dev/null
+++ b/tools/bootconfig/samples/good-empty-block.bconf
@@ -0,0 +1 @@
+key { } # Empty block should be allowed and ignored
diff --git a/tools/bootconfig/samples/good-empty-value-sep.bconf b/tools/bootconfig/samples/good-empty-value-sep.bconf
new file mode 100644
index 000000000000..fbfb9a17ff99
--- /dev/null
+++ b/tools/bootconfig/samples/good-empty-value-sep.bconf
@@ -0,0 +1,3 @@
+key1 = ;
+key2 =
+key3 = # comment
diff --git a/tools/bootconfig/samples/good-quoted-newline.bconf b/tools/bootconfig/samples/good-quoted-newline.bconf
new file mode 100644
index 000000000000..8c9cd088579a
--- /dev/null
+++ b/tools/bootconfig/samples/good-quoted-newline.bconf
@@ -0,0 +1,2 @@
+key = "value
+that spans multiple lines" # Quoted values can contain newlines
^ permalink raw reply related [flat|nested] 3+ messages in thread
end of thread, other threads:[~2026-03-14 10:11 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-03-14 10:10 [PATCH v2 0/2] bootconfig: Add EBNF definition and more tests Masami Hiramatsu (Google)
2026-03-14 10:10 ` [PATCH v2 1/2] Documentation: bootconfig: Add EBNF definiton of bootconfig Masami Hiramatsu (Google)
2026-03-14 10:10 ` [PATCH v2 2/2] bootconfig: Add more test samples Masami Hiramatsu (Google)
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox