diff options
author | William Hubbs <w.d.hubbs@gmail.com> | 2016-07-17 14:53:12 -0500 |
---|---|---|
committer | William Hubbs <w.d.hubbs@gmail.com> | 2016-07-18 17:09:41 -0500 |
commit | 314ae3dc781d7ae8fc26c276a85b0dc6ab6bc326 (patch) | |
tree | cf1f90ed1c5b0cf8d4eae15805c1017d3d0e912c /init.d | |
parent | 695be59083cdf0d2ff9296f2c210e591c51bdf40 (diff) |
modules: add support for FreeBSD
This is based on a patch submitted by
Joe Maloney <pkgdemonteam@gmail.com>.
This fixes #91.
Diffstat (limited to 'init.d')
-rw-r--r-- | init.d/Makefile | 4 | ||||
-rw-r--r-- | init.d/modules.in | 22 |
2 files changed, 23 insertions, 3 deletions
diff --git a/init.d/Makefile b/init.d/Makefile index f2560956..55db3d14 100644 --- a/init.d/Makefile +++ b/init.d/Makefile @@ -15,8 +15,8 @@ MK= ../mk include ${MK}/os.mk # Generic BSD scripts -SRCS-FreeBSD= hostid.in moused.in newsyslog.in pf.in rarpd.in rc-enabled.in \ - rpcbind.in savecore.in syslogd.in +SRCS-FreeBSD= hostid.in modules.in moused.in newsyslog.in pf.in rarpd.in \ + rc-enabled.in rpcbind.in savecore.in syslogd.in # These are FreeBSD specific SRCS-FreeBSD+= adjkerntz.in devd.in dumpon.in encswap.in ipfw.in \ mixer.in nscd.in powerd.in syscons.in diff --git a/init.d/modules.in b/init.d/modules.in index 6ff90d68..7a02c3a5 100644 --- a/init.d/modules.in +++ b/init.d/modules.in @@ -17,7 +17,18 @@ depend() keyword -openvz -prefix -systemd-nspawn -vserver -lxc } -start() +FreeBSD_modules() +{ + local cnt=0 x + for x in $modules; do + ebegin "Loading module $x" + kldload "$x" + eend $? "Failed to load $x" && : $(( cnt += 1 )) + done + einfo "Autoloaded $cnt module(s)" +} + +Linux_modules() { # Should not fail if kernel do not have module # support compiled in ... @@ -68,3 +79,12 @@ start() done einfo "Autoloaded $cnt module(s)" } + +start() +{ + case "$RC_UNAME" in + FreeBSD|Linux) ${RC_UNAME}_modules ;; + *) ;; + esac + return 0 +} |