[RFC PATCH v3 0/2] enable menu-driven boot device selection

Masahisa Kojima masahisa.kojima at linaro.org
Tue Mar 8 15:07:43 CET 2022

This patch series adds the menu-driven boot device selection,
by extending the existing "bootmenu" to include UEFI and distro_boot
related entries.

The menu example shown with this patch series is as follows.

  *** U-Boot Boot Menu ***

     Boot 1. kernel (bootmenu_0)
     Boot 2. kernel (bootmenu_1)
     Reset board (bootmenu_2)
     debian (BOOT0000)
     ubuntu (BOOT0001)
     UEFI Boot Manager
     UEFI Boot Manager Maintenance
     U-Boot console

  Press UP/DOWN to move, ENTER to select, ESC/CTRL+C to quit

This example shows three "bootmenu_0..2" entries, UEFI "Boot0000" and "Boot0001"
entries, distro_boot "boot_targets" entries(usb0, scici0, virtio0 and dhcp)
and some pre-defined entries(UEFI Boot Manager, UEFI Boot Manager Maintenance
and U-Boot console).

Note that this patch series aims to propose the above menu structure,
the code quality is very low and requires much cleanup/refactoring.

[How to run on QEMU(arm64)]
1) clone source code
 $ git clone https://git.linaro.org/people/masahisa.kojima/u-boot.git \
-b kojima/efibootmenu_v3_upstream --depth 2

2) update U-Boot .config
 $ make qemu_arm64_menuconfig

3) run on QEMU(arm64) example
 $ qemu-system-aarch64 -machine virt,gic-version=3 -cpu cortex-a57 -m 4G -nographic \
   -no-acpi -bios ./u-boot.bin -hda xxx.img

[Changes in v3]

- Major difference from previous version is that this version
  extends the existing bootmenu capability instead of updating
  efi bootmgr.
- include distro_boot entries
- "bootefi bootindex" command is newly added

Masahisa Kojima (2):
  efi_loader: introduce "bootefi bootindex" command
  bootmenu: add UEFI and disto_boot entries

 cmd/bootefi.c                |  42 ++++++
 cmd/bootmenu.c               | 268 +++++++++++++++++++++++++++++++++--
 include/efi_loader.h         |   1 +
 lib/efi_loader/efi_bootmgr.c |   7 +-
 4 files changed, 305 insertions(+), 13 deletions(-)


More information about the U-Boot mailing list