xref: /freebsd/stand/forth/menu.rc (revision 6137b5f7b8c183ee8806d79b3f1d8e5e3ddb3df3)
1\ Menu.rc
2\
3\ You should not edit this file! Put any overrides in menu.rc.local
4\ instead as this file can be replaced during system updates.
5\
6\ Load required Forth modules
7include /boot/version.4th
8include /boot/brand.4th
9include /boot/menu.4th
10include /boot/menu-commands.4th
11include /boot/shortcuts.4th
12
13\ Screen prep
14clear         \ clear the screen (see `screen.4th')
15print_version \ print version string (bottom-right; see `version.4th')
16draw-beastie  \ draw freebsd mascot (on right; see `beastie.4th')
17draw-brand    \ draw the FreeBSD title (top-left; see `brand.4th')
18menu-init     \ initialize the menu area (see `menu.4th')
19
20\ Initialize main menu constructs (see `menu.4th')
21\ NOTE: To use `non-ansi' variants, add `loader_color=0' to loader.conf(5)
22\ NOTE: ANSI variants can use `^' in place of literal `Esc' (ASCII 27)
23
24\
25\ MAIN MENU
26\
27
28set menuset_name1="main"
29
30set mainmenu_init[1]="init_boot"
31set mainmenu_caption[1]="Boot Multi User [Enter]"
32set maintoggled_text[1]="Boot [S]ingle User [Enter]"
33set mainmenu_command[1]="boot"
34set mainansi_caption[1]="^[1mB^[moot Multi User ^[1m[Enter]^[m"
35set maintoggled_ansi[1]="Boot ^[1mS^[mingle User ^[1m[Enter]^[m"
36\ keycode set by init_boot
37
38set mainmenu_init[2]="init_altboot"
39set mainmenu_caption[2]="Boot [S]ingle User"
40set maintoggled_text[2]="Boot [M]ulti User"
41set mainmenu_command[2]="altboot"
42set mainansi_caption[2]="Boot ^[1mS^[mingle User"
43set maintoggled_ansi[2]="Boot ^[1mM^[multi User"
44\ keycode set by init_altboot
45
46set mainmenu_caption[3]="[Esc]ape to loader prompt"
47set mainmenu_command[3]="goto_prompt"
48set mainmenu_keycode[3]=27
49set mainansi_caption[3]="^[1mEsc^[mape to loader prompt"
50
51\ Enable built-in "Reboot" trailing menuitem
52\ NOTE: appears before menu_options if configured
53\
54set mainmenu_reboot
55
56\ Enable "Options:" separator. When set to a numerical value (1-8), a visual
57\ separator is inserted before that menuitem number.
58\
59set mainmenu_options=5
60
61set mainmenu_kernel=5
62set mainmenu_command[5]="cycle_kernel"
63set mainmenu_keycode[5]=107
64
65set mainmenu_caption[6]="Configure Boot [O]ptions..."
66set mainmenu_command[6]="2 goto_menu"
67set mainmenu_keycode[6]=111
68set mainansi_caption[6]="Configure Boot ^[1mO^[mptions..."
69
70s" currdev" getenv dup 0> [if] drop 4 s" zfs:" compare 0= [if]
71    set mainmenu_caption[7]="Select Boot [E]nvironment..."
72    set mainmenu_command[7]="3 goto_menu"
73    set mainmenu_keycode[7]=101
74    set mainansi_caption[7]="Select Boot ^[1mE^[mnvironment..."
75
76    s" chain_disk" getenv? [if]
77	set mainmenu_caption[8]="Chain[L]oad ${chain_disk}"
78	set mainmenu_command[8]="chain ${chain_disk}"
79	set mainmenu_keycode[8]=108
80	set mainansi_caption[8]="Chain^[1mL^[moad ${chain_disk}"
81    [then]
82[else]
83    s" chain_disk" getenv? [if]
84	set mainmenu_caption[7]="Chain[L]oad ${chain_disk}"
85	set mainmenu_command[7]="chain ${chain_disk}"
86	set mainmenu_keycode[7]=108
87	set mainansi_caption[7]="Chain^[1mL^[moad ${chain_disk}"
88    [then]
89[then] [else] drop [then]
90
91
92\
93\ BOOT OPTIONS MENU
94\
95
96set menuset_name2="options"
97
98set optionsmenu_caption[1]="Back to Main Menu [Backspace]"
99set optionsmenu_command[1]="1 goto_menu"
100set optionsmenu_keycode[1]=8
101set optionsansi_caption[1]="Back to Main Menu ^[1m[Backspace]^[m"
102
103set optionsmenu_caption[2]="Load System [D]efaults"
104set optionsmenu_command[2]="set_default_boot_options"
105set optionsmenu_keycode[2]=100
106set optionsansi_caption[2]="Load System ^[1mD^[mefaults"
107
108set optionsmenu_options=3
109set optionsmenu_optionstext="Boot Options:"
110
111set optionsmenu_acpi=3
112set optionsmenu_caption[3]="[A]CPI Support off"
113set optionstoggled_text[3]="[A]CPI Support On"
114set optionsmenu_command[3]="toggle_acpi"
115set optionsmenu_keycode[3]=97
116set optionsansi_caption[3]="^[1mA^[mCPI Support ^[34;1mOff^[m"
117set optionstoggled_ansi[3]="^[1mA^[mCPI Support ^[32;7mOn^[m"
118
119set optionsmenu_init[4]="init_safemode"
120set optionsmenu_caption[4]="Safe [M]ode... off"
121set optionstoggled_text[4]="Safe [M]ode... On"
122set optionsmenu_command[4]="toggle_safemode"
123set optionsmenu_keycode[4]=109
124set optionsansi_caption[4]="Safe ^[1mM^[mode... ^[34;1mOff^[m"
125set optionstoggled_ansi[4]="Safe ^[1mM^[mode... ^[32;7mOn^[m"
126
127set optionsmenu_init[5]="init_singleuser"
128set optionsmenu_caption[5]="[S]ingle User. off"
129set optionstoggled_text[5]="[S]ingle User. On"
130set optionsmenu_command[5]="toggle_singleuser"
131set optionsmenu_keycode[5]=115
132set optionsansi_caption[5]="^[1mS^[mingle User. ^[34;1mOff^[m"
133set optionstoggled_ansi[5]="^[1mS^[mingle User. ^[32;7mOn^[m"
134
135set optionsmenu_init[6]="init_verbose"
136set optionsmenu_caption[6]="[V]erbose..... off"
137set optionstoggled_text[6]="[V]erbose..... On"
138set optionsmenu_command[6]="toggle_verbose"
139set optionsmenu_keycode[6]=118
140set optionsansi_caption[6]="^[1mV^[merbose..... ^[34;1mOff^[m"
141set optionstoggled_ansi[6]="^[1mV^[merbose..... ^[32;7mOn^[m"
142
143\
144\ BOOT ENVIRONMENT MENU
145\
146
147set menuset_name3="bootenv"
148
149set bemenu_current="Active: "
150set beansi_current="^[1m${bemenu_current}^[m"
151set bemenu_bootfs="bootfs: "
152set beansi_bootfs="^[1m${bemenu_bootfs}^[m"
153set bemenu_page="[P]age: "
154set beansi_page="^[1mP^[mage: "
155set bemenu_pageof=" of "
156set beansi_pageof="${bemenu_pageof}"
157set zfs_be_currpage=1
158
159set bootenvmenu_init="init_bootenv"
160
161set bootenvmenu_command[1]="be_draw_screen 1 goto_menu"
162set bootenvmenu_keycode[1]=8
163
164set bootenvmenu_command[2]="set_bootenv"
165set bootenvmenu_keycode[2]=97
166set bootenv_root[2]="${zfs_be_active}"
167
168set bootenvmenu_command[3]="set_be_page"
169set bootenvmenu_keycode[3]=112
170
171set bootenvmenu_options=4
172set bootenvmenu_optionstext="Boot Environments:"
173
174\ Enable automatic booting (add ``autoboot_delay=N'' to loader.conf(5) to
175\ customize the timeout; default is 10-seconds)
176\
177set menu_timeout_command="boot"
178
179\ Include optional elements defined in a local file
180\
181try-include /boot/menu.rc.local
182
183\ Initialize boot environment variables
184\
185s" reloadbe" sfind ( xt|0 bool ) [if]
186    s" bootenv_autolist" getenv dup -1 = [if]
187	drop s" execute" evaluate		\ Use evaluate to avoid passing
188						\ reloadbe an optional parameter
189    [else]
190	s" YES" compare-insensitive 0= [if]
191	    s" execute" evaluate
192	[then]
193    [then]
194[else]
195    drop ( xt=0 )
196[then]
197
198\ Display the main menu (see `menu.4th')
199set menuset_initial=1
200menuset-loadinitial
201menu-display
202