]> git.ipfire.org Git - thirdparty/linux.git/commit
tools/bootconfig: render kernel.* subtree as cmdline string with -C
authorBreno Leitao <leitao@debian.org>
Fri, 8 May 2026 13:55:04 +0000 (06:55 -0700)
committerMasami Hiramatsu (Google) <mhiramat@kernel.org>
Tue, 12 May 2026 00:44:40 +0000 (09:44 +0900)
commit4135542de6c42bc366a651d0b2d82ea72ac199fc
tree755a3e358cf10f791cbb25a1409b61620bf59765
parent5a643e4623238e14b03d75ca0d4eda0645720cee
tools/bootconfig: render kernel.* subtree as cmdline string with -C

Add a -C option that finds the "kernel" subtree of a bootconfig file
and prints it as a flat, space-separated cmdline string by calling the
shared xbc_snprint_cmdline() renderer. An empty or absent kernel.*
subtree produces empty output and exits successfully.

This lets the kernel build embed a bootconfig file as a plain cmdline
string at build time, so embedded bootconfig values can reach
parse_early_param() during architecture setup without parsing the
bootconfig at runtime.

The renderer is intentionally limited to the kernel.* subtree: that is
the only thing the kernel build needs to embed; init.* and other
subtrees keep going through the runtime parser.

Example of this new mode:
# cat /tmp/test.bconf
kernel {
foo = bar
baz = "hello world"
arr = 1, 2
}
init.foo = nope

# ./tools/bootconfig/bootconfig -C /tmp/test.bconf
foo=bar baz="hello world" arr=1 arr=2 %

Link: https://lore.kernel.org/all/20260508-bootconfig_using_tools-v1-2-1132219aa773@debian.org/
Signed-off-by: Breno Leitao <leitao@debian.org>
Signed-off-by: Masami Hiramatsu (Google) <mhiramat@kernel.org>
tools/bootconfig/main.c