[PATCH RFT 4/9] efi: payload: honour bootm dryrun in the EFI application handler
Ahmad Fatoum
a.fatoum at pengutronix.de
Wed Aug 26 05:17:08 PDT 2026
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 at 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
More information about the barebox
mailing list