On Tue, 23 Jun 2026 09:15:33 -0700 Breno Leitao <[email protected]> wrote:
> Add a section describing CONFIG_CMDLINE_FROM_BOOTCONFIG: what it > does (renders the embedded "kernel" subtree to a flat cmdline at > build time so early_param() handlers see the values), what it > requires (BOOT_CONFIG_EMBED, a non-empty BOOT_CONFIG_EMBED_FILE, > and ARCH_SUPPORTS_CMDLINE_FROM_BOOTCONFIG -- currently x86 only), > the bootconfig opt-in semantics, the initrd-vs-embedded precedence, > and the soft-error overflow behavior. > > Signed-off-by: Breno Leitao <[email protected]> > --- > Documentation/admin-guide/bootconfig.rst | 81 > ++++++++++++++++++++++++++++++++ > 1 file changed, 81 insertions(+) > > diff --git a/Documentation/admin-guide/bootconfig.rst > b/Documentation/admin-guide/bootconfig.rst > index f712758472d5c..349cefbb2bbcd 100644 > --- a/Documentation/admin-guide/bootconfig.rst > +++ b/Documentation/admin-guide/bootconfig.rst > @@ -234,6 +234,87 @@ Kconfig option selected. > Note that even if you set this option, you can override the embedded > bootconfig by another bootconfig which attached to the initrd. > > +Rendering Embedded kernel.* Keys at Build Time > +---------------------------------------------- > + > +By default, the embedded bootconfig (``CONFIG_BOOT_CONFIG_EMBED=y``) is > +parsed at runtime, after ``parse_early_param()`` has already run. Early > +parameter handlers (``mem=``, ``earlycon=``, ``loglevel=``, ...) therefore > +cannot see values supplied via the embedded ``kernel`` subtree. > + > +``CONFIG_CMDLINE_FROM_BOOTCONFIG`` resolves this by rendering the > +``kernel`` subtree of ``CONFIG_BOOT_CONFIG_EMBED_FILE`` into a flat cmdline > +string at kernel build time (via ``tools/bootconfig -C``) and prepending > +it to ``boot_command_line`` during early architecture setup, so the keys > +are visible to ``parse_early_param()``. > + > +The option requires ``CONFIG_BOOT_CONFIG_EMBED=y``, a non-empty > +``CONFIG_BOOT_CONFIG_EMBED_FILE``, and an architecture that selects > +``CONFIG_ARCH_SUPPORTS_CMDLINE_FROM_BOOTCONFIG``. Currently only x86 > +selects it; on other architectures the embedded bootconfig still works, > +but only through the late runtime parser. As commented by Sashiko, here we need to mention that this option requires CONFIG_CMDLINE to be empty. This means user can NOT set both option at once (This also means user doesn't have to worry about configuration conflicts.) Thanks, -- Masami Hiramatsu (Google) <[email protected]>
