From owner-svn-src-all@FreeBSD.ORG Mon Jan 16 14:55:42 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 8D61E106566C; Mon, 16 Jan 2012 14:55:42 +0000 (UTC) (envelope-from pluknet@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 79A9C8FC08; Mon, 16 Jan 2012 14:55:42 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q0GEtg1s039030; Mon, 16 Jan 2012 14:55:42 GMT (envelope-from pluknet@svn.freebsd.org) Received: (from pluknet@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q0GEtg44039026; Mon, 16 Jan 2012 14:55:42 GMT (envelope-from pluknet@svn.freebsd.org) Message-Id: <201201161455.q0GEtg44039026@svn.freebsd.org> From: Sergey Kandaurov Date: Mon, 16 Jan 2012 14:55:42 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r230219 - stable/9/sys/boot/forth X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 16 Jan 2012 14:55:42 -0000 Author: pluknet Date: Mon Jan 16 14:55:42 2012 New Revision: 230219 URL: http://svn.freebsd.org/changeset/base/230219 Log: MFC r228985,229881: Unset the environment variables associated with individual menu items before invoking the kernel. Get rid of a spurious warning on the console when booting the kernel from the interactive loader(8) prompt and beastie_disable="YES" is set in loader.conf(5). Submitted by: Devin Teske Modified: stable/9/sys/boot/forth/loader.4th stable/9/sys/boot/forth/menu.4th stable/9/sys/boot/forth/menu.4th.8 Directory Properties: stable/9/sys/ (props changed) stable/9/sys/amd64/include/xen/ (props changed) stable/9/sys/boot/ (props changed) stable/9/sys/boot/i386/efi/ (props changed) stable/9/sys/boot/ia64/efi/ (props changed) stable/9/sys/boot/ia64/ski/ (props changed) stable/9/sys/boot/powerpc/boot1.chrp/ (props changed) stable/9/sys/boot/powerpc/ofw/ (props changed) stable/9/sys/cddl/contrib/opensolaris/ (props changed) stable/9/sys/conf/ (props changed) stable/9/sys/contrib/dev/acpica/ (props changed) stable/9/sys/contrib/octeon-sdk/ (props changed) stable/9/sys/contrib/pf/ (props changed) stable/9/sys/contrib/x86emu/ (props changed) Modified: stable/9/sys/boot/forth/loader.4th ============================================================================== --- stable/9/sys/boot/forth/loader.4th Mon Jan 16 14:54:48 2012 (r230218) +++ stable/9/sys/boot/forth/loader.4th Mon Jan 16 14:55:42 2012 (r230219) @@ -41,12 +41,26 @@ s" arch-i386" environment? [if] [if] include /boot/support.4th -\ ***** boot-conf -\ -\ Prepares to boot as specified by loaded configuration files. - only forth also support-functions also builtins definitions +: try-menu-unset + \ menu-unset may not be present + s" beastie_disable" getenv + dup -1 <> if + s" YES" compare-insensitive 0= if + exit + then + else + drop + then + s" menu-unset" + sfind if + execute + else + drop + then +; + : boot 0= if ( interpreted ) get_arguments then @@ -57,24 +71,32 @@ only forth also support-functions also b 0 1 unload drop else s" kernelname" getenv? if ( a kernel has been loaded ) + try-menu-unset 1 boot exit then load_kernel_and_modules ?dup if exit then + try-menu-unset 0 1 boot exit then else s" kernelname" getenv? if ( a kernel has been loaded ) + try-menu-unset 1 boot exit then load_kernel_and_modules ?dup if exit then + try-menu-unset 0 1 boot exit then load_kernel_and_modules ?dup 0= if 0 1 boot then ; +\ ***** boot-conf +\ +\ Prepares to boot as specified by loaded configuration files. + : boot-conf 0= if ( interpreted ) get_arguments then 0 1 unload drop Modified: stable/9/sys/boot/forth/menu.4th ============================================================================== --- stable/9/sys/boot/forth/menu.4th Mon Jan 16 14:54:48 2012 (r230218) +++ stable/9/sys/boot/forth/menu.4th Mon Jan 16 14:55:42 2012 (r230219) @@ -131,11 +131,11 @@ create init_text8 255 allot \ Print the value of menuidx loader_color? if - ." " + ." " (  ) then menuidx @ . loader_color? if - ." " + ." " (  ) then \ Move the cursor forward 1 column @@ -897,22 +897,60 @@ create init_text8 255 allot ; \ This function unsets all the possible environment variables associated with -\ creating the interactive menu. Call this when you want to clear the menu -\ area in preparation for another menu. +\ creating the interactive menu. \ -: menu-clear ( -- ) +: menu-unset ( -- ) 49 \ Iterator start (loop range 49 to 56; ASCII '1' to '8') begin - \ basename for caption variable - loader_color? if - s" ansi_caption[x]" - else - s" menu_caption[x]" - then + \ Unset variables in-order of appearance in menu.4th(8) + + s" menu_caption[x]" \ basename for caption variable -rot 2dup 13 + c! rot \ replace 'x' with current iteration unsetenv \ not erroneous to unset unknown var + s" menu_command[x]" \ command basename + -rot 2dup 13 + c! rot \ replace 'x' + unsetenv + + s" menu_keycode[x]" \ keycode basename + -rot 2dup 13 + c! rot \ replace 'x' + unsetenv + + s" ansi_caption[x]" \ ANSI caption basename + -rot 2dup 13 + c! rot \ replace 'x' + unsetenv + + s" toggled_text[x]" \ toggle_menuitem caption basename + -rot 2dup 13 + c! rot \ replace 'x' + unsetenv + + s" toggled_ansi[x]" \ toggle_menuitem ANSI caption basename + -rot 2dup 13 + c! rot \ replace 'x' + unsetenv + + s" menu_caption[x][y]" \ cycle_menuitem caption + -rot 2dup 13 + c! rot \ replace 'x' + 49 -rot + begin + 16 2over rot + c! \ replace 'y' + 2dup unsetenv + + rot 1+ dup 56 > 2swap rot + until + 2drop drop + + s" ansi_caption[x][y]" \ cycle_menuitem ANSI caption + -rot 2dup 13 + c! rot \ replace 'x' + 49 -rot + begin + 16 2over rot + c! \ replace 'y' + 2dup unsetenv + + rot 1+ dup 56 > 2swap rot + until + 2drop drop + s" 0 menukeyN !" \ basename for key association var -rot 2dup 9 + c! rot \ replace 'N' with current iteration evaluate \ assign zero (0) to key assoc. var @@ -921,6 +959,9 @@ create init_text8 255 allot until drop \ iterator + \ unset the timeout command + s" menu_timeout_command" unsetenv + \ clear the "Reboot" menu option flag s" menu_reboot" unsetenv 0 menureboot ! @@ -933,6 +974,13 @@ create init_text8 255 allot s" menu_options" unsetenv 0 menuoptions ! +; + +\ This function both unsets menu variables and visually erases the menu area +\ in-preparation for another menu. +\ +: menu-clear ( -- ) + menu-unset menu-erase ; Modified: stable/9/sys/boot/forth/menu.4th.8 ============================================================================== --- stable/9/sys/boot/forth/menu.4th.8 Mon Jan 16 14:54:48 2012 (r230218) +++ stable/9/sys/boot/forth/menu.4th.8 Mon Jan 16 14:55:42 2012 (r230219) @@ -24,7 +24,7 @@ .\" .\" $FreeBSD$ .\" -.Dd Aug 29, 2011 +.Dd Dec 27, 2011 .Dt MENU.4TH 8 .Os .Sh NAME @@ -69,9 +69,13 @@ Clears the screen area within the menu b Calls .Ic menu-erase and then redraws the menu. +.It Ic menu-unset +Unsets the environment variables associated with individual menu items, +clearing the way for a new menu. .It Ic menu-clear -Unsets all possible environment variables used -to configure the menu and then calls +Calls +.Ic menu-unset +and then .Ic menu-erase . .El .Pp