/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:
Doug Rabson
2023-06-21 13:26:17 +01:00
parent f53b28c6df
commit 09267cc152
3 changed files with 15 additions and 0 deletions
+3
View File
@@ -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."