1.. SPDX-License-Identifier: GPL-2.0+ 2.. (C) Copyright 2011-2012 Pali Rohár <pali@kernel.org> 3 4bootmenu command 5================ 6 7The "bootmenu" command uses U-Boot menu interfaces and provides 8a simple mechanism for creating menus with different boot items. 9The cursor keys "Up" and "Down" are used for navigation through 10the items. Current active menu item is highlighted and can be 11selected using the "Enter" key. The selection of the highlighted 12menu entry invokes an U-Boot command (or a list of commands) 13associated with this menu entry. 14 15The "bootmenu" command interprets ANSI escape sequencies, so 16an ANSI terminal is required for proper menu rendering and item 17selection. 18 19The assembling of the menu is done via a set of environment variables 20"bootmenu_<num>" and "bootmenu_delay", i.e.:: 21 22 bootmenu_delay=<delay> 23 bootmenu_<num>="<title>=<commands>" 24 25<delay> 26 is the autoboot delay in seconds, after which the first 27 menu entry will be selected automatically 28 29<num> 30 is the boot menu entry number, starting from zero 31 32<title> 33 is the text of the menu entry shown on the console 34 or on the boot screen 35 36<commands> 37 are commands which will be executed when a menu 38 entry is selected 39 40Title and commands are separated by the first appearance of a '=' 41character in the value of the environment variable. 42 43The first (optional) argument of the "bootmenu" command is a delay specifier 44and it overrides the delay value defined by "bootmenu_delay" environment 45variable. If the environment variable "bootmenu_delay" is not set or if 46the argument of the "bootmenu" command is not specified, the default delay 47will be CONFIG_BOOTDELAY. If delay is 0, no menu entries will be shown on 48the console (or on the screen) and the command of the first menu entry will 49be called immediately. If delay is less then 0, bootmenu will be shown and 50autoboot will be disabled. 51 52Bootmenu always adds menu entry "U-Boot console" at the end of all menu 53entries specified by environment variables. When selecting this entry 54the bootmenu terminates and the usual U-Boot command prompt is presented 55to the user. 56 57Example environment:: 58 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 64 65 66The above example will be rendered as below:: 67 68 *** U-Boot Boot Menu *** 69 70 Boot 1. kernel 71 Boot 2. kernel 72 Reset board 73 U-Boot boot order 74 U-Boot console 75 76 Hit any key to stop autoboot: 20 77 Press UP/DOWN to move, ENTER to select 78 79The selected menu entry will be highlighted - it will have inverted 80background and text colors. 81 82The "bootmenu" cammand is enabled by:: 83 84 CONFIG_CMD_BOOTMENU=y 85 86To run the bootmenu at startup add these additional settings:: 87 88 CONFIG_AUTOBOOT_KEYED=y 89 CONFIG_BOOTDELAY=30 90 CONFIG_AUTOBOOT_MENU_SHOW=y 91 92When you intend to use the bootmenu on a color frame buffer console, 93make sure to additionally define:: 94 95 CONFIG_CFB_CONSOLE_ANSI=y 96