#!/bin/ash # # "coldplug" ensures every hardware device present has its driver loaded, # even if its hotplug event was ignored since it was too early in system # startup for hotplug processing to work. Loading the driver will cause # another hotplug event that will lead to /dev node creation. # # Run this during system startup shortly after /dev has been initialized # using udevstart. if [ ! -d /sys/devices ] then exit 1 fi # "new style" kernel hotplug has module-init-tools do the thinking cd /sys/devices for DIR in $(find . -type d) do if [ -f $DIR/modalias -a ! -f $DIR/driver ] then modprobe -q $(cat $DIR/modalias) fi done # FIXME will MODULE_ALIAS("name.*") work for "name.3" devices? cd /sys/devices/platform for DEV in * do if [ ! -L $DEV/driver ] then # some platform drivers will need a MODULE_ALIAS() modprobe -q $DEV fi done # REVISIT pcmcia doesn't yet have "modalias" files if [ -d /sys/bus/pcmcia/devices ] then cd /sys/bus/pcmcia/devices for F in * do modprobe -q $(pcmcia-modalias $F) done fi