diff options
| author | Tom Rini <[email protected]> | 2024-04-08 14:33:59 -0600 |
|---|---|---|
| committer | Tom Rini <[email protected]> | 2024-04-08 14:33:59 -0600 |
| commit | 069d07396e30aa9be396c1dd3fc158ac199e6843 (patch) | |
| tree | f4f2b1af27384f789e5531f9a98cf61ad7f2cdf3 /boot | |
| parent | 9cba29b19f43f9450117e8bc89e7dda691ed5ab5 (diff) | |
| parent | 3f8d13044b32ddd906bb9f2fc705b988ec93df35 (diff) | |
Merge tag 'efi-2024-07-rc1' of https://source.denx.de/u-boot/custodians/u-boot-efi
Pull request efi-2024-07-rc1
Documentation:
* improve description of FAT partition name generation
* add missing :: in doc/usage/cmd/itest.rst
UEFI:
* fix address mode for __efi_runtime_start/stop,
__efi_runtime_rel_start/stop
* fix size of variable attribute constants
* enable booting via EFI boot manager by default
* correct the sequence of the EFI boot methods
* correct finding the default EFI binary
* don't delete variable from memory if update failed
* fix append write behavior to non-existent variable
* Use binman for testing capsule updates on the sandbox
* Consider capsule test files in .gitignore and make clean
Diffstat (limited to 'boot')
| -rw-r--r-- | boot/Kconfig | 10 | ||||
| -rw-r--r-- | boot/Makefile | 2 | ||||
| -rw-r--r-- | boot/bootmeth_efi.c | 46 | ||||
| -rw-r--r-- | boot/bootmeth_efi_mgr.c | 2 | ||||
| -rw-r--r-- | boot/bootmeth_pxe.c | 2 |
5 files changed, 17 insertions, 45 deletions
diff --git a/boot/Kconfig b/boot/Kconfig index 3d7aabd27d6..d9a6c270059 100644 --- a/boot/Kconfig +++ b/boot/Kconfig @@ -558,6 +558,16 @@ config BOOTMETH_EFILOADER This provides a way to try out standard boot on an existing boot flow. +config BOOTMETH_EFI_BOOTMGR + bool "Bootdev support for EFI boot manager" + depends on EFI_BOOTMGR + select BOOTMETH_GLOBAL + default y + help + Enable booting via the UEFI boot manager. Based on the EFI variables + the EFI binary to be launched is determined. To set the EFI variables + use the eficonfig command. + config BOOTMETH_VBE bool "Bootdev support for Verified Boot for Embedded" depends on FIT diff --git a/boot/Makefile b/boot/Makefile index f0a279cde16..84ccfeaecec 100644 --- a/boot/Makefile +++ b/boot/Makefile @@ -34,8 +34,8 @@ obj-$(CONFIG_$(SPL_TPL_)BOOTMETH_CROS) += bootm.o bootm_os.o bootmeth_cros.o obj-$(CONFIG_$(SPL_TPL_)BOOTMETH_SANDBOX) += bootmeth_sandbox.o obj-$(CONFIG_$(SPL_TPL_)BOOTMETH_SCRIPT) += bootmeth_script.o obj-$(CONFIG_$(SPL_TPL_)CEDIT) += cedit.o +obj-$(CONFIG_$(SPL_TPL_)BOOTMETH_EFI_BOOTMGR) += bootmeth_efi_mgr.o ifdef CONFIG_$(SPL_TPL_)BOOTSTD_FULL -obj-$(CONFIG_EFI_BOOTMGR) += bootmeth_efi_mgr.o obj-$(CONFIG_$(SPL_TPL_)EXPO) += bootflow_menu.o obj-$(CONFIG_$(SPL_TPL_)BOOTSTD) += bootflow_menu.o endif diff --git a/boot/bootmeth_efi.c b/boot/bootmeth_efi.c index c4eb331d69e..aebc5207fc0 100644 --- a/boot/bootmeth_efi.c +++ b/boot/bootmeth_efi.c @@ -14,6 +14,7 @@ #include <bootmeth.h> #include <command.h> #include <dm.h> +#include <efi_default_filename.h> #include <efi_loader.h> #include <fs.h> #include <malloc.h> @@ -23,43 +24,7 @@ #include <pxe_utils.h> #include <linux/sizes.h> -#define EFI_DIRNAME "efi/boot/" - -/** - * get_efi_leafname() - Get the leaf name for the EFI file we expect - * - * @str: Place to put leaf name for this architecture, e.g. "bootaa64.efi". - * Must have at least 16 bytes of space - * @max_len: Length of @str, must be >=16 - */ -static int get_efi_leafname(char *str, int max_len) -{ - const char *base; - - if (max_len < 16) - return log_msg_ret("spc", -ENOSPC); - if (IS_ENABLED(CONFIG_ARM64)) - base = "bootaa64"; - else if (IS_ENABLED(CONFIG_ARM)) - base = "bootarm"; - else if (IS_ENABLED(CONFIG_X86_RUN_32BIT)) - base = "bootia32"; - else if (IS_ENABLED(CONFIG_X86_RUN_64BIT)) - base = "bootx64"; - else if (IS_ENABLED(CONFIG_ARCH_RV32I)) - base = "bootriscv32"; - else if (IS_ENABLED(CONFIG_ARCH_RV64I)) - base = "bootriscv64"; - else if (IS_ENABLED(CONFIG_SANDBOX)) - base = "bootsbox"; - else - return -EINVAL; - - strcpy(str, base); - strcat(str, ".efi"); - - return 0; -} +#define EFI_DIRNAME "/EFI/BOOT/" static int get_efi_pxe_arch(void) { @@ -259,10 +224,7 @@ static int distro_efi_try_bootflow_files(struct udevice *dev, return -ENOENT; strcpy(fname, EFI_DIRNAME); - ret = get_efi_leafname(fname + strlen(fname), - sizeof(fname) - strlen(fname)); - if (ret) - return log_msg_ret("leaf", ret); + strcat(fname, BOOTEFI_NAME); if (bflow->blk) desc = dev_get_uclass_plat(bflow->blk); @@ -489,7 +451,7 @@ static const struct udevice_id distro_efi_bootmeth_ids[] = { { } }; -U_BOOT_DRIVER(bootmeth_efi) = { +U_BOOT_DRIVER(bootmeth_4efi) = { .name = "bootmeth_efi", .id = UCLASS_BOOTMETH, .of_match = distro_efi_bootmeth_ids, diff --git a/boot/bootmeth_efi_mgr.c b/boot/bootmeth_efi_mgr.c index ed29d7ef021..b7d429f2c3d 100644 --- a/boot/bootmeth_efi_mgr.c +++ b/boot/bootmeth_efi_mgr.c @@ -114,7 +114,7 @@ static const struct udevice_id efi_mgr_bootmeth_ids[] = { { } }; -U_BOOT_DRIVER(bootmeth_efi_mgr) = { +U_BOOT_DRIVER(bootmeth_3efi_mgr) = { .name = "bootmeth_efi_mgr", .id = UCLASS_BOOTMETH, .of_match = efi_mgr_bootmeth_ids, diff --git a/boot/bootmeth_pxe.c b/boot/bootmeth_pxe.c index 8d489a11aa4..70f693aa239 100644 --- a/boot/bootmeth_pxe.c +++ b/boot/bootmeth_pxe.c @@ -184,7 +184,7 @@ static const struct udevice_id extlinux_bootmeth_pxe_ids[] = { { } }; -U_BOOT_DRIVER(bootmeth_pxe) = { +U_BOOT_DRIVER(bootmeth_zpxe) = { .name = "bootmeth_pxe", .id = UCLASS_BOOTMETH, .of_match = extlinux_bootmeth_pxe_ids, |
