diff options
author | Natanael Copa <ncopa@alpinelinux.org> | 2015-05-14 09:11:39 +0000 |
---|---|---|
committer | Natanael Copa <ncopa@alpinelinux.org> | 2015-05-15 10:06:35 +0000 |
commit | 0b34e934c5ee509c197b159a51b14e9424f24470 (patch) | |
tree | 3a90b7a53d9a707d8aca27d7c043f11703619cc3 /main/openrc/modules.initd | |
parent | 7f30f8d1f66c09350a7f7d0f821e041e81099917 (diff) | |
download | aports-0b34e934c5ee509c197b159a51b14e9424f24470.tar.bz2 aports-0b34e934c5ee509c197b159a51b14e9424f24470.tar.xz |
main/openrc: add support for /etc/modules-load.d/*.conf
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
Diffstat (limited to 'main/openrc/modules.initd')
-rw-r--r-- | main/openrc/modules.initd | 21 |
1 files changed, 13 insertions, 8 deletions
diff --git a/main/openrc/modules.initd b/main/openrc/modules.initd index 7c85eec9aa..a9829f4bc5 100644 --- a/main/openrc/modules.initd +++ b/main/openrc/modules.initd @@ -8,16 +8,21 @@ depend() keyword -openvz -prefix -vserver -lxc } - start() { - if [ -f /etc/modules ] ; then - ebegin "Loading modules" - sed 's/\#.*//g' < /etc/modules | - while read module args - do + 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 - eend $? - fi + done + eend $? } |