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