Date: Wed, 10 Nov 2010 11:58:06 -0500 From: John Baldwin <jhb@freebsd.org> To: "C. P. Ghost" <cpghost@cordula.ws> Cc: current@freebsd.org Subject: Re: Only display ACPI bootmenu key if ACPI is present Message-ID: <201011101158.06793.jhb@freebsd.org> In-Reply-To: <201011100857.35286.jhb@freebsd.org> References: <201011081714.53637.jhb@freebsd.org> <AANLkTimDj3uA3fmTYgYfoL%2BU4%2Bu2XCcb86j%2BL7Tg_aV5@mail.gmail.com> <201011100857.35286.jhb@freebsd.org>
next in thread | previous in thread | raw e-mail | index | archive | help
On Wednesday, November 10, 2010 8:57:35 am John Baldwin wrote: > On Tuesday, November 09, 2010 5:58:13 pm C. P. Ghost wrote: > > On Mon, Nov 8, 2010 at 11:14 PM, John Baldwin <jhb@freebsd.org> wrote: > > > 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? > > > > 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)"? > > 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. 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
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201011101158.06793.jhb>