Skip to content

RFC efi_loader: rework bootefi/bootmgr

AKASHI Takahiro u-boot 5 versions – New

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v3 RFC Latest10 patches 0 repliesNew
  2. v2 RFC posting 3/30 of 11 patches 0 repliesSuperseded
  3. v2 RFC posting 2/30 of 11 patches 0 repliesSuperseded
Earlier versions · 2
VersionPostedPatchesRepliesStatus
v2 RFC posting 1/311 patches0 repliesSuperseded
v1 RFC0 of 8 patches0 repliesSuperseded

Changes in v3 from the cover letter

* 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

Patches in v3 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/10efi_loader: device_path: handle special case of loadinglib/efi_loader/efi_device_path.c+8 -01 reply
2/10efi_loader: export root node handleinclude/efi_loader.h lib/efi_loader/efi_root_node.c+9 -61 reply
2/10efi_loader: export root node handle+0 -00 replies
3/10cmd: bootefi: carve out fdt handling from do_bootefi()cmd/bootefi.c+38 -151 reply
3/10cmd: bootefi: carve out fdt handling from do_bootefi()+0 -01 reply
3/10cmd: bootefi: carve out fdt handling from do_bootefi()+0 -00 replies
4/10cmd: bootefi: merge efi_install_fdt() and efi_process_fdt()cmd/bootefi.c+28 -392 replies
5/10cmd: bootefi: carve out efi_selftest code from do_bootefi()cmd/bootefi.c+92 -551 reply
5/10cmd: bootefi: carve out efi_selftest code from do_bootefi()+0 -00 replies
6/10cmd: bootefi: move do_bootefi_bootmgr_exec() forwardcmd/bootefi.c+21 -211 reply
7/10cmd: bootefi: carve out bootmgr code from do_bootefi()cmd/bootefi.c+36 -80 replies
8/10cmd: bootefi: carve out do_boot_efi() from do_bootefi()cmd/bootefi.c+70 -561 reply
8/10cmd: bootefi: carve out do_boot_efi() from do_bootefi()+0 -00 replies
9/10efi_loader: rework bootmgr/bootefi using load_image APIcmd/bootefi.c include/efi_loader.h lib/efi_loader/efi_bootmgr.c +1 more+134 -1133 replies
9/10efi_loader: rework bootmgr/bootefi using load_image API+0 -00 replies
9/10efi_loader: rework bootmgr/bootefi using load_image API+0 -00 replies
10/10cmd: add efibootmgr commandcmd/Kconfig cmd/bootefi.c+43 -01 reply
10/10cmd: add efibootmgr command+0 -00 replies

Reviews trailers per patch

7 of 18 patches have a Reviewed-by or Acked-by.

PatchHeinrich Schuchardt
1/10
2/10
2/10
3/10R-b
3/10R-b
3/10R-b
4/10R-b
5/10
5/10
6/10R-b
7/10
8/10R-b
8/10R-b
9/10
9/10
9/10
10/10
10/10

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.

Read the v3 thread

Cover letter [U-Boot] [RFC v3 00/10] efi_loader: rework bootefi/bootmgr

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(-)
Signature · 1 line
2.20.1