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