From 314ae3dc781d7ae8fc26c276a85b0dc6ab6bc326 Mon Sep 17 00:00:00 2001 From: William Hubbs Date: Sun, 17 Jul 2016 14:53:12 -0500 Subject: modules: add support for FreeBSD This is based on a patch submitted by Joe Maloney . This fixes #91. --- init.d/modules.in | 22 +++++++++++++++++++++- 1 file changed, 21 insertions(+), 1 deletion(-) (limited to 'init.d/modules.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 +} -- cgit v1.2.3