aboutsummaryrefslogtreecommitdiff
path: root/init.d/modules.in
diff options
context:
space:
mode:
authorWilliam Hubbs <w.d.hubbs@gmail.com>2016-07-17 14:53:12 -0500
committerWilliam Hubbs <w.d.hubbs@gmail.com>2016-07-18 17:09:41 -0500
commit314ae3dc781d7ae8fc26c276a85b0dc6ab6bc326 (patch)
treecf1f90ed1c5b0cf8d4eae15805c1017d3d0e912c /init.d/modules.in
parent695be59083cdf0d2ff9296f2c210e591c51bdf40 (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/modules.in')
-rw-r--r--init.d/modules.in22
1 files changed, 21 insertions, 1 deletions
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
+}