diff options
Diffstat (limited to 'init.d/hwdrivers')
-rwxr-xr-x | init.d/hwdrivers | 48 |
1 files changed, 48 insertions, 0 deletions
diff --git a/init.d/hwdrivers b/init.d/hwdrivers new file mode 100755 index 0000000..de0e34a --- /dev/null +++ b/init.d/hwdrivers @@ -0,0 +1,48 @@ +#!/sbin/runscript + +SEC=`date +%s` + +# echo a . every second +timer_dots() { + local newsec=`date +%s` + if [ "$SEC" != "$newsec" ] ; then + echo -n '.' + SEC=$newsec + fi +} + +# Load hardware drivers +start() { + # check for boot option "nocoldplug" + for i in `cat /proc/cmdline`; do + case $i in + modules=*) + MODULES="`echo ${i#modules=} | tr ',' ' '`";; + noautodetect) + AUTODETECT=no;; + esac + + done + + if [ "$MODULES" ] || [ "$AUTODETECT" != no ] ; then + ebegin "Loading hardware drivers" + else + ebegin "Skipping hardware drivers" + eend + return + fi + + [ "$MODULES" ] && modprobe $MODULES 2> /dev/null + timer_dots + + if [ "$AUTODETECT" != no ] ; then + find /sys -name modalias | while read a ; do + modprobe `cat $a` 2>/dev/null || \ + echo $a >> /tmp/hwdrivers.failed + timer_dots + done + fi + eend 0 +} + + |