Re: [PATCH] Fix kenv(1) output in w/respect to new boot loader variables
On 28 December 2011 05:26, Devin Teske devin.te...@fisglobal.com wrote: D'Oh! Attached wrong (OLD; already applied) patch. Please find appropriate patch attached! Hi. I committed your patch to head as svn r228985. Thank you! -Original Message- From: Devin Teske [mailto:devin.te...@fisglobal.com] Sent: Tuesday, December 27, 2011 5:24 PM To: 'freebsd-hackers@freebsd.org' Cc: Garrett Cooper; devin.te...@fisglobal.com Subject: [PATCH] Fix kenv(1) output in w/respect to new boot loader variables 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. Great! -- wbr, pluknet ___ freebsd-hackers@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-hackers To unsubscribe, send any mail to freebsd-hackers-unsubscr...@freebsd.org
[PATCH] Fix kenv(1) output in w/respect to new boot loader variables
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. --- sys/boot/forth/menu.4th.origSat May 28 01:50:38 2011 +++ sys/boot/forth/menu.4th Wed Aug 24 23:46:46 2011 @@ -742,11 +742,10 @@ else -rot 2drop - \ disable timeout if less than zero + \ boot immediately if less than zero dup 0 if drop - 0 menu_timeout_enabled ! - 0 ( assigned to menu_timeout below ) + 0 boot then then then --- sys/boot/forth/menu.4th.8.orig Sat May 28 01:50:38 2011 +++ sys/boot/forth/menu.4th.8 Wed Aug 24 23:45:57 2011 @@ -96,11 +96,15 @@ by default) unless a key is pressed. If set to .Dq Li NO -(case-insensitive) or -.Dq Li -1 , +(case-insensitive) .Ic menu-display will wait for user input and never execute .Ic menu_timeout_command . +If set to +.Dq Li -1 , +.Ic menu-display +will boot immediately, preventing both interruption of the autoboot process and +escaping to the loader prompt. Default is .Dq Li 10 . See ___ freebsd-hackers@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-hackers To unsubscribe, send any mail to freebsd-hackers-unsubscr...@freebsd.org
RE: [PATCH] Fix kenv(1) output in w/respect to new boot loader variables
D'Oh! Attached wrong (OLD; already applied) patch. Please find appropriate patch attached! -Original Message- From: Devin Teske [mailto:devin.te...@fisglobal.com] Sent: Tuesday, December 27, 2011 5:24 PM To: 'freebsd-hackers@freebsd.org' Cc: Garrett Cooper; devin.te...@fisglobal.com Subject: [PATCH] Fix kenv(1) output in w/respect to new boot loader variables 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. --- src/sys/boot/forth/menu.4th.8.orig Tue Dec 27 11:36:25 2011 +++ src/sys/boot/forth/menu.4th.8 Tue Dec 27 11:41:08 2011 @@ -24,7 +24,7 @@ .\ .\ $FreeBSD: src/sys/boot/forth/menu.4th.8,v 1.2 2011/09/02 19:29:37 jh Exp $ .\ -.Dd Aug 29, 2011 +.Dd Dec 27, 2011 .Dt MENU.4TH 8 .Os .Sh NAME @@ -69,9 +69,13 @@ 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 --- src/sys/boot/forth/menu.4th.origFri Dec 2 11:17:45 2011 +++ src/sys/boot/forth/menu.4th Tue Dec 27 17:09:04 2011 @@ -131,11 +131,11 @@ \ Print the value of menuidx loader_color? if - . [1m + . [1m ( [22m ) then menuidx @ . loader_color? if - . [37m + . [37m ( [39m ) then \ Move the cursor forward 1 column @@ -897,22 +897,60 @@ ; \ 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