[PATCH 02/16] efi: payload: populate $global.efi.payload variable
Ahmad Fatoum
a.fatoum at pengutronix.de
Thu Dec 11 12:29:53 PST 2025
As the same barebox binary will be able to function without EFI,
as EFI loader or as EFI payload, it's useful to have a variable
to check this at runtime.
Signed-off-by: Ahmad Fatoum <a.fatoum at pengutronix.de>
---
drivers/efi/efi-device.c | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/drivers/efi/efi-device.c b/drivers/efi/efi-device.c
index 4db3d751a300..78f42a463400 100644
--- a/drivers/efi/efi-device.c
+++ b/drivers/efi/efi-device.c
@@ -13,6 +13,7 @@
#include <string.h>
#include <linux/sizes.h>
#include <wchar.h>
+#include <magicvar.h>
#include <init.h>
#include <efi.h>
#include <efi/efi-payload.h>
@@ -429,6 +430,7 @@ static int efi_init_devices(void)
dev_add_param_bool_fixed(&efi_bus.dev, "secure_boot", secure_boot);
dev_add_param_bool_fixed(&efi_bus.dev, "secure_mode",
secure_boot & setup_mode);
+ dev_add_param_bool_fixed(&efi_bus.dev, "payload", true);
devinfo_add(&efi_bus.dev, efi_businfo);
@@ -440,6 +442,8 @@ static int efi_init_devices(void)
}
core_efi_initcall(efi_init_devices);
+BAREBOX_MAGICVAR(efi.payload, "1 indicates that barebox was loaded as EFI payload");
+
void efi_pause_devices(void)
{
struct device *dev;
--
2.47.3
More information about the barebox
mailing list