cmd: bootmenu: permit to select bootmenu entry with a shortcut
authorChristian Marangi <ansuelsmth@gmail.com>
Sun, 25 May 2025 13:43:58 +0000 (15:43 +0200)
committerTom Rini <trini@konsulko.com>
Thu, 5 Jun 2025 22:57:35 +0000 (16:57 -0600)
commit8c986521c3c961338dc86a279757e67e8e23513f
treeb9726a56ee0e625d39f74029f6cad78eb5a60cfe
parent615997ec2174916be7ee214cf20e22978fdb34e8
cmd: bootmenu: permit to select bootmenu entry with a shortcut

Permit to select a bootmenu entry with a key shortcut. This is
especially useful in production or testing scenario to automate flashing
procedure or testing procedure.

The boot entry are changed to append the shortcut key to it.

Example:
      1. Run default boot command.
      2. Boot system via TFTP.
      3. Boot production system from NAND.
      4. Boot recovery system from NAND.
      5. Load production system via TFTP then write to NAND.
      6. Load recovery system via TFTP then write to NAND.
      7. Load BL31+U-Boot FIP via TFTP then write to NAND.
      8. Load BL2 preloader via TFTP then write to NAND.
      9. Reboot.
      a. Reset all settings to factory defaults.
      0. Exit

0 is always reserved for Exit to console.
On pressing the keyboard key 2, the bootmenu entry 2 is selected and
executed.

Up to 34 key shortcut (0 excluded as reserved) are supported from 1-9
and a-z.
If a shortcut key not present in the bootmenu list is pressed, it is
simply ignored and eventually the autoboot is interrupted.

Capital A-Z are converted to lower a-z and the related option is
selected.

Suggested-by: Weijie Gao <weijie.gao@mediatek.com>
Signed-off-by: Christian Marangi <ansuelsmth@gmail.com>
Tested-by: Petr Štetiar <ynezz@true.cz>
cmd/bootmenu.c
common/menu.c
include/cli.h
include/menu.h