From owner-svn-src-head@FreeBSD.ORG Sun Jan 8 20:35:54 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 30CA21065670; Sun, 8 Jan 2012 20:35:54 +0000 (UTC) (envelope-from pluknet@gmail.com) Received: from mail-tul01m020-f182.google.com (mail-tul01m020-f182.google.com [209.85.214.182]) by mx1.freebsd.org (Postfix) with ESMTP id CBBB98FC0C; Sun, 8 Jan 2012 20:35:53 +0000 (UTC) Received: by obbwd18 with SMTP id wd18so4777601obb.13 for ; Sun, 08 Jan 2012 12:35:53 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=mime-version:sender:in-reply-to:references:date :x-google-sender-auth:message-id:subject:from:to:cc:content-type :content-transfer-encoding; bh=UgH8tlPkSeU2MXA1zAzRsFQ6+euBUu1QKBmFGf1Wi+Y=; b=WtT7NEcQIafvG3k+LFBWylY1wXTQ0rzTjtOreB2kBAkI9nG2xRlYxBhLk/5aVLSA9m A1mEjWpHJRM2fz+cff3OryCwialqVC+aJEJiOOutNrDL6zXSllozpvj3w7CNrFUN28Xp WAnN9KYTfDAXQ7PGX+NUTVRcN4PE13O2ztL9A= MIME-Version: 1.0 Received: by 10.182.117.97 with SMTP id kd1mr12128675obb.50.1326054953162; Sun, 08 Jan 2012 12:35:53 -0800 (PST) Sender: pluknet@gmail.com Received: by 10.182.171.67 with HTTP; Sun, 8 Jan 2012 12:35:53 -0800 (PST) In-Reply-To: <4F08A518.8090207@FreeBSD.org> References: <201112300624.pBU6OxO9098906@svn.freebsd.org> <4F08A518.8090207@FreeBSD.org> Date: Sun, 8 Jan 2012 23:35:53 +0300 X-Google-Sender-Auth: DmKntepnk0xmNnWaWNM6jcEEsX4 Message-ID: From: Sergey Kandaurov To: Dimitry Andric Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, Devin Teske Subject: Re: svn commit: r228985 - head/sys/boot/forth X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 08 Jan 2012 20:35:54 -0000 On 8 January 2012 00:03, Dimitry Andric wrote: > On 2011-12-30 07:24, Sergey Kandaurov wrote: >> >> Author: pluknet >> Date: Fri Dec 30 06:24:59 2011 >> New Revision: 228985 >> URL: http://svn.freebsd.org/changeset/base/228985 >> >> Log: >> =A0 Unset the environment variables associated with individual menu item= s >> =A0 before invoking the kernel. > > > When I did a single-user mode boot to install a new world, I saw the > following warning on the (serial) console during boot: > > =A0/boot.config: -D -S115200 > =A0Consoles: internal video/keyboard =A0serial port > =A0BIOS drive A: is disk0 > =A0BIOS drive C: is disk1 > =A0BIOS 638kB/3143616kB available memory > > =A0FreeBSD/x86 bootstrap loader, Revision 1.1 > =A0(dim@vm-freebsd10-amd64.home.andric.com, Sat Jan =A07 01:05:07 CET 201= 2) > =A0Loading /boot/defaults/loader.conf > =A0/boot/kernel/kernel data=3D0xb73530 data=3D0x11dbe0+0x2b4db8 > syms=3D[0x8+0xfd620+0x8+0xec6b6] > =A0- > =A0Hit [Enter] to boot immediately, or any other key for command prompt. > > > =A0Type '?' for a list of commands, 'help' for more detailed help. > =A0OK boot -s > =A0menu-unset not found =A0 =A0 =A0 =A0 =A0 <<-- what's this? > =A0GDB: no debug ports present > =A0KDB: debugger backends: ddb > =A0KDB: current backend: ddb > =A0[...kernel boots...] > > E.g, it always gives a 'menu-unset not found' warning (or maybe it's an > error, it's not clear). =A0This was not the case before r228985. > > I have almost no knowledge about forth, but it looks like this might be > caused by the new try-menu-unset subroutine. > > My loader.conf is just this: > > =A0beastie_disable=3D"YES" > =A0comconsole_speed=3D"115200" > =A0console=3D"comconsole vidconsole" > =A0kern.hz=3D"100" So, the problem arise when beastie_disable is set. In this case menu.rc is not evaluated and consequently menu-unset does not have a body yet. This results in the ficl warning "not found" when try-menu-unset calls menu-unset. The warning cannot be handled with catch as seen with the code in head. Otherwise, when beastie is enabled, all works as it should. To "fix" the problem I replaced 'catch' with 'sfind', so that we can conditionally call menu-unset only when the definition is present. Please try the following patch. I tested it with enabled/disabled beastie and loader_color over serial console. I would also like to get a review from Devin Teske to see if this change is acceptable. %%% Index: sys/boot/forth/loader.4th =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- sys/boot/forth/loader.4th (revision 229670) +++ sys/boot/forth/loader.4th (working copy) @@ -45,8 +45,10 @@ : try-menu-unset s" menu-unset" - ['] evaluate catch if - 2drop + sfind if + execute + else + drop then ; %%% [ It could be simplified with one-liner: s" menu-unset" sfind drop execute but ficl doesn't like this in a freestanding environment.] --=20 wbr, pluknet