aboutsummaryrefslogtreecommitdiffstats
path: root/main/openrc/modules.initd
blob: a9829f4bc5c17dc03fbcf197e498630e7551c53e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
#!/sbin/openrc-run

description="Loads a user defined list of kernel modules."

depend()
{
	before hwclock hwdrivers
	keyword -openvz -prefix -vserver -lxc
}

start() {
	ebegin "Loading modules"
	for f in /etc/modules \
			/etc/modules-load.d/*.conf \
			/run/modules-load.d/*.conf \
			/usr/lib/modules-load.d/*.conf \
			/lib/modules-load.d/*.conf; do
		if ! [ -f "$f" ]; then
			continue
		fi

		sed 's/\#.*//g' < "$f" | while read module args; do
			modprobe -q $module $args
		done
	done
	eend $?
}