Re: [PATCH 3/3] efi/libstub: consider CONFIG_CMDLINE for initrd= and dtb= options

From: Jonathan Marek
Date: Sat Oct 12 2024 - 08:04:27 EST




On 10/12/24 3:54 AM, Ard Biesheuvel wrote:
On Sat, 12 Oct 2024 at 00:52, Jonathan Marek <jonathan@xxxxxxxx> wrote:

Replace cmdline with CONFIG_CMDLINE when it should be used instead of
load_options.

In the EXTEND case, it may be necessary to combine both CONFIG_CMDLINE and
load_options. In that case, keep the old behavior and print a warning about
the incorrect behavior.


The core kernel has its own handling for EXTEND/FORCE, so while we
should parse it in the EFI stub to look for options that affect the
stub's own behavior, we should not copy it into the command line that
the stub provides to the core kernel.

E.g., drivers/of/fdt.c takes the bootargs from the DT and combines
them with CONFIG_CMDLINE.



I'm aware of that - the replacement the commit message is referring to is specifically for handle_cmdline_files() which this commit is modifying.

Currently efistub completely ignores initrd= and dtb= options provided through CONFIG_CMDLINE (handle_cmdline_files() only parses the EFI options)

For the EXTEND case, I didn't implement the full solution because its more complex and EXTEND is not available on arm64 anyway, so I went with just printing a warning instead.