From 24600fd06801a23151dfc309867278212e775f65 Mon Sep 17 00:00:00 2001 From: Adriano Cordova Date: Tue, 29 Apr 2025 09:27:55 -0400 Subject: efi_loader: bootbin: do not load an initrd if none is provided Do not try to create an initrd device path nor try to register an initrd with the EFI_LOAD_FILE2_PROTOCOL if none is provided. Handle initrd installation in efi_binary_run_dp with efi_install_initrd, imitating what is done for the fdt. Fixes: 36835a9105c ("efi_loader: binary_run: register an initrd") Reported-by: Weizhao Ouyang Signed-off-by: Adriano Cordova Tested-by: Weizhao Ouyang Reviewed-by: Ilias Apalodimas Reviewed-by: Heinrich Schuchardt --- include/efi_loader.h | 2 ++ 1 file changed, 2 insertions(+) (limited to 'include') diff --git a/include/efi_loader.h b/include/efi_loader.h index 144b749278a..84e8cfe320e 100644 --- a/include/efi_loader.h +++ b/include/efi_loader.h @@ -597,6 +597,8 @@ efi_status_t efi_env_set_load_options(efi_handle_t handle, const char *env_var, void *efi_get_configuration_table(const efi_guid_t *guid); /* Install device tree */ efi_status_t efi_install_fdt(void *fdt); +/* Install initrd */ +efi_status_t efi_install_initrd(void *initrd, size_t initd_sz); /* Execute loaded UEFI image */ efi_status_t do_bootefi_exec(efi_handle_t handle, void *load_options); /* Run loaded UEFI image with given fdt */ -- cgit v1.2.3