xref: /titanic_51/usr/src/boot/sys/boot/forth/menu.rc (revision ef7ec69c8c5ae9fe6acf9c8a0bad6f4c85597b8b)
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
73\ illumos does not have multiple kernels
74\ set mainmenu_kernel=5
75\ set mainmenu_command[5]="cycle_kernel"
76\ set mainmenu_keycode[5]=107
77
78set mainmenu_caption[5]="Configure Boot [O]ptions..."
79set mainmenu_command[5]="2 goto_menu"
80set mainmenu_keycode[5]=111
81set mainansi_caption[5]="Configure Boot ^[1mO^[mptions..."
82
83\ Boot Environments are (supported) only on ZFS
84s" currdev" getenv drop 4 s" zfs:" compare 0= be-pages and [if]
85set mainmenu_caption[6]="Select Boot [E]nvironment..."
86set mainmenu_command[6]="3 goto_menu"
87set mainmenu_keycode[6]=101
88set mainansi_caption[6]="Select Boot ^[1mE^[mnvironment..."
89
90  s" chain_disk" getenv? [if]
91	set mainmenu_caption[7]="Chain[L]oad ${chain_disk}"
92	set mainmenu_command[7]="chain ${chain_disk}"
93	set mainmenu_keycode[7]=108
94	set mainansi_caption[7]="Chain^[1mL^[moad ${chain_disk}"
95  [then]
96[else]
97  s" chain_disk" getenv? [if]
98	set mainmenu_caption[6]="Chain[L]oad ${chain_disk}"
99	set mainmenu_command[6]="chain ${chain_disk}"
100	set mainmenu_keycode[6]=108
101	set mainansi_caption[6]="Chain^[1mL^[moad ${chain_disk}"
102  [then]
103[then]
104
105\
106\ BOOT OPTIONS MENU
107\
108
109set menuset_name2="options"
110
111set optionsmenu_caption[1]="Back to Main Menu [Backspace]"
112set optionsmenu_command[1]="1 goto_menu"
113set optionsmenu_keycode[1]=8
114set optionsansi_caption[1]="Back to Main Menu ^[1m[Backspace]^[m"
115
116\ set optionsmenu_caption[2]="Load System [D]efaults"
117\ set optionsmenu_command[2]="set_default_boot_options"
118\ set optionsmenu_keycode[2]=100
119\ set optionsansi_caption[2]="Load System ^[1mD^[mefaults"
120
121set optionsmenu_options=2
122set optionsmenu_optionstext="Boot Options:"
123
124set optionsmenu_osconsole=2
125set optionsmenu_command[2]="cycle_osconsole"
126set optionsmenu_keycode[2]=99
127
128set optionsmenu_acpi=3
129set optionsmenu_command[3]="cycle_acpi"
130set optionsmenu_keycode[3]=97
131
132set optionsmenu_init[4]="init_singleuser"
133set optionsmenu_caption[4]="[S]ingle User. Off"
134set optionstoggled_text[4]="[S]ingle User. On"
135set optionsmenu_command[4]="toggle_singleuser"
136set optionsmenu_keycode[4]=115
137set optionsansi_caption[4]="^[1mS^[mingle User. ^[34;1mOff^[m"
138set optionstoggled_ansi[4]="^[1mS^[mingle User. ^[32;7mOn^[m"
139
140set optionsmenu_init[5]="init_verbose"
141set optionsmenu_caption[5]="[V]erbose..... Off"
142set optionstoggled_text[5]="[V]erbose..... On"
143set optionsmenu_command[5]="toggle_verbose"
144set optionsmenu_keycode[5]=118
145set optionsansi_caption[5]="^[1mV^[merbose..... ^[34;1mOff^[m"
146set optionstoggled_ansi[5]="^[1mV^[merbose..... ^[32;7mOn^[m"
147
148set optionsmenu_init[6]="init_reconfigure"
149set optionsmenu_caption[6]="[R]econfigure. Off"
150set optionstoggled_text[6]="[R]econfigure. On"
151set optionsmenu_command[6]="toggle_reconfigure"
152set optionsmenu_keycode[6]=114
153set optionsansi_caption[6]="^[1mR^[meconfigure. ^[34;1mOff^[m"
154set optionstoggled_ansi[6]="^[1mR^[meconfigure. ^[32;7mOn^[m"
155
156set optionsmenu_init[7]="init_kmdb"
157set optionsmenu_caption[7]="k[m]db........ Off"
158set optionstoggled_text[7]="k[m]db........ On"
159set optionsmenu_command[7]="toggle_kmdb"
160set optionsmenu_keycode[7]=109
161set optionsansi_caption[7]="k^[1mm^[mdb........ ^[34;1mOff^[m"
162set optionstoggled_ansi[7]="k^[1mm^[mdb........ ^[32;7mOn^[m"
163
164set optionsmenu_init[8]="init_debug"
165set optionsmenu_caption[8]="[D]ebug....... Off"
166set optionstoggled_text[8]="[D]ebug....... On"
167set optionsmenu_command[8]="toggle_debug"
168set optionsmenu_keycode[8]=100
169set optionsansi_caption[8]="^[1mD^[mebug....... ^[34;1mOff^[m"
170set optionstoggled_ansi[8]="^[1mD^[mebug....... ^[32;7mOn^[m"
171
172\
173\ BOOT ENVIRONMENT MENU
174\
175
176\ the BE list is read from [pool]/boot/menu.lst, the list in file
177\ is ordered from oldest to most recent.
178\ the BE menu will list entries from most recent to oldest,
179\ so the first page in menu is last page in menu.lst
180
181be-pages [if]
182  set zfs_be_currpage=1
183  be-set-page			\ set page data
184  set menuset_name3="bootenv"
185
186  set bootenvmenu_command[1]="be_draw_screen 1 goto_menu"
187  set bootenvmenu_keycode[1]=8
188
189  set bootenvmenu_keycode[2]=8
190  set bootenvmenu_command[2]="be_draw_screen 1 goto_menu"
191
192  set bemenu_current="Active: "
193  set beansi_current="^[1m${bemenu_current}^[m"
194  set bemenu_bootfs="bootfs: "
195  set beansi_bootfs="^[1m${bemenu_bootfs}^[m"
196  set bemenu_page="[P]age: "
197  set beansi_page="^[1mP^[mage: "
198  set bemenu_pageof=" of "
199  set beansi_pageof="${bemenu_pageof}"
200
201  set bootenvmenu_init="init_bootenv"
202
203  set bootenvmenu_keycode[3]=112
204  set bootenvmenu_command[3]="set_be_page"
205
206  set bootenvmenu_options=4
207  set bootenvmenu_optionstext="Boot Environments:"
208[then]
209
210\ Enable automatic booting (add ``autoboot_delay=N'' to loader.conf(5) to
211\ customize the timeout; default is 10-seconds)
212\
213set menu_timeout_command="boot"
214
215\ Include optional elements defined in a local file
216\
217try-include /boot/menu.rc.local
218
219\ Display the main menu (see `menu.4th')
220set menuset_initial=1
221menuset-loadinitial
222menu-display
223