From 4bb521a8c4b324902651714915dfe6fd4a5c36af Mon Sep 17 00:00:00 2001 From: Michael Brown Date: Sun, 29 Jan 2023 18:48:08 +0000 Subject: [efi] Accept a command line passed to an iPXE image via LoadOptions Treat a command line passed to iPXE via UEFI LoadOptions as an image to be registered at startup, as is already done for the .lkrn, .pxe, and .exe BIOS images. Originally-implemented-by: Ladi Prosek Signed-off-by: Michael Brown --- src/interface/efi/efi_init.c | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'src/interface/efi/efi_init.c') diff --git a/src/interface/efi/efi_init.c b/src/interface/efi/efi_init.c index 5d98f9ff7..d3c5042d7 100644 --- a/src/interface/efi/efi_init.c +++ b/src/interface/efi/efi_init.c @@ -27,6 +27,7 @@ FILE_LICENCE ( GPL2_OR_LATER ); #include #include #include +#include #include /** Image handle passed to entry point */ @@ -254,6 +255,10 @@ EFI_STATUS efi_init ( EFI_HANDLE image_handle, DBGC ( systab, "EFI image base address %p\n", efi_loaded_image->ImageBase ); + /* Record command line */ + efi_cmdline = efi_loaded_image->LoadOptions; + efi_cmdline_len = efi_loaded_image->LoadOptionsSize; + /* Get loaded image's device handle's device path */ if ( ( efirc = bs->OpenProtocol ( efi_loaded_image->DeviceHandle, &efi_device_path_protocol_guid, -- cgit v1.2.3-55-g7522