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