[U-Boot] [RFC 0/8] efi_loader: rework bootefi/bootmgr

AKASHI Takahiro
2019-03-05T05:53:29Z

There are several reasons that I want to rework/refactor bootefi command
as well as bootmgr:
* Some previous commits on bootefi.c have made the code complicated
and a bit hard to understand.

* Contrary to the other part, efi_selftest part of the code is unusal
in terms of loading/execution path in do_bootefi().

* do_bootefi_exec() would better be implemented using load_image() along
with start_image() to be aligned with UEFI interfaces.

* do_bootmgr_load() should also return a size of image loaded.
This information will be needed at load_image(0 and also be used to
verify an image with its signature in "secure boot" in the future.

* When we will support "secure boot" in the future, EFI Boot Manager
is expected to be invoked as a standalone command without any arguments
to mitigate security surfaces.

In this patch set,
Patch#1 is a bug fix.
Patch#2 to #5 are preparatory patches for patch#6.
Patch#7 is for standalone boot manager.

The concern that I'm aware of is:
* load_image() will take an argument of "parent_handle," but obviously
we don't have any parent when invoking an application from command line.
(See FIXME in patch#6.)

-Takahiro Akashi

AKASHI Takahiro (8):
efi_loader: boottime: don't add device path protocol to image handle
efi_loader: boottime: export efi_[un]load_image()
efi_loader: bootmgr: return pointer and size of buffer in loading
cmd: bootefi: move do_bootefi_bootmgr_exec() forward
cmd: bootefi: carve out fdt handling
cmd: bootefi: carve out efi_selftest code from do_bootefi()
cmd: bootefi: rework do_bootefi(), using load_image API
cmd: add efibootmgr command

cmd/Kconfig | 8 +
cmd/bootefi.c | 434 +++++++++++++++++++++++-----------
include/efi_loader.h | 14 +-
lib/efi_loader/efi_bootmgr.c | 41 ++--
lib/efi_loader/efi_boottime.c | 39 ++-
5 files changed, 360 insertions(+), 176 deletions(-)

--
2.20.1