]> git.ipfire.org Git - people/pmueller/ipfire-2.x.git/blame - src/install+setup/install/probehw.sh
dhcpcd.exe geschrieben.
[people/pmueller/ipfire-2.x.git] / src / install+setup / install / probehw.sh
CommitLineData
72d80898
MT
1#!/bin/sh
2
ee78a5ef
MT
3echo "Detecting Hardware..."
4for MODULE in $(kudzu -qps -t 30 | grep driver: | cut -d ' ' -f 2 | sort | uniq); do
72d80898
MT
5 if [ "${MODULE}" = "unknown" ] || \
6 [ "${MODULE}" = "ignore" ]; then
7 continue
8 fi
bba7212c
MT
9 MODULE=$(basename $(find /lib/modules -name $(echo $MODULE | sed -e 's/[_-]/*/g')* ) | cut -d. -f1 | head -1)
10
72d80898
MT
11 if grep -Eqe "^${MODULE} " /proc/modules; then
12 continue
13 fi
ee78a5ef
MT
14 echo -n "Loading ${MODULE}"
15 modprobe ${MODULE} >/dev/null 2>&1
16 echo " --> ecode: $?"
72d80898
MT
17done
18
51f3b7f5
MT
19sleep 10
20
ee78a5ef
MT
21if [ $# -eq 0 ]; then
22 exit 0
23fi
24
25## If the autodetection fails we will try to load every module...
26## Do this only when we want...
27
28for i in a b c d e f g; do
29 if [ ! -e /dev/sd$i ]; then
30 DEVICE="/dev/sd$i"
31 echo "Checking for: $DEVICE"
32 break
33 fi
34done
35
36for MODULE in $(ls /lib/modules/*/kernel/drivers/scsi); do
37 MODULE=`basename $MODULE | awk -F. '{ print $1 }'`
38
39 echo -n "Probing for $MODULE"
40 modprobe $MODULE >/dev/null 2>&1
41 RETVAL=$?
42 echo " --> ecode: $RETVAL"
43 if [ "$RETVAL" -eq "0" ]; then
44 sleep 3
45 if [ -e "$DEVICE" ]; then
46 break
47 fi
48 fi
49
50done
51
52sleep 5
53
72d80898 54exit 0