summaryrefslogtreecommitdiffstats
path: root/sys/boot/forth
diff options
context:
space:
mode:
authorpluknet <pluknet@FreeBSD.org>2012-01-09 20:25:14 +0000
committerpluknet <pluknet@FreeBSD.org>2012-01-09 20:25:14 +0000
commitb714ea6bf98a62ea39dda7f963a30ed33c63ee74 (patch)
tree6cb262ca4b1b958d4b7822a9e75aa67b43f78cb6 /sys/boot/forth
parent0577b44f7395fee798c50b2e4f6f24d717dabeb7 (diff)
downloadFreeBSD-src-b714ea6bf98a62ea39dda7f963a30ed33c63ee74.zip
FreeBSD-src-b714ea6bf98a62ea39dda7f963a30ed33c63ee74.tar.gz
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). In this case menu.rc is not evaluated and consequently menu-unset does not have a body yet. This results in the ficl warning "menu-unset not found" when try-menu-unset invokes menu-unset. Check for beastie_disable="YES" explicitly, so that the try-menu-unset word will not attempt to invoke menu-unset because the menu will have never been configured. [1] Use the sfind primitive as a last resort as an additional safer approach conjuring a foreign word safely. [2] PR: kern/163938 Submitted by: Devin Teske [1] Reviewed by: Devin Teske [2] Reported and tested by: dim MFC after: 1 week X-MFC with: r228985
Diffstat (limited to 'sys/boot/forth')
-rw-r--r--sys/boot/forth/loader.4th15
1 files changed, 13 insertions, 2 deletions
diff --git a/sys/boot/forth/loader.4th b/sys/boot/forth/loader.4th
index 1205741..437533a 100644
--- a/sys/boot/forth/loader.4th
+++ b/sys/boot/forth/loader.4th
@@ -44,9 +44,20 @@ include /boot/support.4th
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"
- ['] evaluate catch if
- 2drop
+ sfind if
+ execute
+ else
+ drop
then
;
OpenPOWER on IntegriCloud