1 .. SPDX-License-Identifier: GPL-2.0+
2 .. (C) Copyright 2011-2012 Pali Rohár <pali@kernel.org>
7 The "bootmenu" command uses U-Boot menu interfaces and provides
8 a simple mechanism for creating menus with different boot items.
9 The cursor keys "Up" and "Down" are used for navigation through
10 the items. Current active menu item is highlighted and can be
11 selected using the "Enter" key. The selection of the highlighted
12 menu entry invokes an U-Boot command (or a list of commands)
13 associated with this menu entry.
15 The "bootmenu" command interprets ANSI escape sequencies, so
16 an ANSI terminal is required for proper menu rendering and item
19 The assembling of the menu is done via a set of environment variables
20 "bootmenu_<num>" and "bootmenu_delay", i.e.::
22 bootmenu_delay=<delay>
23 bootmenu_<num>="<title>=<commands>"
26 is the autoboot delay in seconds, after which the first
27 menu entry will be selected automatically
30 is the boot menu entry number, starting from zero
33 is the text of the menu entry shown on the console
37 are commands which will be executed when a menu
40 Title and commands are separated by the first appearance of a '='
41 character in the value of the environment variable.
43 The first (optional) argument of the "bootmenu" command is a delay specifier
44 and it overrides the delay value defined by "bootmenu_delay" environment
45 variable. If the environment variable "bootmenu_delay" is not set or if
46 the argument of the "bootmenu" command is not specified, the default delay
47 will be CONFIG_BOOTDELAY. If delay is 0, no menu entries will be shown on
48 the console (or on the screen) and the command of the first menu entry will
49 be called immediately. If delay is less then 0, bootmenu will be shown and
50 autoboot will be disabled.
52 Bootmenu always adds menu entry "U-Boot console" at the end of all menu
53 entries specified by environment variables. When selecting this entry
54 the bootmenu terminates and the usual U-Boot command prompt is presented
59 setenv bootmenu_0 Boot 1. kernel=bootm 0x82000000 # Set first menu entry
60 setenv bootmenu_1 Boot 2. kernel=bootm 0x83000000 # Set second menu entry
61 setenv bootmenu_2 Reset board=reset # Set third menu entry
62 setenv bootmenu_3 U-Boot boot order=boot # Set fourth menu entry
63 bootmenu 20 # Run bootmenu with autoboot delay 20s
66 The above example will be rendered as below::
68 *** U-Boot Boot Menu ***
76 Hit any key to stop autoboot: 20
77 Press UP/DOWN to move, ENTER to select
79 The selected menu entry will be highlighted - it will have inverted
80 background and text colors.
82 The "bootmenu" cammand is enabled by::
86 To run the bootmenu at startup add these additional settings::
88 CONFIG_AUTOBOOT_KEYED=y
90 CONFIG_AUTOBOOT_MENU_SHOW=y
92 When you intend to use the bootmenu on a color frame buffer console,
93 make sure to additionally define::
95 CONFIG_CFB_CONSOLE_ANSI=y