/etc/rc.subr: add support for kld sysctl variables
For kernel modules loaded by scripts in /etc/rc.d and /usr/local/etc/rc.d, if there is a file in /etc/sysctl.conf.d named <kld name>.conf, then this will be loaded using the sysctl(8) utility. For instance, sysctl variable changes for the pf kernel module would be placed in the file /etc/sysctl.conf.d/pf.conf. PR: 272129 Reviewed by: imp freebsd_igalic.co MFC after: 2 weeks Differential Revision: https://reviews.freebsd.org/D40886
This commit is contained in:
@@ -1970,6 +1970,9 @@ load_kld()
|
||||
return 1
|
||||
else
|
||||
info "$1 kernel module loaded."
|
||||
if [ -f "/etc/sysctl.conf.d/$1.conf" ]; then
|
||||
sysctl -f "/etc/sysctl.conf.d/$1.conf"
|
||||
fi
|
||||
fi
|
||||
else
|
||||
debug "load_kld: $1 kernel module already loaded."
|
||||
|
||||
Reference in New Issue
Block a user