From owner-freebsd-hackers@FreeBSD.ORG Wed Dec 28 01:49:41 2011 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 933C2106564A for ; Wed, 28 Dec 2011 01:49:41 +0000 (UTC) (envelope-from Devin.Teske@fisglobal.com) Received: from mx1.fisglobal.com (mx1.fisglobal.com [199.200.24.190]) by mx1.freebsd.org (Postfix) with ESMTP id 5539E8FC0A for ; Wed, 28 Dec 2011 01:49:41 +0000 (UTC) Received: from pps.filterd (ltcfislmsgpa04 [127.0.0.1]) by ltcfislmsgpa04.fnfis.com (8.14.4/8.14.4) with SMTP id pBS1I7i4021773; Tue, 27 Dec 2011 19:23:31 -0600 Received: from smtp.fisglobal.com ([10.132.206.31]) by ltcfislmsgpa04.fnfis.com with ESMTP id 11ynvpgp5c-2 (version=TLSv1/SSLv3 cipher=AES128-SHA bits=128 verify=NOT); Tue, 27 Dec 2011 19:23:31 -0600 Received: from dtwin (10.14.152.15) by smtp.fisglobal.com (10.132.206.31) with Microsoft SMTP Server (TLS) id 14.1.323.3; Tue, 27 Dec 2011 19:23:30 -0600 From: Devin Teske To: Date: Tue, 27 Dec 2011 17:23:35 -0800 Message-ID: <02aa01ccc4ff$52db7380$f8925a80$@fisglobal.com> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="----=_NextPart_000_02AB_01CCC4BC.44B881A0" X-Mailer: Microsoft Outlook 14.0 Thread-Index: AczE/1BMfk5YjHQHRf2ZyhfbAskOxQ== Content-Language: en-us X-Originating-IP: [10.14.152.15] X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10432:5.5.7110, 1.0.211, 0.0.0000 definitions=2011-12-27_08:2011-12-27, 2011-12-27, 1970-01-01 signatures=0 Cc: Garrett Cooper , devin.teske@fisglobal.com Subject: [PATCH] Fix kenv(1) output in w/respect to new boot loader variables X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 28 Dec 2011 01:49:41 -0000 ------=_NextPart_000_02AB_01CCC4BC.44B881A0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Garrett Cooper and a few others have requested that I write a patch to fix a regression w/respect to kenv(1) output in FreeBSD-9.0 and HEAD. The issue is with the new boot loader menu. It adds many loader variables including ones that contain ANSI color escapes. Obviously, these ANSI codes don't play well with serial consoles when kenv(1) is executed without arguments (reports vary as to what happens, but it's never pretty). Attached is a patch to the Forth code that clears-out the menu-associated variables before invoking the kernel. The net-effect is that kenv(1) no longer reports menu-related variables. In essence, kenv(1) output should now appear the same as on RELENG_8 (which lacks the new boot loader and didn't use any such variables). Thus, restoring serial console glory. -- Devin _____________ The information contained in this message is proprietary and/or confidential. If you are not the intended recipient, please: (i) delete the message and all copies; (ii) do not disclose, distribute or use the message in any manner; and (iii) notify the sender immediately. In addition, please be aware that any message addressed to our domain is subject to archiving and review by persons other than the intended recipient. Thank you. ------=_NextPart_000_02AB_01CCC4BC.44B881A0 Content-Type: text/plain; name="loader_menu.20110825000410.patch.txt" Content-Transfer-Encoding: quoted-printable Content-Disposition: attachment; filename="loader_menu.20110825000410.patch.txt" --- sys/boot/forth/menu.4th.orig Sat May 28 01:50:38 2011=0A= +++ sys/boot/forth/menu.4th Wed Aug 24 23:46:46 2011=0A= @@ -742,11 +742,10 @@=0A= else=0A= -rot 2drop=0A= =0A= - \ disable timeout if less than zero=0A= + \ boot immediately if less than zero=0A= dup 0< if=0A= drop=0A= - 0 menu_timeout_enabled !=0A= - 0 ( assigned to menu_timeout below )=0A= + 0 boot=0A= then=0A= then=0A= then=0A= --- sys/boot/forth/menu.4th.8.orig Sat May 28 01:50:38 2011=0A= +++ sys/boot/forth/menu.4th.8 Wed Aug 24 23:45:57 2011=0A= @@ -96,11 +96,15 @@=0A= by default) unless a key is pressed.=0A= If set to=0A= .Dq Li NO=0A= -(case-insensitive) or=0A= -.Dq Li -1 ,=0A= +(case-insensitive)=0A= .Ic menu-display=0A= will wait for user input and never execute=0A= .Ic menu_timeout_command .=0A= +If set to=0A= +.Dq Li -1 ,=0A= +.Ic menu-display=0A= +will boot immediately, preventing both interruption of the autoboot = process and=0A= +escaping to the loader prompt.=0A= Default is=0A= .Dq Li 10 .=0A= See=0A= ------=_NextPart_000_02AB_01CCC4BC.44B881A0--