aboutsummaryrefslogtreecommitdiffstats
path: root/main/openrc/hwdrivers.initd
diff options
context:
space:
mode:
Diffstat (limited to 'main/openrc/hwdrivers.initd')
-rw-r--r--main/openrc/hwdrivers.initd27
1 files changed, 27 insertions, 0 deletions
diff --git a/main/openrc/hwdrivers.initd b/main/openrc/hwdrivers.initd
new file mode 100644
index 0000000000..3d0ebf12b5
--- /dev/null
+++ b/main/openrc/hwdrivers.initd
@@ -0,0 +1,27 @@
+#!/sbin/runscript
+
+depend() {
+ need sysfs dev
+ before checkfs fsck
+ after modloop
+ keyword novserver
+}
+
+# Load hardware drivers
+start() {
+ # check for boot option "nocoldplug"
+ if get_bootparam noautodetect; then
+ ewarn "Autodetection of hardware disabled from boot cmdline"
+ return 0
+ fi
+
+
+ ebegin "Loading hardware drivers"
+ find /sys -name modalias | xargs sort -u \
+ | xargs modprobe -a 2> /dev/null
+ # we run it twice so we detect all devices
+ find /sys -name modalias | xargs sort -u \
+ | xargs modprobe -a 2> /dev/null
+ eend 0
+}
+