diff options
| author | Jerry Jelinek <jerry.jelinek@joyent.com> | 2017-04-18 11:54:37 +0000 |
|---|---|---|
| committer | Jerry Jelinek <jerry.jelinek@joyent.com> | 2017-04-18 11:54:37 +0000 |
| commit | 6701ee58a1aedc2c43d49e498f54aebcb05337fb (patch) | |
| tree | 36edd7ce2023b7f99709aac0e125ee6ea3330e51 | |
| parent | bcfaedcea7135042c64d088b29fe5248ca14aa45 (diff) | |
| parent | 2aa3758198f9de45e699e6e7426920958f9ecf8f (diff) | |
| download | illumos-joyent-6701ee58a1aedc2c43d49e498f54aebcb05337fb.tar.gz | |
[illumos-gate merge]
commit 2aa3758198f9de45e699e6e7426920958f9ecf8f
8050 loader: menu.rc small typos in menu
8051 loader: switching BE should unset the previously set env
| -rw-r--r-- | usr/src/boot/sys/boot/forth/beadm.4th | 16 | ||||
| -rw-r--r-- | usr/src/boot/sys/boot/forth/menu-commands.4th | 81 | ||||
| -rw-r--r-- | usr/src/boot/sys/boot/forth/menu.rc | 22 |
3 files changed, 67 insertions, 52 deletions
diff --git a/usr/src/boot/sys/boot/forth/beadm.4th b/usr/src/boot/sys/boot/forth/beadm.4th index cafa7bf69e..6ed81e8913 100644 --- a/usr/src/boot/sys/boot/forth/beadm.4th +++ b/usr/src/boot/sys/boot/forth/beadm.4th @@ -197,13 +197,13 @@ variable page_remainder else dup 16 + allocate if ENOMEM throw then swap 2dup 2>R \ copy of new addr len to return stack - move 2R> \ copy dev name and concat file name + move 2R> \ copy dev name and concat file name s" :/boot/menu.lst" strcat 2dup \ leave copy to stack beadm_bootfs if ( dev_addr dev_len addr len ) 2swap \ addr len dev_addr dev_len drop free-memory - \ have dataset and need to get zfs:pool/ROOT/be: + \ have dataset and need to get zfs:pool/ROOT/be: dup 5 + allocate if ENOMEM throw then 0 s" zfs:" strcat 2swap strcat @@ -219,7 +219,15 @@ variable page_remainder \ need to do: 0 unload drop free-module-options - \ unset kernel env? + \ unset the env variables with kernel arguments + s" acpi-user-options" unsetenv + s" boot-args" unsetenv + s" boot_ask" unsetenv + s" boot_single" unsetenv + s" boot_verbose" unsetenv + s" boot_kmdb" unsetenv + s" boot_debug" unsetenv + s" boot_reconfigure" unsetenv start \ load config, kernel and modules ." Current boot device: " s" currdev" getenv type cr ; @@ -381,7 +389,7 @@ builtin: beadm n 1+ to n else \ Use reverse loop to display descending order - \ for BE list. + \ for BE list. 0 count 1- do read_line \ read title line get_name_value diff --git a/usr/src/boot/sys/boot/forth/menu-commands.4th b/usr/src/boot/sys/boot/forth/menu-commands.4th index ae544b0c7c..4460ccaf59 100644 --- a/usr/src/boot/sys/boot/forth/menu-commands.4th +++ b/usr/src/boot/sys/boot/forth/menu-commands.4th @@ -1,6 +1,6 @@ \ Copyright (c) 2006-2015 Devin Teske <dteske@FreeBSD.org> \ All rights reserved. -\ +\ \ Redistribution and use in source and binary forms, with or without \ modification, are permitted provided that the following conditions \ are met: @@ -9,7 +9,7 @@ \ 2. Redistributions in binary form must reproduce the above copyright \ notice, this list of conditions and the following disclaimer in the \ documentation and/or other materials provided with the distribution. -\ +\ \ THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND \ ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE \ IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE @@ -21,7 +21,7 @@ \ LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY \ OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF \ SUCH DAMAGE. -\ +\ \ Copyright 2015 Toomas Soome <tsoome@me.com> marker task-menu-commands.4th @@ -45,9 +45,9 @@ variable debug_state also menu-namespace also menu-command-helpers -\ +\ \ Boot -\ +\ : init_boot ( N -- N ) dup @@ -66,9 +66,9 @@ also menu-namespace also menu-command-helpers evaluate ; -\ +\ \ Alternate Boot -\ +\ : init_altboot ( N -- N ) dup @@ -105,9 +105,9 @@ also menu-namespace also menu-command-helpers 0 boot ( state -- ) ; -\ +\ \ Single User Mode -\ +\ : singleuser_enabled? ( -- flag ) s" boot_single" getenv -1 <> dup if @@ -144,9 +144,9 @@ also menu-namespace also menu-command-helpers TRUE \ loop menu again ; -\ +\ \ Verbose Boot -\ +\ : verbose_enabled? ( -- flag ) s" boot_verbose" getenv -1 <> dup if @@ -183,9 +183,9 @@ also menu-namespace also menu-command-helpers TRUE \ loop menu again ; -\ +\ \ kmdb -\ +\ : kmdb_enabled? ( -- flag ) s" boot_kmdb" getenv -1 <> dup if @@ -231,9 +231,9 @@ also menu-namespace also menu-command-helpers TRUE \ loop menu again ; -\ +\ \ kmdb + debug -\ +\ : debug_disable ( -- ) s" boot_debug" unsetenv @@ -278,9 +278,9 @@ also menu-namespace also menu-command-helpers TRUE \ loop menu again ; -\ +\ \ Reconfiguration boot -\ +\ : reconfigure_enabled? ( -- flag ) s" boot_reconfigure" getenv -1 <> dup if @@ -317,9 +317,9 @@ also menu-namespace also menu-command-helpers TRUE \ loop menu again ; -\ +\ \ Escape to Prompt -\ +\ : goto_prompt ( N -- N FALSE ) @@ -333,9 +333,9 @@ also menu-namespace also menu-command-helpers FALSE \ exit the menu ; -\ +\ \ Cyclestate (used by osconsole/acpi/kernel/root below) -\ +\ : init_cyclestate ( N K -- N ) over cycle_stateN ( n k -- n k addr ) @@ -350,12 +350,12 @@ also menu-namespace also menu-command-helpers 2drop ( n k addr -- n ) ; -\ +\ \ OS Console \ getenv os_console, if not set getenv console, if not set, default to "text" \ allowed serial consoles: ttya .. ttyd \ if new console will be added (graphics?), this section needs to be updated -\ +\ : init_osconsole ( N -- N ) s" os_console" getenv dup -1 = if drop @@ -402,9 +402,9 @@ also menu-namespace also menu-command-helpers TRUE \ loop menu again ; -\ +\ \ ACPI -\ +\ : init_acpi ( N -- N ) s" acpi-user-options" getenv dup -1 <> if evaluate \ use ?number parse step @@ -450,7 +450,7 @@ also menu-namespace also menu-command-helpers \ \ Kernel -\ +\ : init_kernel ( N -- N ) kernel_state @ ( n -- n k ) @@ -474,9 +474,9 @@ also menu-namespace also menu-command-helpers TRUE \ loop menu again ; -\ +\ \ Root -\ +\ : init_root ( N -- N ) root_state @ ( n -- n k ) @@ -500,9 +500,9 @@ also menu-namespace also menu-command-helpers TRUE \ loop menu again ; -\ +\ \ Menusets -\ +\ : goto_menu ( N M -- N TRUE ) menu-unset @@ -511,23 +511,29 @@ also menu-namespace also menu-command-helpers TRUE \ Loop menu again ; -\ +\ \ Defaults -\ +\ -: set_default_boot_options ( N -- N TRUE ) +: unset_boot_options 0 acpi_state ! s" acpi-user-options" unsetenv + s" boot-args" unsetenv + s" boot_ask" unsetenv singleuser_disable verbose_disable kmdb_disable \ disables debug as well reconfigure_disable +; + +: set_default_boot_options ( N -- N TRUE ) + unset_boot_options 2 goto_menu ; -\ +\ \ Set boot environment defaults -\ +\ : init_bootenv ( -- ) @@ -541,7 +547,7 @@ also menu-namespace also menu-command-helpers \ \ Redraw the entire screen. A long BE name can corrupt the menu -\ +\ : be_draw_screen clear \ Clear the screen (in screen.4th) @@ -553,7 +559,7 @@ also menu-namespace also menu-command-helpers \ \ Select a boot environment -\ +\ : set_bootenv ( N -- N TRUE ) dup s" bootenv_root[E]" 13 +c! getenv @@ -567,6 +573,7 @@ also menu-namespace also menu-command-helpers ." Activating " s" currdev" getenv type cr s" unload" evaluate free-module-options + unset_boot_options s" /boot/defaults/loader.conf" read-conf s" /boot/loader.conf" read-conf s" /boot/loader.conf.local" read-conf diff --git a/usr/src/boot/sys/boot/forth/menu.rc b/usr/src/boot/sys/boot/forth/menu.rc index b08d6bae54..7126095dbe 100644 --- a/usr/src/boot/sys/boot/forth/menu.rc +++ b/usr/src/boot/sys/boot/forth/menu.rc @@ -18,9 +18,9 @@ menu-init \ initialize the menu area (see `menu.4th') \ NOTE: To use `non-ansi' variants, add `loader_color=0' to loader.conf(5) \ NOTE: ANSI variants can use `^' in place of literal `Esc' (ASCII 27) -\ +\ \ MAIN MENU -\ +\ set menuset_name1="main" @@ -62,12 +62,12 @@ set mainansi_caption[3]="^[1mEsc^[mape to loader prompt" \ Enable built-in "Reboot" trailing menuitem \ NOTE: appears before menu_options if configured -\ +\ set mainmenu_reboot \ Enable "Options:" separator. When set to a numerical value (1-8), a visual \ separator is inserted before that menuitem number. -\ +\ set mainmenu_options=5 \ illumos does not have multiple kernels @@ -102,9 +102,9 @@ set mainansi_caption[6]="Select Boot ^[1mE^[mnvironment..." [then] [then] -\ +\ \ BOOT OPTIONS MENU -\ +\ set menuset_name2="options" @@ -138,7 +138,7 @@ set optionsansi_caption[4]="^[1mS^[mingle User. ^[34;1mOff^[m" set optionstoggled_ansi[4]="^[1mS^[mingle User. ^[32;7mOn^[m" set optionsmenu_init[5]="init_verbose" -set optionsmenu_caption[5]="[V]erbose..... off" +set optionsmenu_caption[5]="[V]erbose..... Off" set optionstoggled_text[5]="[V]erbose..... On" set optionsmenu_command[5]="toggle_verbose" set optionsmenu_keycode[5]=118 @@ -154,8 +154,8 @@ set optionsansi_caption[6]="^[1mR^[meconfigure. ^[34;1mOff^[m" set optionstoggled_ansi[6]="^[1mR^[meconfigure. ^[32;7mOn^[m" set optionsmenu_init[7]="init_kmdb" -set optionsmenu_caption[7]="k[M]db........ Off" -set optionstoggled_text[7]="k[M]db........ On" +set optionsmenu_caption[7]="k[m]db........ Off" +set optionstoggled_text[7]="k[m]db........ On" set optionsmenu_command[7]="toggle_kmdb" set optionsmenu_keycode[7]=109 set optionsansi_caption[7]="k^[1mm^[mdb........ ^[34;1mOff^[m" @@ -209,11 +209,11 @@ s" currdev" getenv drop 4 s" zfs:" compare 0= be-pages and [if] \ Enable automatic booting (add ``autoboot_delay=N'' to loader.conf(5) to \ customize the timeout; default is 10-seconds) -\ +\ set menu_timeout_command="boot" \ Include optional elements defined in a local file -\ +\ try-include /boot/menu.rc.local \ Display the main menu (see `menu.4th') |
