bootmenu.rst 3.2 KB

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