This patch changes the Forth code for the Beastie menu to only display the menu option to enable or disable ACPI if the loader detects ACPI. This avoids displaying a menu item prompting to enable ACPI if the BIOS doesn't actually include ACPI. Any objections? --- //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-08 22:14:04.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 @@ -178,8 +182,7 @@ 42 20 2 2 box 13 6 at-xy ." Welcome to FreeBSD!" printmenuitem ." Boot FreeBSD [default]" bootkey ! - s" arch-i386" environment? if - drop + acpipresent? if printmenuitem ." Boot FreeBSD with ACPI " bootacpikey ! acpienabled? if ." disabled" -- 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"
I have no objection. This patch makes sense to me. Kevin _______________________________________________ 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"
Good idea! Maybe we should also import PCBSD's patches to the beastie menu? In PCBSD's beastie menu you can toggle some settings like "safe mode", and "ACPI", so the kernel is not loaded as soon as select an option. See http://trac.pcbsd.org/browser/pcbsd/current/system-overlay/boot/beastie.4th Lars
Lars, not sure if I got your suggestion correctly, this is what I have in my local tree: diff --git a/sys/boot/i386/loader/loader.rc b/sys/boot/i386/loader/loader.rc index 6443f3f..cb2f723 100644 --- a/sys/boot/i386/loader/loader.rc +++ b/sys/boot/i386/loader/loader.rc @@ -5,7 +5,7 @@ include /boot/loader.4th \ Reads and processes loader.conf variables -start +initialize \ Tests for password -- executes autoboot first if a password was defined check-password With this kernel and modules are _not_ loaded before presenting the menu. -- Andriy Gapon _______________________________________________ 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"
That's also an appreciated improvement, but what PCBSD does is that you can toggle several options, so when you select an option, the kernel is not loaded immediately after but you are still in the menu and can select / toggle another option. That way you have a multi-selection, e.g. select safe mode but enable acpi. Maybe we could also add a menu entry to boot without any modules, so loaders.conf gets overridden?
That sounds cool. Like e.g. selecting verbose single-user boot completely from the menu. Good idea. -- Andriy Gapon _______________________________________________ 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"
Wouldn't that be a POLA violation? Some admins may be used to the current menu, and would be scratching head as what went wrong. Maybe it would be better to keep the menu option, but make it non-selectable and print next to it something like "(not available)"? -cpghost. -- Cordula's Web. http://www.cordula.ws/ _______________________________________________ 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"
Yeah... seems like it would be; besides, I'm kind of used to pressing numbers 4 and 6 when I have a boot menu :). Thanks! -Garrett _______________________________________________ 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"
Hmmm, I'll see if I can leave the numbering unchanged but not list the item perhaps. Note that we already have the "alternate" numbering on other platforms so the menu is already inconsistent across FreeBSD platforms. -- 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"
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"
What are the chances the detection fails and one still needs to disable ACPI and can't because it's not showing as a option ? Thanks, David Rhodus _______________________________________________ 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"
If the loader can't detect acpi, the kernel can't either. Scott _______________________________________________ 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"
