diff options
author | davidovski <david@davidovski.xyz> | 2022-05-31 11:05:19 +0100 |
---|---|---|
committer | davidovski <david@davidovski.xyz> | 2022-05-31 11:05:19 +0100 |
commit | 48ca75555522716f0f686dcae3dd6cf3d8ad714d (patch) | |
tree | 00c0f58550ba4661e87376f2f02c8001c69bae44 /repo/openrc/hwdrivers.initd | |
parent | 871b2b573f01c1b3176a0f65458b3d281b41c437 (diff) |
removed idea of repos
Diffstat (limited to 'repo/openrc/hwdrivers.initd')
-rw-r--r-- | repo/openrc/hwdrivers.initd | 32 |
1 files changed, 32 insertions, 0 deletions
diff --git a/repo/openrc/hwdrivers.initd b/repo/openrc/hwdrivers.initd new file mode 100644 index 0000000..80184c9 --- /dev/null +++ b/repo/openrc/hwdrivers.initd @@ -0,0 +1,32 @@ +#!/sbin/openrc-run + +depend() { + need sysfs dev + before checkfs fsck + after modloop + keyword -vserver -lxc +} + +# 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 -type f -print0 | xargs -0 sort -u \ + | xargs modprobe -b -a 2> /dev/null + # we run it twice so we detect all devices + find /sys -name modalias -type f -print0 | xargs -0 sort -u \ + | xargs modprobe -b -a 2> /dev/null + + # check if framebuffer drivers got pulled in + if [ -e /dev/fb0 ] && ! [ -e /sys/module/fbcon ]; then + modprobe -b -q fbcon + fi + + eend 0 +} + |