From mboxrd@z Thu Jan 1 00:00:00 1970 From: Heinrich Schuchardt Date: Thu, 24 Sep 2020 00:17:02 +0200 Subject: [PATCH] distro_bootcmd: call EFI bootmgr even without having /EFI/boot In-Reply-To: <20200923211550.18678-1-michael@walle.cc> References: <20200923211550.18678-1-michael@walle.cc> Message-ID: <22503A63-A7F9-48A1-8AE6-7A947F7009CA@gmx.de> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de Am 23. September 2020 23:15:50 MESZ schrieb Michael Walle : >Currently, the EFI bootmgr is only called if there is a EFI binary >inside the path for removable media is found, i.e. /EFI/boot/. This >doesn't make sense. It is the duty of the bootmgr to find out the >path and name of the EFI binary to boot. It should be called even >if there is no /EFI/boot directory. Yes, UEFI variables indicating the boot binary take precedence. \EFI\boot\ is the fallback. > >Thus, call the bootmgr before we try to boot the EFI binary inside >the removable media path. > >Signed-off-by: Michael Walle >--- > include/config_distro_bootcmd.h | 7 +++++-- > 1 file changed, 5 insertions(+), 2 deletions(-) > >diff --git a/include/config_distro_bootcmd.h >b/include/config_distro_bootcmd.h >index fc0935fa21..c745f115f8 100644 >--- a/include/config_distro_bootcmd.h >+++ b/include/config_distro_bootcmd.h >@@ -123,12 +123,14 @@ > > >#define BOOTENV_SHARED_EFI > \ >- "boot_efi_binary=" \ >+ "boot_efi_bootmgr=" \ > "if fdt addr ${fdt_addr_r}; then " \ The problem here is that we don't have a clue which device tree we should load to $fdt_addr_r to make this true. > "bootefi bootmgr ${fdt_addr_r};" \ > "else " \ > "bootefi bootmgr ${fdtcontroladdr};" Don't pass an fdt address in the else path. Some boards use ACPI. If ACPI is not used we have a fallback logic in cmd/bootefi.c. Best regards Heinrich \ >- "fi;" \ >+ "fi\0" \ >+ \ >+ "boot_efi_binary=" \ > "load ${devtype} ${devnum}:${distro_bootpart} " \ > "${kernel_addr_r} efi/boot/"BOOTEFI_NAME"; " \ > "if fdt addr ${fdt_addr_r}; then " \ >@@ -152,6 +154,7 @@ > "run load_efi_dtb; " \ > "fi;" \ > "done;" \ >+ "run boot_efi_bootmgr;" \ > "if test -e ${devtype} ${devnum}:${distro_bootpart} " \ > "efi/boot/"BOOTEFI_NAME"; then " \ > "echo Found EFI removable media binary " \