summaryrefslogtreecommitdiffstats
path: root/tools/bootconfig/samples
AgeCommit message (Collapse)AuthorLines
2026-02-05bootconfig: Check the parsed output of the good examplesMasami Hiramatsu (Google)-0/+41
Check whether the parsed output of the good example configs are the same as expected. Link: https://lore.kernel.org/all/177025239529.14982.12913754615993262263.stgit@devnote2/ Signed-off-by: Masami Hiramatsu (Google) <mhiramat@kernel.org> Tested-by: Steven Rostedt (Google) <rostedt@goodmis.org>
2026-02-05bootconfig: Terminate value search if it hits a newlineMasami Hiramatsu (Google)-2/+9
Terminate the value search for a key if it hits a newline and make the value empty. When we pass a bootconfig with an empty value terminated by the newline, like below:: foo = bar = value Current bootconfig interprets it as a single entry:: foo = "bar = value"; The Documentation/admin-guide/bootconfig.rst defines the value itself is terminated by newline: The value has to be terminated by semi-colon (``;``) or newline (``\n``). but it does not define when the value search is terminated. This changes the behavior to be more line-oriented, so that it is clearer in how it works. - The value search of key-value pair will be terminated by a comment or newline. - The value search of an array will continue beyond comments and newlines. Thus, with this update, the above example is interpreted as:: foo = ""; bar = "value"; And the below example will cause a syntax error because "bar" is expected as a key but it has ','. foo = bar, buz According to this change, one wrong example config is updated. Link: https://lore.kernel.org/all/177025238503.14982.17059549076175612447.stgit@devnote2/ Signed-off-by: Masami Hiramatsu (Google) <mhiramat@kernel.org> Reviewed-by: Julius Werner <jwerner@chromium.org>
2021-06-10tools/bootconfig: Support mixed value and subkey test casesMasami Hiramatsu-6/+14
Update test case to support mixed value and subkey on a key. Link: https://lkml.kernel.org/r/162262195568.264090.12431204030021242896.stgit@devnote2 Signed-off-by: Masami Hiramatsu <mhiramat@kernel.org> Signed-off-by: Steven Rostedt (VMware) <rostedt@goodmis.org>
2020-08-03tools/bootconfig: Add testcases for value override operatorMasami Hiramatsu-0/+12
Add some testcases and examples for value override operator. Link: https://lkml.kernel.org/r/159482883824.126704.2166030493721357163.stgit@devnote2 Signed-off-by: Masami Hiramatsu <mhiramat@kernel.org> Signed-off-by: Steven Rostedt (VMware) <rostedt@goodmis.org>
2020-02-21bootconfig: Prohibit re-defining value on same keyMasami Hiramatsu-0/+6
Currently, bootconfig adds a new value on the existing key to the tail of an array. But this looks a bit confusing because an admin can easily rewrite the original value in the same config file. This rejects the following value re-definition. key = value1 ... key = value2 You should rewrite value1 to value2 in this case. Link: http://lkml.kernel.org/r/158227282199.12842.10110929876059658601.stgit@devnote2 Suggested-by: Steven Rostedt (VMware) <rostedt@goodmis.org> Signed-off-by: Masami Hiramatsu <mhiramat@kernel.org> [ Fixed spelling of arraies to arrays ] Signed-off-by: Steven Rostedt (VMware) <rostedt@goodmis.org>
2020-02-20bootconfig: Reject subkey and value on same parent keyMasami Hiramatsu-0/+6
Reject if a value node is mixed with subkey node on same parent key node. A value node can not co-exist with subkey node under some key node, e.g. key = value key.subkey = another-value This is not be allowed because bootconfig API is not designed to handle such case. Link: http://lkml.kernel.org/r/158220115232.26565.7792340045009731803.stgit@devnote2 Signed-off-by: Masami Hiramatsu <mhiramat@kernel.org> Signed-off-by: Steven Rostedt (VMware) <rostedt@goodmis.org>
2020-01-13tools: bootconfig: Add bootconfig test scriptMasami Hiramatsu-0/+68
Add a bootconfig test script to ensure the tool and boot config parser are working correctly. Link: http://lkml.kernel.org/r/157867224728.17873.18114241801246589416.stgit@devnote2 Signed-off-by: Masami Hiramatsu <mhiramat@kernel.org> Signed-off-by: Steven Rostedt (VMware) <rostedt@goodmis.org>