xref: /illumos-gate/usr/src/boot/forth/menu.rc (revision 22028508)
1199767f8SToomas Soome\ Menu.rc
2199767f8SToomas Soome\
3199767f8SToomas Soome\ Load required Forth modules
4199767f8SToomas Soomeinclude /boot/forth/version.4th
5199767f8SToomas Soomeinclude /boot/forth/brand.4th
6199767f8SToomas Soomeinclude /boot/forth/menu.4th
7199767f8SToomas Soomeinclude /boot/forth/menu-commands.4th
8199767f8SToomas Soomeinclude /boot/forth/shortcuts.4th
9199767f8SToomas Soome
10199767f8SToomas Soome\ Screen prep
11199767f8SToomas Soomeclear         \ clear the screen (see `screen.4th')
12199767f8SToomas Soomeprint_version \ print version string (bottom-right; see `version.4th')
13199767f8SToomas Soomedraw-beastie  \ draw freebsd mascot (on right; see `beastie.4th')
14199767f8SToomas Soomedraw-brand    \ draw the FreeBSD title (top-left; see `brand.4th')
15199767f8SToomas Soomemenu-init     \ initialize the menu area (see `menu.4th')
16199767f8SToomas Soome
17199767f8SToomas Soome\ Initialize main menu constructs (see `menu.4th')
18199767f8SToomas Soome\ NOTE: To use `non-ansi' variants, add `loader_color=0' to loader.conf(5)
19199767f8SToomas Soome\ NOTE: ANSI variants can use `^' in place of literal `Esc' (ASCII 27)
20199767f8SToomas Soome
212aa37581SToomas Soome\
22199767f8SToomas Soome\ MAIN MENU
232aa37581SToomas Soome\
24199767f8SToomas Soome
25199767f8SToomas Soomeset menuset_name1="main"
26199767f8SToomas Soome
27199767f8SToomas Soomeset mainmenu_init[1]="init_boot"
28199767f8SToomas Soome
29199767f8SToomas Soomes" smartos" getenv? [if]
30199767f8SToomas Soome	set mainmenu_caption[1]="Boot SmartOS [Enter]"
31199767f8SToomas Soome	set maintoggled_text[1]="R[e]covery (root/root) [Enter]"
32199767f8SToomas Soome	set mainansi_caption[1]="^[1mB^[moot SmartOS ^[1m[Enter]^[m"
33199767f8SToomas Soome	set maintoggled_ansi[1]="R^[1me^[mcovery (root/root) ^[1m[Enter]^[m"
34199767f8SToomas Soome[else]
35199767f8SToomas Soome	set mainmenu_caption[1]="Boot Multi User [Enter]"
36199767f8SToomas Soome	set maintoggled_text[1]="Boot [S]ingle User [Enter]"
37199767f8SToomas Soome	set mainansi_caption[1]="^[1mB^[moot Multi User ^[1m[Enter]^[m"
38199767f8SToomas Soome	set maintoggled_ansi[1]="Boot ^[1mS^[mingle User ^[1m[Enter]^[m"
39199767f8SToomas Soome[then]
40199767f8SToomas Soomeset mainmenu_command[1]="boot"
41199767f8SToomas Soome\ keycode set by init_boot
42199767f8SToomas Soome
43199767f8SToomas Soomeset mainmenu_init[2]="init_altboot"
44199767f8SToomas Soomes" smartos" getenv? [if]
45199767f8SToomas Soome	set mainmenu_caption[2]="[R]ecovery (root/root)"
46199767f8SToomas Soome	set maintoggled_text[2]="[B]oot SmartOS"
47199767f8SToomas Soome	set mainansi_caption[2]="^[1mR^[mecovery (root/root)"
48199767f8SToomas Soome	set maintoggled_ansi[2]="^[1mB^[oot SmartOS"
49199767f8SToomas Soome[else]
50199767f8SToomas Soome	set mainmenu_caption[2]="Boot [S]ingle User"
51199767f8SToomas Soome	set maintoggled_text[2]="Boot [M]ulti User"
52199767f8SToomas Soome	set mainansi_caption[2]="Boot ^[1mS^[mingle User"
53199767f8SToomas Soome	set maintoggled_ansi[2]="Boot ^[1mM^[multi User"
54199767f8SToomas Soome[then]
55199767f8SToomas Soomeset mainmenu_command[2]="altboot"
56199767f8SToomas Soome\ keycode set by init_altboot
57199767f8SToomas Soome
58199767f8SToomas Soomeset mainmenu_caption[3]="[Esc]ape to loader prompt"
59199767f8SToomas Soomeset mainmenu_command[3]="goto_prompt"
60199767f8SToomas Soomeset mainmenu_keycode[3]=27
61199767f8SToomas Soomeset mainansi_caption[3]="^[1mEsc^[mape to loader prompt"
62199767f8SToomas Soome
63199767f8SToomas Soome\ Enable built-in "Reboot" trailing menuitem
64199767f8SToomas Soome\ NOTE: appears before menu_options if configured
652aa37581SToomas Soome\
66199767f8SToomas Soomeset mainmenu_reboot
67199767f8SToomas Soome
68199767f8SToomas Soome\ Enable "Options:" separator. When set to a numerical value (1-8), a visual
69199767f8SToomas Soome\ separator is inserted before that menuitem number.
702aa37581SToomas Soome\
71199767f8SToomas Soomeset mainmenu_options=5
72199767f8SToomas Soome
73199767f8SToomas Soomeset mainmenu_caption[5]="Configure Boot [O]ptions..."
74199767f8SToomas Soomeset mainmenu_command[5]="2 goto_menu"
75199767f8SToomas Soomeset mainmenu_keycode[5]=111
76199767f8SToomas Soomeset mainansi_caption[5]="Configure Boot ^[1mO^[mptions..."
77199767f8SToomas Soome
78199767f8SToomas Soome\ Boot Environments are (supported) only on ZFS
79199767f8SToomas Soomes" currdev" getenv drop 4 s" zfs:" compare 0= be-pages and [if]
80199767f8SToomas Soomeset mainmenu_caption[6]="Select Boot [E]nvironment..."
81199767f8SToomas Soomeset mainmenu_command[6]="3 goto_menu"
82199767f8SToomas Soomeset mainmenu_keycode[6]=101
83199767f8SToomas Soomeset mainansi_caption[6]="Select Boot ^[1mE^[mnvironment..."
84199767f8SToomas Soome
85199767f8SToomas Soome  s" chain_disk" getenv? [if]
865006c573SToomas Soome	set mainmenu_caption[7]="Chain[L]oad ${chain_disk}"
87199767f8SToomas Soome	set mainmenu_command[7]="chain ${chain_disk}"
88199767f8SToomas Soome	set mainmenu_keycode[7]=108
89199767f8SToomas Soome	set mainansi_caption[7]="Chain^[1mL^[moad ${chain_disk}"
90199767f8SToomas Soome  [then]
91199767f8SToomas Soome[else]
92199767f8SToomas Soome  s" chain_disk" getenv? [if]
935006c573SToomas Soome	set mainmenu_caption[6]="Chain[L]oad ${chain_disk}"
94199767f8SToomas Soome	set mainmenu_command[6]="chain ${chain_disk}"
95199767f8SToomas Soome	set mainmenu_keycode[6]=108
96199767f8SToomas Soome	set mainansi_caption[6]="Chain^[1mL^[moad ${chain_disk}"
97199767f8SToomas Soome  [then]
98199767f8SToomas Soome[then]
99199767f8SToomas Soome
1002aa37581SToomas Soome\
101199767f8SToomas Soome\ BOOT OPTIONS MENU
1022aa37581SToomas Soome\
103199767f8SToomas Soome
104199767f8SToomas Soomeset menuset_name2="options"
105199767f8SToomas Soome
106199767f8SToomas Soomeset optionsmenu_caption[1]="Back to Main Menu [Backspace]"
107199767f8SToomas Soomeset optionsmenu_command[1]="1 goto_menu"
108199767f8SToomas Soomeset optionsmenu_keycode[1]=8
109199767f8SToomas Soomeset optionsansi_caption[1]="Back to Main Menu ^[1m[Backspace]^[m"
110199767f8SToomas Soome
111199767f8SToomas Soome\ set optionsmenu_caption[2]="Load System [D]efaults"
112199767f8SToomas Soome\ set optionsmenu_command[2]="set_default_boot_options"
113199767f8SToomas Soome\ set optionsmenu_keycode[2]=100
114199767f8SToomas Soome\ set optionsansi_caption[2]="Load System ^[1mD^[mefaults"
115199767f8SToomas Soome
116199767f8SToomas Soomeset optionsmenu_options=2
117199767f8SToomas Soomeset optionsmenu_optionstext="Boot Options:"
118199767f8SToomas Soome
119199767f8SToomas Soomeset optionsmenu_osconsole=2
120199767f8SToomas Soomeset optionsmenu_command[2]="cycle_osconsole"
121199767f8SToomas Soomeset optionsmenu_keycode[2]=99
122199767f8SToomas Soome
123199767f8SToomas Soomeset optionsmenu_acpi=3
124199767f8SToomas Soomeset optionsmenu_command[3]="cycle_acpi"
125199767f8SToomas Soomeset optionsmenu_keycode[3]=97
126199767f8SToomas Soome
127199767f8SToomas Soomeset optionsmenu_init[4]="init_singleuser"
128c3e6a6edSJohn Levonset optionsmenu_caption[4]="[S]ingle User......... Off"
129c3e6a6edSJohn Levonset optionstoggled_text[4]="[S]ingle User......... On"
130199767f8SToomas Soomeset optionsmenu_command[4]="toggle_singleuser"
131199767f8SToomas Soomeset optionsmenu_keycode[4]=115
132c3e6a6edSJohn Levonset optionsansi_caption[4]="^[1mS^[mingle User........... ^[34;1mOff^[m"
133c3e6a6edSJohn Levonset optionstoggled_ansi[4]="^[1mS^[mingle User........... ^[32;7mOn^[m"
134199767f8SToomas Soome
135199767f8SToomas Soomeset optionsmenu_init[5]="init_verbose"
136c3e6a6edSJohn Levonset optionsmenu_caption[5]="[V]erbose............. Off"
137c3e6a6edSJohn Levonset optionstoggled_text[5]="[V]erbose............. On"
138199767f8SToomas Soomeset optionsmenu_command[5]="toggle_verbose"
139199767f8SToomas Soomeset optionsmenu_keycode[5]=118
140c3e6a6edSJohn Levonset optionsansi_caption[5]="^[1mV^[merbose............... ^[34;1mOff^[m"
141c3e6a6edSJohn Levonset optionstoggled_ansi[5]="^[1mV^[merbose............... ^[32;7mOn^[m"
142199767f8SToomas Soome
143199767f8SToomas Soomeset optionsmenu_init[6]="init_reconfigure"
144c3e6a6edSJohn Levonset optionsmenu_caption[6]="[R]econfigure......... Off"
145c3e6a6edSJohn Levonset optionstoggled_text[6]="[R]econfigure......... On"
146199767f8SToomas Soomeset optionsmenu_command[6]="toggle_reconfigure"
147199767f8SToomas Soomeset optionsmenu_keycode[6]=114
148c3e6a6edSJohn Levonset optionsansi_caption[6]="^[1mR^[meconfigure........... ^[34;1mOff^[m"
149c3e6a6edSJohn Levonset optionstoggled_ansi[6]="^[1mR^[meconfigure........... ^[32;7mOn^[m"
150199767f8SToomas Soome
151a1625066SAndy Fiddamanset optionsmenu_kmdb=7
152a1625066SAndy Fiddamanset optionsmenu_command[7]="cycle_kmdb"
153c3e6a6edSJohn Levonset optionsmenu_keycode[7]=107
154c3e6a6edSJohn Levon
155a1625066SAndy Fiddaman\
156a1625066SAndy Fiddaman\ In EFI mode the framebuffer cannot be disabled. Although "framebuffer off"
157a1625066SAndy Fiddaman\ does switch to a simple text protocol, it doesn't affect the kernel which
158a1625066SAndy Fiddaman\ still ends up with a framebuffer console. This option is therefore only
159a1625066SAndy Fiddaman\ exposed in a non-EFI environment.
160a1625066SAndy Fiddaman\
161a1625066SAndy Fiddamanefi? invert [if]
162a1625066SAndy Fiddaman  set optionsmenu_init[8]="init_framebuffer"
163a1625066SAndy Fiddaman  set optionsmenu_caption[8]="[G]raphical Console... Off"
164a1625066SAndy Fiddaman  set optionstoggled_text[8]="[G]raphical Console... On"
165a1625066SAndy Fiddaman  set optionsmenu_command[8]="toggle_framebuffer"
166a1625066SAndy Fiddaman  set optionsmenu_keycode[8]=103
167a1625066SAndy Fiddaman  set optionsansi_caption[8]="^[1mG^[mraphical Console..... ^[34;1mOff^[m"
168a1625066SAndy Fiddaman  set optionstoggled_ansi[8]="^[1mG^[mraphical Console..... ^[32;7mOn^[m"
169a1625066SAndy Fiddaman[then]
170199767f8SToomas Soome
171199767f8SToomas Soome\
172199767f8SToomas Soome\ BOOT ENVIRONMENT MENU
173199767f8SToomas Soome\
174199767f8SToomas Soome
1752597f9c4SToomas Soome\ the BE list is read from [pool]/boot/menu.lst, the list in file
176199767f8SToomas Soome\ is ordered from oldest to most recent.
177199767f8SToomas Soome\ the BE menu will list entries from most recent to oldest,
178199767f8SToomas Soome\ so the first page in menu is last page in menu.lst
179199767f8SToomas Soome
1802597f9c4SToomas Soomebe-pages [if]
181199767f8SToomas Soome  set zfs_be_currpage=1
182199767f8SToomas Soome  be-set-page			\ set page data
183199767f8SToomas Soome  set menuset_name3="bootenv"
184199767f8SToomas Soome
185199767f8SToomas Soome  set bootenvmenu_command[1]="be_draw_screen 1 goto_menu"
186199767f8SToomas Soome  set bootenvmenu_keycode[1]=8
187199767f8SToomas Soome
188199767f8SToomas Soome  set bootenvmenu_keycode[2]=8
189199767f8SToomas Soome  set bootenvmenu_command[2]="be_draw_screen 1 goto_menu"
190199767f8SToomas Soome
191199767f8SToomas Soome  set bemenu_current="Active: "
192199767f8SToomas Soome  set beansi_current="^[1m${bemenu_current}^[m"
193199767f8SToomas Soome  set bemenu_bootfs="bootfs: "
194199767f8SToomas Soome  set beansi_bootfs="^[1m${bemenu_bootfs}^[m"
195199767f8SToomas Soome  set bemenu_page="[P]age: "
196199767f8SToomas Soome  set beansi_page="^[1mP^[mage: "
197199767f8SToomas Soome  set bemenu_pageof=" of "
198199767f8SToomas Soome  set beansi_pageof="${bemenu_pageof}"
199199767f8SToomas Soome
200199767f8SToomas Soome  set bootenvmenu_init="init_bootenv"
201199767f8SToomas Soome
202199767f8SToomas Soome  set bootenvmenu_keycode[3]=112
203199767f8SToomas Soome  set bootenvmenu_command[3]="set_be_page"
204199767f8SToomas Soome
205199767f8SToomas Soome  set bootenvmenu_options=4
206199767f8SToomas Soome  set bootenvmenu_optionstext="Boot Environments:"
207199767f8SToomas Soome[then]
208199767f8SToomas Soome
209199767f8SToomas Soome\ Enable automatic booting (add ``autoboot_delay=N'' to loader.conf(5) to
210199767f8SToomas Soome\ customize the timeout; default is 10-seconds)
2112aa37581SToomas Soome\
212199767f8SToomas Soomeset menu_timeout_command="boot"
213199767f8SToomas Soome
214199767f8SToomas Soome\ Include optional elements defined in a local file
2152aa37581SToomas Soome\
216199767f8SToomas Soometry-include /boot/menu.rc.local
217199767f8SToomas Soome
218199767f8SToomas Soome\ Display the main menu (see `menu.4th')
219199767f8SToomas Soomeset menuset_initial=1
220199767f8SToomas Soomemenuset-loadinitial
221199767f8SToomas Soomemenu-display
222