From mboxrd@z Thu Jan 1 00:00:00 1970 From: AKASHI Takahiro Date: Tue, 16 Apr 2019 13:24:18 +0900 Subject: [U-Boot] [RFC v3 00/10] efi_loader: rework bootefi/bootmgr Message-ID: <20190416042428.5007-1-takahiro.akashi@linaro.org> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de 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. * do_bootefi_exec() would better be implemented using load_image() along with start_image() to be aligned with UEFI interfaces. * Contrary to the other part, efi_selftest part of the code is unusual in terms of loading/execution path in do_bootefi(). * 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 to #8 are preparatory patches for patch#9. Patch#9 is a core part of reworking. Patch#10 is for standalone boot manager. # Please note that some patches, say patch#3 and #4, can be combined into one # but I intentionally keep them separated to clarify my intentions of changes. Issues: * The semantics of efi_dp_from_name() should be changed. (See FIXME in patch#9.) -Takahiro Akashi Changes in RFC v3 (Apr 16, 2019) * rebased on v2019.04 * delete already-merged patches * add patch#2 for exporting root node * use correct/more appropriate return code (CMD_RET_xxx) (patch#3,5,7) * remove a message at starting an image in bootefi command, instead adding a debug message in efi_start_image() * use root node as a dummy parent handle when calling efi_start_image() * remove efi_unload_image() in bootefi command Changes in RFC v2 (Mar 27, 2019) * rebased on v2019.04-rc4 * use load_image API in do_bootmgr_load() * merge efi_install_fdt() and efi_process_fdt() * add EFI_LOADED_IMAGE_DEVICE_PATH_PROTOCOL to image (patch#1) * lots of minor changes AKASHI Takahiro (10): efi_loader: device_path: handle special case of loading efi_loader: export root node handle cmd: bootefi: carve out fdt handling from do_bootefi() cmd: bootefi: merge efi_install_fdt() and efi_process_fdt() cmd: bootefi: carve out efi_selftest code from do_bootefi() cmd: bootefi: move do_bootefi_bootmgr_exec() forward cmd: bootefi: carve out bootmgr code from do_bootefi() cmd: bootefi: carve out do_boot_efi() from do_bootefi() efi_loader: rework bootmgr/bootefi using load_image API cmd: add efibootmgr command cmd/Kconfig | 8 + cmd/bootefi.c | 515 ++++++++++++++++++++----------- include/efi_loader.h | 7 +- lib/efi_loader/efi_bootmgr.c | 43 +-- lib/efi_loader/efi_boottime.c | 2 + lib/efi_loader/efi_device_path.c | 8 + lib/efi_loader/efi_root_node.c | 13 +- 7 files changed, 381 insertions(+), 215 deletions(-) -- 2.20.1