From: "Masami Hiramatsu (Google)" <mhiramat@kernel.org>
To: snambakam@microsoft.com, Steven Rostedt <rostedt@goodmis.org>,
linux-trace-kernel@vger.kernel.org
Cc: linux-kernel@vger.kernel.org, Jonathan Corbet <corbet@lwn.net>,
Shuah Khan <skhan@linuxfoundation.org>,
Randy Dunlap <rdunlap@infradead.org>,
Thomas Gleixner <tglx@kernel.org>, Ingo Molnar <mingo@redhat.com>,
Borislav Petkov <bp@alien8.de>,
Dave Hansen <dave.hansen@linux.intel.com>,
x86@kernel.org, "H. Peter Anvin" <hpa@zytor.com>,
Andrew Morton <akpm@linux-foundation.org>,
Mathieu Desnoyers <mathieu.desnoyers@efficios.com>,
linux-doc@vger.kernel.org, linux-kselftest@vger.kernel.org
Subject: [RFC PATCH 0/5] bootconfig: Support multiple named bootconfigs in initrd
Date: Fri, 27 Nov 2026 14:46:14 +0000 [thread overview]
Message-ID: <20261127144614.61194-1-mhiramat@kernel.org> (raw)
Hi,
This RFC series proposes support for bundling multiple named bootconfig
files in a single initrd image and selecting which subset to load at
boot time via the kernel command line.
This work is based on our discussion at LPC 2026 on supporting multiple
bootconfigs in single-image / signed Unified Kernel Image (UKI) setups.
I would appreciate your feedback on the overall design, on-disk format,
command-line semantics, and user-space CLI before finalizing this
series.
Motivation
----------
Bootconfig currently allows only a single bootconfig block appended to
an initrd. In single-image or signed UKI environments, it is often
useful to ship a default production bootconfig alongside optional
debug, tracing, or scenario-specific overlays in the same initrd image,
and enable or combine them at boot without rebuilding or re-signing the
image.
Proposed Specification (Feedback Welcome)
-----------------------------------------
1. In-band naming ("#BOOTCONFIG-ID: <id>"):
Each named bootconfig carries an optional first-line comment
"#BOOTCONFIG-ID: <id>" (1..31 bytes matching [A-Za-z_][A-Za-z0-9_.-]*),
keeping the existing 20-byte "#BOOTCONFIG" trailer format, size, and
checksum framing unchanged for backward compatibility.
2. Stacked trailers & index 0 as default:
Up to XBC_CONFIG_MAX (32) stacked bootconfig trailers can be attached
to an initrd. Block 0 (the first block immediately after initramfs)
is defined as the default bootconfig rather than the outermost
trailer, so appending optional overlays never alters what bare
"bootconfig" loads and places the default first in stack-order
merging so overlays can override keys via ":=" or "+=". All valid
trailers are always stripped from initrd_end so initramfs unpacking
is unaffected.
3. Command-line selection ("bootconfig=[+][<sel>,...]"):
Each <sel> may be a bootconfig ID, a 0-based index, or empty (index
0, e.g. "bootconfig=,debug"). A leading "+" appends to a prior
selection (or to index 0 if none preceded it). Empty "bootconfig="
clears any prior selection (for example, to override a UKI .cmdline),
unless CONFIG_BOOT_CONFIG_FORCE=y is set, which continues to force
index 0. Note that previously empty "bootconfig=" was equivalent to
bare "bootconfig". CONFIG_CMDLINE_FROM_BOOTCONFIG on x86 is updated
to follow the same selection rule.
4. User-space CLI ("tools/bootconfig -i <id[,...]>"):
Extends tools/bootconfig with "-i" across apply, delete, show, list,
and cmdline rendering, with rollback safety on write failure and
merge-conflict warnings against block 0. Five new QEMU boottime
selftests are included to exercise the selection modes.
Does this specification and command-line/tool interface look reasonable
for your use cases? Any comments or suggestions are very welcome.
Patch Overview
--------------
1. bootconfig: Add multi-config ID helpers and xbc_init_configs() support
2. bootconfig: Support stacked initrd bootconfigs and bootconfig= selection
3. tools/bootconfig: Support multiple named bootconfigs with -i option
4. selftests/ftrace: Add boottime tests for multiple bootconfig selection
5. Documentation: bootconfig: Document multiple bootconfigs and selection
Thank you,
Masami Hiramatsu (Google) (5):
bootconfig: Add multi-config ID helpers and xbc_init_configs() support
bootconfig: Support stacked initrd bootconfigs and bootconfig=
selection
tools/bootconfig: Support multiple named bootconfigs with -i option
selftests/ftrace: Add boottime tests for multiple bootconfig selection
Documentation: bootconfig: Document multiple bootconfigs and selection
Documentation/admin-guide/bootconfig.rst | 82 +-
.../admin-guide/kernel-parameters.txt | 10 +
arch/x86/kernel/setup.c | 7 +-
include/linux/bootconfig.h | 32 +
init/main.c | 261 ++++--
lib/bootconfig.c | 476 +++++++++--
tools/bootconfig/include/linux/bootconfig.h | 4 +
tools/bootconfig/main.c | 779 ++++++++++++++----
tools/bootconfig/test-bootconfig.sh | 116 +++
.../testing/selftests/ftrace/boottime/README | 4 +-
.../bootconfigs/bconf-multi-01-default.bconf | 5 +
.../bconf-multi-01-default.debug.bconf | 5 +
.../bconf-multi-02-select.alt.bconf | 5 +
.../bconf-multi-02-select.base.bconf | 7 +
.../bconf-multi-02-select.dbg.bconf | 7 +
.../bootconfigs/bconf-multi-03-append.bconf | 6 +
.../bconf-multi-03-append.dbg.bconf | 6 +
.../bootconfigs/bconf-multi-04-clear.bconf | 5 +
.../bootconfigs/bconf-multi-05-conflict.bconf | 6 +
.../ftrace/boottime/run_boottime_test.sh | 99 ++-
.../boottime/tests/bconf-multi-01-default.sh | 23 +
.../boottime/tests/bconf-multi-02-select.sh | 53 ++
.../boottime/tests/bconf-multi-03-append.sh | 26 +
.../boottime/tests/bconf-multi-04-clear.sh | 26 +
.../boottime/tests/bconf-multi-05-conflict.sh | 22 +
25 files changed, 1762 insertions(+), 310 deletions(-)
create mode 100644 tools/testing/selftests/ftrace/boottime/bootconfigs/bconf-multi-01-default.bconf
create mode 100644 tools/testing/selftests/ftrace/boottime/bootconfigs/bconf-multi-01-default.debug.bconf
create mode 100644 tools/testing/selftests/ftrace/boottime/bootconfigs/bconf-multi-02-select.alt.bconf
create mode 100644 tools/testing/selftests/ftrace/boottime/bootconfigs/bconf-multi-02-select.base.bconf
create mode 100644 tools/testing/selftests/ftrace/boottime/bootconfigs/bconf-multi-02-select.dbg.bconf
create mode 100644 tools/testing/selftests/ftrace/boottime/bootconfigs/bconf-multi-03-append.bconf
create mode 100644 tools/testing/selftests/ftrace/boottime/bootconfigs/bconf-multi-03-append.dbg.bconf
create mode 100644 tools/testing/selftests/ftrace/boottime/bootconfigs/bconf-multi-04-clear.bconf
create mode 100644 tools/testing/selftests/ftrace/boottime/bootconfigs/bconf-multi-05-conflict.bconf
create mode 100755 tools/testing/selftests/ftrace/boottime/tests/bconf-multi-01-default.sh
create mode 100755 tools/testing/selftests/ftrace/boottime/tests/bconf-multi-02-select.sh
create mode 100755 tools/testing/selftests/ftrace/boottime/tests/bconf-multi-03-append.sh
create mode 100755 tools/testing/selftests/ftrace/boottime/tests/bconf-multi-04-clear.sh
create mode 100755 tools/testing/selftests/ftrace/boottime/tests/bconf-multi-05-conflict.sh
base-commit: 56bb11fe6aacc7666938e8e6765b44aa0cf1fcdd
--
Masami Hiramatsu (Google) <mhiramat@kernel.org>
next reply other threads:[~2026-11-27 14:50 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-11-27 14:46 Masami Hiramatsu (Google) [this message]
2026-11-27 14:46 ` [RFC PATCH 1/5] bootconfig: Add multi-config ID helpers and xbc_init_configs() support Masami Hiramatsu (Google)
2026-11-27 14:46 ` [RFC PATCH 2/5] bootconfig: Support stacked initrd bootconfigs and bootconfig= selection Masami Hiramatsu (Google)
2026-11-27 14:46 ` [RFC PATCH 3/5] tools/bootconfig: Support multiple named bootconfigs with -i option Masami Hiramatsu (Google)
2026-11-27 14:46 ` [RFC PATCH 4/5] selftests/ftrace: Add boottime tests for multiple bootconfig selection Masami Hiramatsu (Google)
2026-11-27 14:46 ` [RFC PATCH 5/5] Documentation: bootconfig: Document multiple bootconfigs and selection Masami Hiramatsu (Google)
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20261127144614.61194-1-mhiramat@kernel.org \
--to=mhiramat@kernel.org \
--cc=akpm@linux-foundation.org \
--cc=bp@alien8.de \
--cc=corbet@lwn.net \
--cc=dave.hansen@linux.intel.com \
--cc=hpa@zytor.com \
--cc=linux-doc@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-kselftest@vger.kernel.org \
--cc=linux-trace-kernel@vger.kernel.org \
--cc=mathieu.desnoyers@efficios.com \
--cc=mingo@redhat.com \
--cc=rdunlap@infradead.org \
--cc=rostedt@goodmis.org \
--cc=skhan@linuxfoundation.org \
--cc=snambakam@microsoft.com \
--cc=tglx@kernel.org \
--cc=x86@kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox