From: Ahmad Fatoum <a.fatoum@pengutronix.de>
To: barebox@lists.infradead.org
Cc: Ahmad Fatoum <a.fatoum@pengutronix.de>
Subject: [PATCH v3 00/12] efi: payload: allow passing arguments to UKIs
Date: Mon, 26 Oct 2026 13:09:51 +0100 [thread overview]
Message-ID: <20261026121150.455510-1-a.fatoum@pengutronix.de> (raw)
UKIs look like a kernel image, but barebox doesn't detect them as one,
which has barebox treat them as it would treat e.g. an EFI shell: An
executable it can start, but can't pass arguments to and that it assumes
will return to it when it exits.
This doesn't hold of course as a UKI should never return execution to
barebox.
Additionally, to select a UKI profile, barebox will need to add an @N
(where N identifies the profile by number) as the very first load
option.
This is also enabled by this series.
v2 -> v3:
- New patch "efi: treat EFI zboot Linux images like other EFI-stubbed
kernels". CONFIG_EFI_ZBOOT kernels were detected as plain EFI
applications, so bootm passed them no bootargs, initrd or device tree
- "common: bootargs: drop legacy bootargs fallback with FLEXIBLE_BOOTARGS":
pass global.linux.mtdparts.* and global.linux.blkdevparts.* even if no
global.linux.bootargs.* variable has a value. With "globalvar: skip
empty variables in globalvar_get_match()", they would otherwise be
dropped after every boot entry. Mention this in the migration note
- "efi: payload: always shutdown barebox when booting": add a migration
note, as EFI applications booted via bootm no longer return to barebox
- "efi: payload: pass shell arguments as load options to executed images":
print the "Booting ... with options" message for all images, not only
for EFI-stubbed kernels, and reword the comment on clearing the load
options of a still loaded driver (Marco)
- "efi: add global.efi.bootargs for bootm'd EFI applications": simplify
efi_bootargs_get() with strjoin() and isempty() (Marco), and compute
the load options only after the dryrun check
- "Documentation: efi: describe load options handling": note that UKIs
executed directly from the shell are started like any other EFI
application, so barebox doesn't shut down before they take over
- New patch "boot: report exit status of failing boot scripts"
- Rebase onto current master. The migration notes are now separate files
under Documentation/migration-guides/migration-master/
- Link to v2: https://lore.barebox.org/barebox/20261015092308.146516-1-a.fatoum@pengutronix.de/
v1 -> v2:
- New patch "commands: devlookup: honour global.bootm.root_param for -k",
so scripts can build the root option that bootm would append, e.g. for
UKIs (Fabian)
- "common: bootargs: don't leave linux_bootargs dangling after free":
move from 9/9 to the front of the series, as skipping empty variables
in globalvar_get_match() made the double free reachable after any boot
entry
- "efi: payload: honour bootm dryrun in the EFI application handler":
move before "always shutdown barebox when booting", so bootm -d no
longer ends the barebox session at any point in the series; drop the
commit message sentence that only made sense in the old order
- "Documentation: efi: describe load options handling": turn the UKI
note into a paragraph explaining that the Linux bootargs, including
bootm.appendroot's root=, aren't passed, how systemd-stub treats load
options with and without Secure Boot, and how to pass root= via
devlookup -k and global.efi.bootargs.root (Fabian)
- Rebase onto current next
- Link to v1: https://lore.barebox.org/barebox/20260826121956.2936414-1-a.fatoum@pengutronix.de/
Ahmad Fatoum (12):
efi: treat EFI zboot Linux images like other EFI-stubbed kernels
commands: devlookup: honour global.bootm.root_param for -k
common: bootargs: don't leave linux_bootargs dangling after free
common: bootargs: drop legacy bootargs fallback with FLEXIBLE_BOOTARGS
globalvar: skip empty variables in globalvar_get_match()
efi: payload: honour bootm dryrun in the EFI application handler
efi: payload: always shutdown barebox when booting
efi: payload: pass shell arguments as load options to executed images
efi: add global.efi.bootargs for bootm'd EFI applications
Documentation: efi: describe load options handling
test: py: efiloader: check global.efi.bootargs reaches the kernel
boot: report exit status of failing boot scripts
Documentation/boards/efi.rst | 68 +++++++++++++++-
.../efi-payload-bootm-shutdown.rst | 10 +++
.../flexible-bootargs-legacy-fallback.rst | 19 +++++
Documentation/user/booting-linux.rst | 12 ++-
commands/devlookup.c | 5 +-
common/block.c | 5 +-
common/boot.c | 10 ++-
common/bootargs.c | 32 ++++----
common/filetype.c | 5 +-
common/globalvar.c | 6 +-
efi/Makefile | 2 +-
efi/bootargs.c | 62 +++++++++++++++
efi/loader/bootm.c | 34 +++++---
efi/payload/bootm.c | 29 ++++++-
efi/payload/image.c | 79 ++++++++++++++-----
efi/payload/image.h | 3 +-
include/block.h | 6 +-
include/efi/bootargs.h | 9 +++
include/filetype.h | 8 ++
test/py/test_linux_efiloader.py | 6 ++
test/py/test_shell.py | 26 ++++++
21 files changed, 371 insertions(+), 65 deletions(-)
create mode 100644 Documentation/migration-guides/migration-master/efi-payload-bootm-shutdown.rst
create mode 100644 Documentation/migration-guides/migration-master/flexible-bootargs-legacy-fallback.rst
create mode 100644 efi/bootargs.c
create mode 100644 include/efi/bootargs.h
--
2.47.3
next reply other threads:[~2026-10-26 12:16 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-10-26 12:09 Ahmad Fatoum [this message]
2026-10-26 12:09 ` [PATCH v3 01/12] efi: treat EFI zboot Linux images like other EFI-stubbed kernels Ahmad Fatoum
2026-10-26 12:09 ` [PATCH v3 02/12] commands: devlookup: honour global.bootm.root_param for -k Ahmad Fatoum
2026-10-26 12:09 ` [PATCH v3 03/12] common: bootargs: don't leave linux_bootargs dangling after free Ahmad Fatoum
2026-10-26 12:09 ` [PATCH v3 04/12] common: bootargs: drop legacy bootargs fallback with FLEXIBLE_BOOTARGS Ahmad Fatoum
2026-10-26 12:09 ` [PATCH v3 05/12] globalvar: skip empty variables in globalvar_get_match() Ahmad Fatoum
2026-10-26 12:09 ` [PATCH v3 06/12] efi: payload: honour bootm dryrun in the EFI application handler Ahmad Fatoum
2026-10-26 12:09 ` [PATCH v3 07/12] efi: payload: always shutdown barebox when booting Ahmad Fatoum
2026-10-26 12:09 ` [PATCH v3 08/12] efi: payload: pass shell arguments as load options to executed images Ahmad Fatoum
2026-10-26 12:10 ` [PATCH v3 09/12] efi: add global.efi.bootargs for bootm'd EFI applications Ahmad Fatoum
2026-10-26 12:10 ` [PATCH v3 10/12] Documentation: efi: describe load options handling Ahmad Fatoum
2026-10-26 12:10 ` [PATCH v3 11/12] test: py: efiloader: check global.efi.bootargs reaches the kernel Ahmad Fatoum
2026-10-26 12:10 ` [PATCH v3 12/12] boot: report exit status of failing boot scripts Ahmad Fatoum
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=20261026121150.455510-1-a.fatoum@pengutronix.de \
--to=a.fatoum@pengutronix.de \
--cc=barebox@lists.infradead.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