summaryrefslogtreecommitdiffstats
path: root/sys/boot/forth/menu-commands.4th
diff options
context:
space:
mode:
authordteske <dteske@FreeBSD.org>2012-11-28 18:35:46 +0000
committerdteske <dteske@FreeBSD.org>2012-11-28 18:35:46 +0000
commit3583d9188e1bdf9b48287ffbbfaeb94619596914 (patch)
tree70fc3ea6253a339ff007dc6a19666c2240c482f1 /sys/boot/forth/menu-commands.4th
parent793b12af790440c39062948caf6df525c052a04c (diff)
downloadFreeBSD-src-3583d9188e1bdf9b48287ffbbfaeb94619596914.zip
FreeBSD-src-3583d9188e1bdf9b48287ffbbfaeb94619596914.tar.gz
Discussed at-length on -arch.
Make the following interface changes to my beastie boot menu: + Move boot options to a submenu + Add a new "Boot Single" menu item + Make "Boot" item and new "Boot Single" item reverse when boot_single is set + Add new "Load Defaults" item (in new "Boot Options" submenu) for overridding loader.conf(5) provided values with system defaults. Reviewed by: adrian (co-mentor) Approved by: adrian (co-mentor)
Diffstat (limited to 'sys/boot/forth/menu-commands.4th')
-rw-r--r--sys/boot/forth/menu-commands.4th57
1 files changed, 57 insertions, 0 deletions
diff --git a/sys/boot/forth/menu-commands.4th b/sys/boot/forth/menu-commands.4th
index a3ee588..baee0b1 100644
--- a/sys/boot/forth/menu-commands.4th
+++ b/sys/boot/forth/menu-commands.4th
@@ -32,6 +32,51 @@ variable kernel_state
variable root_state
\
+\ Boot
+\
+
+: init_boot ( N -- N )
+ dup
+ s" boot_single" getenv -1 <> if
+ drop ( n n c-addr -- n n ) \ unused
+ toggle_menuitem ( n n -- n n )
+ s" set menu_keycode[N]=115" \ base command to execute
+ else
+ s" set menu_keycode[N]=98" \ base command to execute
+ then
+ 17 +c! \ replace 'N' with ASCII numeral
+ evaluate
+;
+
+\
+\ Alternate Boot
+\
+
+: init_altboot ( N -- N )
+ dup
+ s" boot_single" getenv -1 <> if
+ drop ( n c-addr -- n ) \ unused
+ toggle_menuitem ( n -- n )
+ s" set menu_keycode[N]=109" \ base command to execute
+ else
+ s" set menu_keycode[N]=115" \ base command to execute
+ then
+ 17 +c! \ replace 'N' with ASCII numeral
+ evaluate
+;
+
+: altboot ( -- )
+ s" boot_single" 2dup getenv -1 <> if
+ drop ( c-addr/u c-addr -- c-addr/u ) \ unused
+ unsetenv ( c-addr/u -- )
+ else
+ 2drop ( c-addr/u -- ) \ unused
+ s" set boot_single=YES" evaluate
+ then
+ 0 boot ( state -- )
+;
+
+\
\ ACPI
\
@@ -287,3 +332,15 @@ variable root_state
menu-redraw
TRUE \ Loop menu again
;
+
+\
+\ Defaults
+\
+
+: set_default_boot_options ( N -- N TRUE )
+ acpi_enable
+ safemode_disable
+ singleuser_disable
+ verbose_disable
+ 2 goto_menu
+;
OpenPOWER on IntegriCloud