Commit 4135542
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>1 parent 5a643e4 commit 4135542
1 file changed
Lines changed: 52 additions & 8 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
286 | 286 | | |
287 | 287 | | |
288 | 288 | | |
289 | | - | |
| 289 | + | |
| 290 | + | |
| 291 | + | |
| 292 | + | |
| 293 | + | |
| 294 | + | |
| 295 | + | |
| 296 | + | |
| 297 | + | |
| 298 | + | |
| 299 | + | |
| 300 | + | |
| 301 | + | |
| 302 | + | |
| 303 | + | |
| 304 | + | |
| 305 | + | |
| 306 | + | |
| 307 | + | |
| 308 | + | |
| 309 | + | |
| 310 | + | |
| 311 | + | |
| 312 | + | |
| 313 | + | |
| 314 | + | |
| 315 | + | |
| 316 | + | |
| 317 | + | |
| 318 | + | |
| 319 | + | |
| 320 | + | |
| 321 | + | |
| 322 | + | |
| 323 | + | |
290 | 324 | | |
291 | 325 | | |
292 | 326 | | |
| |||
322 | 356 | | |
323 | 357 | | |
324 | 358 | | |
325 | | - | |
| 359 | + | |
| 360 | + | |
| 361 | + | |
326 | 362 | | |
327 | 363 | | |
328 | 364 | | |
329 | | - | |
| 365 | + | |
| 366 | + | |
330 | 367 | | |
331 | 368 | | |
332 | 369 | | |
| |||
486 | 523 | | |
487 | 524 | | |
488 | 525 | | |
489 | | - | |
| 526 | + | |
| 527 | + | |
| 528 | + | |
| 529 | + | |
490 | 530 | | |
491 | 531 | | |
492 | 532 | | |
| |||
495 | 535 | | |
496 | 536 | | |
497 | 537 | | |
| 538 | + | |
498 | 539 | | |
499 | 540 | | |
500 | 541 | | |
501 | | - | |
| 542 | + | |
502 | 543 | | |
503 | 544 | | |
504 | 545 | | |
| |||
509 | 550 | | |
510 | 551 | | |
511 | 552 | | |
| 553 | + | |
| 554 | + | |
| 555 | + | |
512 | 556 | | |
513 | 557 | | |
514 | 558 | | |
515 | 559 | | |
516 | 560 | | |
517 | 561 | | |
518 | | - | |
519 | | - | |
| 562 | + | |
| 563 | + | |
520 | 564 | | |
521 | 565 | | |
522 | 566 | | |
| |||
532 | 576 | | |
533 | 577 | | |
534 | 578 | | |
535 | | - | |
| 579 | + | |
536 | 580 | | |
0 commit comments