mirror of
https://github.com/freebsd/freebsd-src
synced 2024-09-06 17:18:32 +00:00
![Simon J. Gerraty](/assets/img/avatar_default.png)
Debugging boot issues can be helped by logging each rc.d script as it is run and being able to selectively enable/disable set -x debug.sh provides an elaborate framework for debugging shell scripts. For secure systems, we want to be paranoid about what we read during boot. dot() simply reads (.) arg file if it exists vdot() if mac_veriexec is active, ignore unverified files otherwise behaves much the same as dot() safe_dot() in safe_eval.sh allows reading an untrusted file; limiting the input to simple variable assignments. In load_rc_config allow caller to provide an option to indicate how to handle its arg: -v use vdot() -s use sdot() which will try to use vdot() and fallback to safe_dot() The default is to read using dot() rc_run_scripts() encapsulate the running of rc.d scripts so that we can easily call it more than twice. We vdot local.rc.subr to pick up extensions (like run_rc_scripts_final) and overrides. We also allow rc.subr.local or rc.conf to set rc_config_xtra eg (rc_config_xtra=XXX for historic compatibility) rc use set -o verify around the reading in of rc.subr This has no effect if mac_veriexec is not active, but if it is; ensures rc.subr has not been tampered with. Reviewed by: imp Sponsored by: Juniper Networks, Inc. Differential Revision: https://reviews.freebsd.org/D43671
33 lines
690 B
Makefile
33 lines
690 B
Makefile
|
|
.include <src.opts.mk>
|
|
|
|
CONFGROUPS= CONFETC CONFETCEXEC CONFETCDEFAULTS
|
|
CONFETCDIR= /etc
|
|
CONFETC= network.subr rc rc.initdiskless rc.subr rc.shutdown rc.bsdextended
|
|
CONFETCPACKAGE= rc
|
|
|
|
.if ${MK_IPFW} != "no"
|
|
CONFETC+= rc.firewall
|
|
.endif
|
|
CONFETCMODE= 644
|
|
CONFETCEXEC= netstart pccard_ether rc.resume rc.suspend
|
|
CONFETCEXECDIR= /etc
|
|
CONFETCEXECMODE= 755
|
|
CONFETCEXECPACKAGE= rc
|
|
CONFETCDEFAULTSDIR= /etc/defaults
|
|
CONFETCDEFAULTS= rc.conf
|
|
CONFETCDEFAULTSPACKAGE= rc
|
|
|
|
FILESGROUPS= LIBEXEC_SCRIPTS
|
|
LIBEXEC_SCRIPTS= debug.sh safe_eval.sh
|
|
LIBEXEC_SCRIPTSDIR= /libexec
|
|
LIBEXEC_SCRIPTSMODE= 755
|
|
LIBEXEC_SCRIPTSPACKAGE= rc
|
|
|
|
SUBDIR+= rc.d
|
|
|
|
HAS_TESTS=
|
|
SUBDIR.${MK_TESTS}+= tests
|
|
|
|
.include <bsd.prog.mk>
|