diff options
| author | Tom Rini <[email protected]> | 2025-01-08 18:05:51 -0600 |
|---|---|---|
| committer | Tom Rini <[email protected]> | 2025-01-08 18:05:51 -0600 |
| commit | e13e0a921f444cc12127c8a497dcc476f1268939 (patch) | |
| tree | 19ecf26e4ddc96357f74edc6e7557995de7c0477 /cmd/bootmenu.c | |
| parent | 3bfd12008bef1a8353e7ceaca2cb06cf388527ed (diff) | |
| parent | 9c6c7e30aa006a3eab52302e5399f5eb592184ed (diff) | |
Merge tag 'efi-next-20250105' of https://source.denx.de/u-boot/custodians/u-boot-efi
Pull request efi-next-20250105
Documentation:
* doc: develop: Fix typos and wording in binman/binman.rst
* doc: develop: Fix typos and wording in gdb.rst
* doc: sandbox: Fix the "sb" command name
* doc/develop/distro.rst: Better document upstream definition of extlinux.conf
UEFI:
* efi_loader: avoid writing message in Exit() boot service
* efi_loader: update EFI specification version
* cmd: efidebug: update output of memory attributes
* efi_loader: Don't warn if the TCG2 FinalEvents table is not installed
* cmd: bootmenu: add parameter -e for UEFI boot options
* efi_loader: Update startimage_exit self-test to check error
* efi: Correct ECPT table GUID
Others:
Building the API demo application for riscv64 is supported.
* API: unify platform_sys_info() implementations
* examples: implement _start and syscall for RISC-V
* examples: use architecture specific memset() on RISC-V
* examples: use QEMU compatible LOAD_ADDR on RISC-V
* test: fix test_extension.py
* configs: sandbox_deconfig: remove CONFIG_AMIGA_PARTITION
* CI: xilinx_versal_virt: disable USB_DWC3
* net: eth_bootdev_hunt() should not run DHCP
Diffstat (limited to 'cmd/bootmenu.c')
| -rw-r--r-- | cmd/bootmenu.c | 39 |
1 files changed, 30 insertions, 9 deletions
diff --git a/cmd/bootmenu.c b/cmd/bootmenu.c index b633aedf011..a5c979079f4 100644 --- a/cmd/bootmenu.c +++ b/cmd/bootmenu.c @@ -330,7 +330,13 @@ static int prepare_uefi_bootorder_entry(struct bootmenu_data *menu, } #endif -static struct bootmenu_data *bootmenu_create(int delay) +/** + * bootmenu_create() - create boot menu entries + * + * @uefi: consider UEFI boot options + * @delay: autostart delay in seconds + */ +static struct bootmenu_data *bootmenu_create(int uefi, int delay) { int ret; unsigned short int i = 0; @@ -357,7 +363,7 @@ static struct bootmenu_data *bootmenu_create(int delay) goto cleanup; #if (IS_ENABLED(CONFIG_CMD_BOOTEFI_BOOTMGR)) && (IS_ENABLED(CONFIG_CMD_EFICONFIG)) - if (i < MAX_COUNT - 1) { + if (uefi && i < MAX_COUNT - 1) { efi_status_t efi_ret; /* @@ -481,7 +487,13 @@ static void handle_uefi_bootnext(void) run_command("bootefi bootmgr", 0); } -static enum bootmenu_ret bootmenu_show(int delay) +/** + * bootmenu_show - display boot menu + * + * @uefi: generated entries for UEFI boot options + * @delay: autoboot delay in seconds + */ +static enum bootmenu_ret bootmenu_show(int uefi, int delay) { int cmd_ret; int init = 0; @@ -495,7 +507,7 @@ static enum bootmenu_ret bootmenu_show(int delay) efi_status_t efi_ret = EFI_SUCCESS; char *option, *sep; - if (IS_ENABLED(CONFIG_CMD_BOOTEFI_BOOTMGR)) + if (IS_ENABLED(CONFIG_CMD_BOOTEFI_BOOTMGR) && uefi) handle_uefi_bootnext(); /* If delay is 0 do not create menu, just run first entry */ @@ -514,7 +526,7 @@ static enum bootmenu_ret bootmenu_show(int delay) return (cmd_ret == CMD_RET_SUCCESS ? BOOTMENU_RET_SUCCESS : BOOTMENU_RET_FAIL); } - bootmenu = bootmenu_create(delay); + bootmenu = bootmenu_create(uefi, delay); if (!bootmenu) return BOOTMENU_RET_FAIL; @@ -609,7 +621,7 @@ int menu_show(int bootdelay) int ret; while (1) { - ret = bootmenu_show(bootdelay); + ret = bootmenu_show(1, bootdelay); bootdelay = -1; if (ret == BOOTMENU_RET_UPDATED) continue; @@ -635,11 +647,19 @@ int do_bootmenu(struct cmd_tbl *cmdtp, int flag, int argc, char *const argv[]) { char *delay_str = NULL; int delay = 10; + int uefi = 0; #if defined(CONFIG_BOOTDELAY) && (CONFIG_BOOTDELAY >= 0) delay = CONFIG_BOOTDELAY; #endif + if (argc >= 2) { + if (!strcmp("-e", argv[1])) { + uefi = 1; + --argc; + ++argv; + } + } if (argc >= 2) delay_str = argv[1]; @@ -649,13 +669,14 @@ int do_bootmenu(struct cmd_tbl *cmdtp, int flag, int argc, char *const argv[]) if (delay_str) delay = (int)simple_strtol(delay_str, NULL, 10); - bootmenu_show(delay); + bootmenu_show(uefi, delay); return 0; } U_BOOT_CMD( bootmenu, 2, 1, do_bootmenu, "ANSI terminal bootmenu", - "[delay]\n" - " - show ANSI terminal bootmenu with autoboot delay" + "[-e] [delay]\n" + "-e - show UEFI entries\n" + "delay - show ANSI terminal bootmenu with autoboot delay" ); |
