From owner-freebsd-current@FreeBSD.ORG Wed Nov 10 16:58:09 2010 Return-Path: Delivered-To: current@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 6F61D106566B for ; Wed, 10 Nov 2010 16:58:09 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from cyrus.watson.org (cyrus.watson.org [65.122.17.42]) by mx1.freebsd.org (Postfix) with ESMTP id 3CCBF8FC13 for ; Wed, 10 Nov 2010 16:58:09 +0000 (UTC) Received: from bigwig.baldwin.cx (66.111.2.69.static.nyinternet.net [66.111.2.69]) by cyrus.watson.org (Postfix) with ESMTPSA id D3A4B46B23; Wed, 10 Nov 2010 11:58:08 -0500 (EST) Received: from jhbbsd.localnet (smtp.hudson-trading.com [209.249.190.9]) by bigwig.baldwin.cx (Postfix) with ESMTPSA id 7EE9C8A009; Wed, 10 Nov 2010 11:58:07 -0500 (EST) From: John Baldwin To: "C. P. Ghost" Date: Wed, 10 Nov 2010 11:58:06 -0500 User-Agent: KMail/1.13.5 (FreeBSD/7.3-CBSD-20100819; KDE/4.4.5; amd64; ; ) References: <201011081714.53637.jhb@freebsd.org> <201011100857.35286.jhb@freebsd.org> In-Reply-To: <201011100857.35286.jhb@freebsd.org> MIME-Version: 1.0 Content-Type: Text/Plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Message-Id: <201011101158.06793.jhb@freebsd.org> X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.2.6 (bigwig.baldwin.cx); Wed, 10 Nov 2010 11:58:07 -0500 (EST) X-Virus-Scanned: clamav-milter 0.96.3 at bigwig.baldwin.cx X-Virus-Status: Clean X-Spam-Status: No, score=-1.9 required=4.2 tests=BAYES_00 autolearn=ham version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on bigwig.baldwin.cx Cc: current@freebsd.org Subject: Re: Only display ACPI bootmenu key if ACPI is present X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 10 Nov 2010 16:58:09 -0000 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 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