From: Ahmad Fatoum <a.fatoum@pengutronix.de>
To: barebox@lists.infradead.org
Cc: fpg@pengutronix.de, Ahmad Fatoum <a.fatoum@pengutronix.de>
Subject: [PATCH RFT 4/9] efi: payload: honour bootm dryrun in the EFI application handler
Date: Wed, 26 Aug 2026 14:17:08 +0200 [thread overview]
Message-ID: <20260826121956.2936414-5-a.fatoum@pengutronix.de> (raw)
In-Reply-To: <20260826121956.2936414-1-a.fatoum@pengutronix.de>
Unlike do_bootm_efi_stub(), the "EFI Application" bootm handler never
looked at data->dryrun and went on to StartImage the application, so
"bootm -d some.efi" ran the image it was only supposed to load. Now
that the handler shuts barebox down and BS->exit()s once the image
returns, a dryrun no longer merely runs an unwanted application, it
also ends the barebox session.
Unload the image and return once it has been loaded and its type
detected, which is as far as the stub handler goes for a dryrun too.
Fixes: 35fb1743f5ac ("efi: payload: bootm: add support for efi stub boot")
Assisted-by: Claude:opus-5
Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de>
---
efi/payload/bootm.c | 5 +++++
1 file changed, 5 insertions(+)
diff --git a/efi/payload/bootm.c b/efi/payload/bootm.c
index 963f6d6ae7d4..2bcfd90e42fa 100644
--- a/efi/payload/bootm.c
+++ b/efi/payload/bootm.c
@@ -220,6 +220,11 @@ static int efi_app_execute(struct image_data *data)
type = file_detect_type(loaded_image->image_base, PAGE_SIZE);
+ if (data->dryrun) {
+ BS->unload_image(handle);
+ return 0;
+ }
+
return efi_execute_image(handle, loaded_image, true, type);
}
--
2.47.3
next prev parent reply other threads:[~2026-08-26 12:21 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-08-26 12:17 [PATCH RFT 0/9] efi: payload: allow passing arguments to UKIs Ahmad Fatoum
2026-08-26 12:17 ` [PATCH RFT 1/9] common: bootargs: drop legacy bootargs fallback with FLEXIBLE_BOOTARGS Ahmad Fatoum
2026-08-26 12:17 ` [PATCH RFT 2/9] globalvar: skip empty variables in globalvar_get_match() Ahmad Fatoum
2026-08-26 12:17 ` [PATCH RFT 3/9] efi: payload: always shutdown barebox when booting Ahmad Fatoum
2026-08-26 12:17 ` Ahmad Fatoum [this message]
2026-08-26 12:17 ` [PATCH RFT 5/9] efi: payload: pass shell arguments as load options to executed images Ahmad Fatoum
2026-08-26 12:17 ` [PATCH RFT 6/9] efi: add global.efi.bootargs for bootm'd EFI applications Ahmad Fatoum
2026-08-26 12:17 ` [PATCH RFT 7/9] Documentation: efi: describe load options handling Ahmad Fatoum
2026-08-26 12:17 ` [PATCH RFT 8/9] test: py: efiloader: check global.efi.bootargs reaches the kernel Ahmad Fatoum
2026-08-26 12:17 ` [PATCH RFT 9/9] common: bootargs: don't leave linux_bootargs dangling after free 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=20260826121956.2936414-5-a.fatoum@pengutronix.de \
--to=a.fatoum@pengutronix.de \
--cc=barebox@lists.infradead.org \
--cc=fpg@pengutronix.de \
/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