Move fetch of DEBUG_SH from kenv to rc

We only need to check kenv for DEBUG_SH once.
We also need to export DEBUG_SH to be useful.

Sponsored by:	Juniper Networks, Inc.

Reviewed by:	imp
Differential Revision:	https://reviews.freebsd.org/D46219
This commit is contained in:
Simon J. Gerraty 2024-08-03 10:56:48 -07:00
parent 2b4aa2816c
commit 6502c60c22
2 changed files with 6 additions and 4 deletions

View File

@ -72,6 +72,11 @@ set -o verify
set +o verify
load_rc_config $rc_config_xtra
if have DebugOn; then
# allow DEBUG_SH to be set from loader prompt
export DEBUG_SH=${DEBUG_SH:-$(kenv -q DEBUG_SH)}
fi
# If we receive a SIGALRM, re-source /etc/rc.conf; this allows rc.d
# scripts to perform "boot-time configuration" including enabling and
# disabling rc.d scripts which appear later in the boot order.

View File

@ -2767,10 +2767,7 @@ $_DEBUG_SH vdot /libexec/debug.sh
# Ensure we can still operate if debug.sh and
# safe_eval.sh are not found.
if have DebugOn; then
# allow DEBUG_SH to be set from loader prompt
DEBUG_SH=${DEBUG_SH:-$(kenv -q DEBUG_SH)}
else
if ! have DebugOn; then
DebugOn() { return 0; }
DebugOff() { return 0; }
fi