Re: Only display ACPI bootmenu key if ACPI is present

Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
From: John Baldwin
Date: Wednesday, November 10, 2010 - 9:58 am

On Wednesday, November 10, 2010 8:57:35 am John Baldwin wrote:

It turned out to be easier to leave a blank line to do this, but this patch
does that.  It leaves the numbers unchanged but simply omits the '2' option
if the system does not support ACPI.

--- //depot/projects/smpng/sys/boot/forth/beastie.4th	2010-11-08 21:53:18.000000000 0000
+++ //depot/user/jhb/ktrace/boot/forth/beastie.4th	2010-11-10 14:50:44.000000000 0000
@@ -140,12 +140,16 @@
 	fbsdbw-logo
 ;
 
-: acpienabled? ( -- flag )
+: acpipresent? ( -- flag )
 	s" hint.acpi.0.rsdp" getenv
 	dup -1 = if
 		drop false exit
 	then
 	2drop
+	true
+;
+
+: acpienabled? ( -- flag )
 	s" hint.acpi.0.disabled" getenv
 	dup -1 <> if
 		s" 0" compare 0<> if
@@ -180,11 +184,18 @@
 	printmenuitem ."  Boot FreeBSD [default]" bootkey !
 	s" arch-i386" environment? if
 		drop
-		printmenuitem ."  Boot FreeBSD with ACPI " bootacpikey !
-		acpienabled? if
-			." disabled"
+		acpipresent? if
+			printmenuitem ."  Boot FreeBSD with ACPI " bootacpikey !
+			acpienabled? if
+				." disabled"
+			else
+				." enabled"
+			then
 		else
-			." enabled"
+			menuidx @
+			1+ dup
+			menuidx !
+			-2 bootacpikey !
 		then
 	else
 		-2 bootacpikey !

-- 
John Baldwin
_______________________________________________
freebsd-current@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-current
To unsubscribe, send any mail to "freebsd-current-unsubscribe@freebsd.org"
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
Only display ACPI bootmenu key if ACPI is present, John Baldwin, (Mon Nov 8, 3:14 pm)
Re: Only display ACPI bootmenu key if ACPI is present, Lars Engels, (Mon Nov 8, 10:26 pm)
Re: Only display ACPI bootmenu key if ACPI is present, Andriy Gapon, (Tue Nov 9, 6:45 am)
Re: Only display ACPI bootmenu key if ACPI is present, Andriy Gapon, (Tue Nov 9, 7:32 am)
Re: Only display ACPI bootmenu key if ACPI is present, Garrett Cooper, (Tue Nov 9, 4:45 pm)
Re: Only display ACPI bootmenu key if ACPI is present, John Baldwin, (Wed Nov 10, 6:57 am)
Re: Only display ACPI bootmenu key if ACPI is present, David Rhodus, (Wed Nov 10, 9:01 am)
Re: Only display ACPI bootmenu key if ACPI is present, John Baldwin, (Wed Nov 10, 9:58 am)