[PATCH 0/3] bootconfig: Preserve values and key paths during parsing and output

From
Eduardo Mucelli Rezende Oliveira <hidden>
Date
2026-11-10 18:06:11
Also in
lkml
Hi Masami,

Thanks again for reviewing and picking up the earlier script fixes.
Here are three fixes for the bootconfig parser and command-line tool,
based on bootconfig/for-next.

The first fixes compact output closing a brace too early when a key has
both a value and a subkey. Reading the output back can turn a.z into z.

The second trims unquoted trailing whitespace at EOF, so adding a final
newline does not change the parsed value. The third keeps accepted values
containing both quote types readable when the tool prints them again.

Each fix has regression coverage. I tested them independently and
together on my Ubuntu machine, building the tool with -Werror and
checking the parser results, compact and list output, command-line
rendering, and test initrd images. The full bootconfig test suite passes
after each patch as well as for the complete series.

The three fixes are independent and can be applied separately.
Feedback is welcome.

Thanks,
Eduardo

Eduardo Mucelli Rezende Oliveira (3):
  tools/bootconfig: Close only opened braces in compact output
  bootconfig: Trim unquoted values at end of file
  tools/bootconfig: Preserve values containing both types of quotes

 lib/bootconfig.c                              |  5 ++--
 tools/bootconfig/main.c                       | 29 ++++++++++---------
 .../samples/exp-good-mixed-kv1.bconf          |  5 ++++
 tools/bootconfig/samples/good-mixed-kv1.bconf |  5 ++++
 tools/bootconfig/test-bootconfig.sh           | 29 +++++++++++++++++++
 5 files changed, 57 insertions(+), 16 deletions(-)


base-commit: 677f83795fdfc25ddc51b665a9111f5ff199f7ca
-- 
2.53.0
Thread (17 messages) 17 messages, 3 authors, last reply 11h ago
Keyboard shortcuts
hback out one level
jnext message in thread / next series-diff position
kprevious message in thread / previous series-diff position
ldrill in
Escclose help / fold thread tree
?toggle this help