efi_loader: efi_load_initrd: provide a memory mapped initrd
authorAdriano Cordova <adrianox@gmail.com>
Wed, 19 Mar 2025 14:44:59 +0000 (11:44 -0300)
committerHeinrich Schuchardt <heinrich.schuchardt@canonical.com>
Fri, 11 Apr 2025 11:20:37 +0000 (13:20 +0200)
commit73c9a352705a29e3af6ea08c7075efeb12980f1d
tree3dff6051b8e7bd9f72b31aa56a67890a6aeeae46
parente8660b23f4929fc787e917f3b5f9cd1d09b93e84
efi_loader: efi_load_initrd: provide a memory mapped initrd

U-Boot can pass an initrd to subsequent boot stages via the
EFI_LOAD_FILE2_PROTOCOL. The current implementation only supports
this functionality via the efi boot manager: the initrd is taken
from the load options of the BootCurrent variable. This commit adds
support for registering a memory mapped initrd, e.g. loaded from a
FIT image. For now this new method takes precedence over loading the
initrd from the BootCurrent variable (if both are present) because
the BootCurrent variable is not cleared on exiting the boot manager.

Signed-off-by: Adriano Cordova <adriano.cordova@canonical.com>
Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
include/efi_loader.h
lib/efi_loader/efi_bootmgr.c
lib/efi_loader/efi_load_initrd.c