summaryrefslogtreecommitdiffstats
path: root/init.d/hwdrivers
blob: afb86ea31d685508c7be11dcadd1259fc64dd6c3 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
#!/sbin/runscript

# Load hardware drivers
start() {
	# check for boot option "nocoldplug"
	for i in `cat /proc/cmdline`; do
		case $i in
			modules=*)
				MODULES="$MODULES `echo ${i#modules=} | tr ',' ' '`";;
			noautodetect)
				AUTODETECT=no;;
		esac
	done
	
	if [ "$MODULES" ]; then
		ebegin "Loading boot drivers"
		modprobe -a $MODULES 2> /dev/null
		eend $?
	fi

	if [ "$AUTODETECT" != no ] ; then
		ebegin "Loading hardware drivers"
		# first run we find the controllers 
		# second we find the discs
		find /sys -name modalias | xargs sort -u \
			| xargs modprobe -a  2> /dev/null
		find /sys -name modalias | xargs sort -u \
			| xargs modprobe -a 2> /dev/null
	fi
	eend 0
}