aports/main/openrc/hwdrivers.initd
Natanael Copa 8319a3ab9c main/openrc: init.d script cleanups and fixes for lxc
ref #3699

The following services should not be started on LXC:
- hwdrivers
- keymaps
- modloop
- modules
2015-05-06 08:08:32 +00:00

33 lines
720 B
Plaintext

#!/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 /sys/module/fb ] && ! [ -e /sys/module/fbcon ]; then
modprobe fbcon
fi
eend 0
}