summaryrefslogtreecommitdiff
path: root/system/openrc/modules.initd
diff options
context:
space:
mode:
authorA. Wilcox <AWilcox@Wilcox-Tech.com>2018-02-20 21:20:18 -0600
committerA. Wilcox <AWilcox@Wilcox-Tech.com>2018-02-20 21:20:18 -0600
commit866f81aaa5e438537e6a4b30c1f0fcecc713a1a2 (patch)
tree4bce7ccd2a7603bdf638e250b8e30e54c1dea909 /system/openrc/modules.initd
parent31f3497a1ca9637ff42f3185a5924e0f4e61ab5d (diff)
downloadpackages-866f81aaa5e438537e6a4b30c1f0fcecc713a1a2.tar.gz
packages-866f81aaa5e438537e6a4b30c1f0fcecc713a1a2.tar.bz2
packages-866f81aaa5e438537e6a4b30c1f0fcecc713a1a2.tar.xz
packages-866f81aaa5e438537e6a4b30c1f0fcecc713a1a2.zip
system/openrc: migrate from aports fork
Diffstat (limited to 'system/openrc/modules.initd')
-rw-r--r--system/openrc/modules.initd29
1 files changed, 29 insertions, 0 deletions
diff --git a/system/openrc/modules.initd b/system/openrc/modules.initd
new file mode 100644
index 000000000..d90a3e687
--- /dev/null
+++ b/system/openrc/modules.initd
@@ -0,0 +1,29 @@
+#!/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 -e 's/\#.*//g' -e '/^[[:space:]]*$/d' < "$f" \
+ | while read module args; do
+ modprobe -q $module $args
+ done
+ done
+ eend $?
+}
+