summaryrefslogtreecommitdiffstats
path: root/etc/rc
diff options
context:
space:
mode:
Diffstat (limited to 'etc/rc')
-rw-r--r--etc/rc20
1 files changed, 11 insertions, 9 deletions
diff --git a/etc/rc b/etc/rc
index a94d923..ea7d502 100644
--- a/etc/rc
+++ b/etc/rc
@@ -50,12 +50,6 @@ HOME=/
PATH=/sbin:/bin:/usr/sbin:/usr/bin
export HOME PATH
-. /etc/rc.subr
-
-# Note: the system configuration files are loaded as part of
-# the rc.d system (rc.d/rcconf.sh). Do not load them here as it may
-# interfere with diskless booting.
-#
if [ "$1" = autoboot ]; then
autoboot=yes
_boot="faststart"
@@ -70,10 +64,18 @@ if [ ${dlv:=0} -ne 0 -o -f /etc/diskless ]; then
sh /etc/rc.initdiskless
fi
+# Run these after determining whether we are booting diskless in order
+# to minimize the number of files that are needed on a diskless system,
+# and to make the configuration file variables available to rc itself.
+#
+. /etc/rc.subr
+echo "Loading configuration files."
+load_rc_config 'XXX'
+
skip="-s nostart"
[ `/sbin/sysctl -n security.jail.jailed` -eq 1 ] && skip="$skip -s nojail"
-# Do a first pass to get everything up to mountcritremote so that
+# Do a first pass to get everything up to $early_late_divider so that
# we can do a second pass that includes $local_startup directories
#
files=`rcorder ${skip} /etc/rc.d/* 2>/dev/null`
@@ -82,7 +84,7 @@ for _rc_elem in ${files}; do
run_rc_script ${_rc_elem} ${_boot}
case "$_rc_elem" in
- */mountcritremote) break ;;
+ */${early_late_divider}) break ;;
esac
done
@@ -101,7 +103,7 @@ _skip_early=1
for _rc_elem in ${files}; do
case "$_skip_early" in
1) case "$_rc_elem" in
- */mountcritremote) _skip_early=0 ;;
+ */${early_late_divider}) _skip_early=0 ;;
esac
continue
;;
OpenPOWER on IntegriCloud