xref: /illumos-gate/usr/src/boot/forth/menu.rc (revision 0a1985fd5d819434967276b189f6f06494028e2c)
1\ Menu.rc
2\
3\ Load required Forth modules
4include /boot/forth/version.4th
5include /boot/forth/brand.4th
6include /boot/forth/menu.4th
7include /boot/forth/menu-commands.4th
8include /boot/forth/shortcuts.4th
9
10\ Screen prep
11clear         \ clear the screen (see `screen.4th')
12print_version \ print version string (bottom-right; see `version.4th')
13draw-beastie  \ draw freebsd mascot (on right; see `beastie.4th')
14draw-brand    \ draw the FreeBSD title (top-left; see `brand.4th')
15menu-init     \ initialize the menu area (see `menu.4th')
16
17\ Initialize main menu constructs (see `menu.4th')
18\ NOTE: To use `non-ansi' variants, add `loader_color=0' to loader.conf(5)
19\ NOTE: ANSI variants can use `^' in place of literal `Esc' (ASCII 27)
20
21\
22\ MAIN MENU
23\
24
25set menuset_name1="main"
26
27set mainmenu_init[1]="init_boot"
28
29s" smartos" getenv? [if]
30	set mainmenu_caption[1]="Boot SmartOS [Enter]"
31	set maintoggled_text[1]="R[e]covery (root/root) [Enter]"
32	set mainansi_caption[1]="^[1mB^[moot SmartOS ^[1m[Enter]^[m"
33	set maintoggled_ansi[1]="R^[1me^[mcovery (root/root) ^[1m[Enter]^[m"
34[else]
35	set mainmenu_caption[1]="Boot Multi User [Enter]"
36	set maintoggled_text[1]="Boot [S]ingle User [Enter]"
37	set mainansi_caption[1]="^[1mB^[moot Multi User ^[1m[Enter]^[m"
38	set maintoggled_ansi[1]="Boot ^[1mS^[mingle User ^[1m[Enter]^[m"
39[then]
40set mainmenu_command[1]="boot"
41\ keycode set by init_boot
42
43set mainmenu_init[2]="init_altboot"
44s" smartos" getenv? [if]
45	set mainmenu_caption[2]="[R]ecovery (root/root)"
46	set maintoggled_text[2]="[B]oot SmartOS"
47	set mainansi_caption[2]="^[1mR^[mecovery (root/root)"
48	set maintoggled_ansi[2]="^[1mB^[oot SmartOS"
49[else]
50	set mainmenu_caption[2]="Boot [S]ingle User"
51	set maintoggled_text[2]="Boot [M]ulti User"
52	set mainansi_caption[2]="Boot ^[1mS^[mingle User"
53	set maintoggled_ansi[2]="Boot ^[1mM^[multi User"
54[then]
55set mainmenu_command[2]="altboot"
56\ keycode set by init_altboot
57
58set mainmenu_caption[3]="[Esc]ape to loader prompt"
59set mainmenu_command[3]="goto_prompt"
60set mainmenu_keycode[3]=27
61set mainansi_caption[3]="^[1mEsc^[mape to loader prompt"
62
63\ Enable built-in "Reboot" trailing menuitem
64\ NOTE: appears before menu_options if configured
65\
66set mainmenu_reboot
67
68\ Enable "Options:" separator. When set to a numerical value (1-8), a visual
69\ separator is inserted before that menuitem number.
70\
71set mainmenu_options=5
72
73set mainmenu_caption[5]="Configure Boot [O]ptions..."
74set mainmenu_command[5]="2 goto_menu"
75set mainmenu_keycode[5]=111
76set mainansi_caption[5]="Configure Boot ^[1mO^[mptions..."
77
78\ Boot Environments are (supported) only on ZFS
79s" currdev" getenv drop 4 s" zfs:" compare 0= be-pages and [if]
80set mainmenu_caption[6]="Select Boot [E]nvironment..."
81set mainmenu_command[6]="3 goto_menu"
82set mainmenu_keycode[6]=101
83set mainansi_caption[6]="Select Boot ^[1mE^[mnvironment..."
84
85  s" chain_disk" getenv? [if]
86	set mainmenu_caption[7]="Chain[L]oad ${chain_disk}"
87	set mainmenu_command[7]="chain ${chain_disk}"
88	set mainmenu_keycode[7]=108
89	set mainansi_caption[7]="Chain^[1mL^[moad ${chain_disk}"
90  [then]
91[else]
92  s" chain_disk" getenv? [if]
93	set mainmenu_caption[6]="Chain[L]oad ${chain_disk}"
94	set mainmenu_command[6]="chain ${chain_disk}"
95	set mainmenu_keycode[6]=108
96	set mainansi_caption[6]="Chain^[1mL^[moad ${chain_disk}"
97  [then]
98[then]
99
100\
101\ BOOT OPTIONS MENU
102\
103
104set menuset_name2="options"
105
106set optionsmenu_caption[1]="Back to Main Menu [Backspace]"
107set optionsmenu_command[1]="1 goto_menu"
108set optionsmenu_keycode[1]=8
109set optionsansi_caption[1]="Back to Main Menu ^[1m[Backspace]^[m"
110
111\ set optionsmenu_caption[2]="Load System [D]efaults"
112\ set optionsmenu_command[2]="set_default_boot_options"
113\ set optionsmenu_keycode[2]=100
114\ set optionsansi_caption[2]="Load System ^[1mD^[mefaults"
115
116set optionsmenu_options=2
117set optionsmenu_optionstext="Boot Options:"
118
119set optionsmenu_osconsole=2
120set optionsmenu_command[2]="cycle_osconsole"
121set optionsmenu_keycode[2]=99
122
123set optionsmenu_acpi=3
124set optionsmenu_command[3]="cycle_acpi"
125set optionsmenu_keycode[3]=97
126
127set optionsmenu_init[4]="init_singleuser"
128set optionsmenu_caption[4]="[S]ingle User......... Off"
129set optionstoggled_text[4]="[S]ingle User......... On"
130set optionsmenu_command[4]="toggle_singleuser"
131set optionsmenu_keycode[4]=115
132set optionsansi_caption[4]="^[1mS^[mingle User........... ^[34;1mOff^[m"
133set optionstoggled_ansi[4]="^[1mS^[mingle User........... ^[32;7mOn^[m"
134
135set optionsmenu_init[5]="init_verbose"
136set optionsmenu_caption[5]="[V]erbose............. Off"
137set optionstoggled_text[5]="[V]erbose............. On"
138set optionsmenu_command[5]="toggle_verbose"
139set optionsmenu_keycode[5]=118
140set optionsansi_caption[5]="^[1mV^[merbose............... ^[34;1mOff^[m"
141set optionstoggled_ansi[5]="^[1mV^[merbose............... ^[32;7mOn^[m"
142
143set optionsmenu_init[6]="init_reconfigure"
144set optionsmenu_caption[6]="[R]econfigure......... Off"
145set optionstoggled_text[6]="[R]econfigure......... On"
146set optionsmenu_command[6]="toggle_reconfigure"
147set optionsmenu_keycode[6]=114
148set optionsansi_caption[6]="^[1mR^[meconfigure........... ^[34;1mOff^[m"
149set optionstoggled_ansi[6]="^[1mR^[meconfigure........... ^[32;7mOn^[m"
150
151set optionsmenu_kmdb=7
152set optionsmenu_command[7]="cycle_kmdb"
153set optionsmenu_keycode[7]=107
154
155\
156\ In EFI mode the framebuffer cannot be disabled. Although "framebuffer off"
157\ does switch to a simple text protocol, it doesn't affect the kernel which
158\ still ends up with a framebuffer console. This option is therefore only
159\ exposed in a non-EFI environment.
160\
161efi? invert [if]
162  set optionsmenu_init[8]="init_framebuffer"
163  set optionsmenu_caption[8]="[G]raphical Console... Off"
164  set optionstoggled_text[8]="[G]raphical Console... On"
165  set optionsmenu_command[8]="toggle_framebuffer"
166  set optionsmenu_keycode[8]=103
167  set optionsansi_caption[8]="^[1mG^[mraphical Console..... ^[34;1mOff^[m"
168  set optionstoggled_ansi[8]="^[1mG^[mraphical Console..... ^[32;7mOn^[m"
169[then]
170
171\
172\ BOOT ENVIRONMENT MENU
173\
174
175\ the BE list is read from [pool]/boot/menu.lst, the list in file
176\ is ordered from oldest to most recent.
177\ the BE menu will list entries from most recent to oldest,
178\ so the first page in menu is last page in menu.lst
179
180be-pages [if]
181  set zfs_be_currpage=1
182  be-set-page			\ set page data
183  set menuset_name3="bootenv"
184
185  set bootenvmenu_command[1]="be_draw_screen 1 goto_menu"
186  set bootenvmenu_keycode[1]=8
187
188  set bootenvmenu_keycode[2]=8
189  set bootenvmenu_command[2]="be_draw_screen 1 goto_menu"
190
191  set bemenu_current="Active: "
192  set beansi_current="^[1m${bemenu_current}^[m"
193  set bemenu_bootfs="bootfs: "
194  set beansi_bootfs="^[1m${bemenu_bootfs}^[m"
195  set bemenu_page="[P]age: "
196  set beansi_page="^[1mP^[mage: "
197  set bemenu_pageof=" of "
198  set beansi_pageof="${bemenu_pageof}"
199
200  set bootenvmenu_init="init_bootenv"
201
202  set bootenvmenu_keycode[3]=112
203  set bootenvmenu_command[3]="set_be_page"
204
205  set bootenvmenu_options=4
206  set bootenvmenu_optionstext="Boot Environments:"
207[then]
208
209\ Enable automatic booting (add ``autoboot_delay=N'' to loader.conf(5) to
210\ customize the timeout; default is 10-seconds)
211\
212set menu_timeout_command="boot"
213
214\ Include optional elements defined in a local file
215\
216try-include /boot/menu.rc.local
217
218\ Display the main menu (see `menu.4th')
219set menuset_initial=1
220menuset-loadinitial
221menu-display
222