diff options
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 +} |