[U-Boot] [PATCH 0/9] efi_loader: rework bootefi/bootmgr

AKASHI Takahiro takahiro.akashi at linaro.org
Fri Apr 19 03:22:27 UTC 2019


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 #7 are preparatory patches for patch#8.
Patch#8 is a core part of reworking.
Patch#9 is for standalone boot manager.

# Please note that some patches, say patch#2 and #3, can be combined into one
# but I intentionally keep them separated to clarify my intentions of changes.

Issues:
* It would be better off to change the semantics of efi_dp_from_name().
no chance to free loaded_image_info->load_options. (see patch #8)

-Takahiro Akashi

Changes in v1 (Apr 19, 2019)
* Travis CI:
  https://travis-ci.org/t-akashi/u-boot/builds/521984187
* rebased on efi-2019-07
* delete already-merged patches
* rework set_load_options() (patch#1 and #8)
* fix compile/Travis CI errors (patch#2, #7 and #8)
* rename do_boot_efi() to do_bootefi_image() (patch#7)
* free file_path in do_bootefi_image() (patch#8)
* use EFI_PRINT instead of debug() (patch#8)
* remove improper warning messages (patch#8)

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 (9):
  cmd: bootefi: rework set_load_options()
  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_bootefi_image() from do_bootefi()
  efi_loader: rework bootmgr/bootefi using load_image API
  cmd: add efibootmgr command

 cmd/Kconfig                   |   8 +
 cmd/bootefi.c                 | 540 ++++++++++++++++++++++------------
 include/efi_loader.h          |   5 +-
 lib/efi_loader/efi_bootmgr.c  |  43 +--
 lib/efi_loader/efi_boottime.c |   2 +
 5 files changed, 383 insertions(+), 215 deletions(-)

-- 
2.20.1



More information about the U-Boot mailing list