mirror of
https://gitlab.alpinelinux.org/alpine/aports.git
synced 2025-12-28 21:02:25 +01:00
This makes it convenient for scripts to generate module lists to load at boot, for example lm_sensors. (ref #4186) We also get some systemd compatibility: http://www.freedesktop.org/software/systemd/man/modules-load.d.html
29 lines
505 B
Plaintext
29 lines
505 B
Plaintext
#!/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 $?
|
|
}
|
|
|