efi_loader: bootbin: do not load an initrd if none is provided
authorAdriano Cordova <adrianox@gmail.com>
Tue, 29 Apr 2025 13:27:55 +0000 (09:27 -0400)
committerHeinrich Schuchardt <heinrich.schuchardt@canonical.com>
Thu, 1 May 2025 07:19:24 +0000 (09:19 +0200)
commit24600fd06801a23151dfc309867278212e775f65
tree4d3b1b47ad3d146b07a176250d986c2ce9f5fec3
parenta4af308e4acdcf0840226fc4f631e3aa0326699a
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 <o451686892@gmail.com>
Signed-off-by: Adriano Cordova <adriano.cordova@canonical.com>
Tested-by: Weizhao Ouyang <o451686892@gmail.com>
Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
Reviewed-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
include/efi_loader.h
lib/efi_loader/efi_bootbin.c
lib/efi_loader/efi_helper.c