efi_loader: rework bootmgr/bootefi using load_image API
authorAKASHI Takahiro <takahiro.akashi@linaro.org>
Fri, 19 Apr 2019 03:22:35 +0000 (12:22 +0900)
committerHeinrich Schuchardt <xypron.glpk@gmx.de>
Mon, 22 Apr 2019 22:37:28 +0000 (00:37 +0200)
commit6b95b38c41a6a56d48b51b192dac7365ce0a8024
tree9057cccc867d36be55f934a5334f261e6c0f53d1
parent1e15a9cb7f2d616325cd855895b5f1283c1ac911
efi_loader: rework bootmgr/bootefi using load_image API

In the current implementation, bootefi command and EFI boot manager
don't use load_image API, instead, use more primitive and internal
functions. This will introduce duplicated code and potentially
unknown bugs as well as inconsistent behaviours.

With this patch, do_efibootmgr() and do_boot_efi() are completely
overhauled and re-implemented using load_image API.

Signed-off-by: AKASHI Takahiro <takahiro.akashi@linaro.org>
Use efi_root as parent handle for the loaded image.
LoadImage() should be called with BootPolicy = true by the boot manager.
Avoid duplicate free_pool().
Eliminate variable memdp which is not needed after anymore due to
"efi_loader: correctly split device path of loaded image".

Reviewed-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
cmd/bootefi.c
include/efi_loader.h
lib/efi_loader/efi_bootmgr.c
lib/efi_loader/efi_boottime.c