From 0b34e934c5ee509c197b159a51b14e9424f24470 Mon Sep 17 00:00:00 2001 From: Natanael Copa Date: Thu, 14 May 2015 09:11:39 +0000 Subject: 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 --- main/openrc/modules.initd | 21 +++++++++++++-------- 1 file changed, 13 insertions(+), 8 deletions(-) (limited to 'main/openrc/modules.initd') 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 $? } -- cgit v1.2.3