home *** CD-ROM | disk | FTP | other *** search
- #!/bin/sh
-
- . /etc/init.d/functions
-
- if [ -e /etc/interactiveboot ]; then
- echo "Automatically load ethernet modules?"
- read A
- if [ "x$A" = "xn" -o "x$A" = "xN" ]; then
- exit 0
- fi
- fi
-
- INDEX=`cat /proc/pci |grep "Ethernet controller:" |wc -l`
- ETHERNETS=`cat /proc/pci |grep "Ethernet controller:" |cut -d":" -f2 |tr " " "_"`
- LIST=""
-
- if [ -e /etc/watchboot ]; then
- echo "101000: Press Enter to Continue"
- read A
- fi
-
- for I in $ETHERNETS; do
- logger -p kern.info "Ethernet controller: $I"
-
- case "$I" in
- *[Vv][Ii][Aa]*)
- echo "Adding VIA to probe list"
- LIST="via-rhine $LIST"
- ;;
- *[Ll][Ii][Nn][Kk][Ss][Yy][Ss]*)
- echo "Adding Linksys to probe list"
- LIST="tulip $LIST"
- ;;
-
- *3[Cc]501*)
- echo "Adding 3c501 to probe list"
- LIST="3c501 $LIST"
- ;;
-
- *3[Cc]503*)
- echo "Adding 3c503 to probe list"
- LIST="3c503 $LIST"
- ;;
-
- *3[Cc]505*)
- echo "Adding 3c505 to probe list"
- LIST="3c505 $LIST"
- ;;
-
- *3[Cc]507*)
- echo "Adding 3c507 to probe list"
- LIST="3c507 $LIST"
- ;;
-
- *3[Cc]509*)
- echo "Adding 3c509 to probe list"
- LIST="3c509 $LIST"
- ;;
-
- *3[Cc]515*)
- echo "Adding 3c515 to probe list"
- LIST="3c515 $LIST"
- ;;
-
- *3[Cc]590*|*3[Cc]592*|*3[Cc]595*|*3[Cc]597*)
- echo "Adding 3c59x to probe list"
- LIST="3c59x $LIST"
- ;;
-
- *3[Cc]905*|*3[Cc]900*|*3[Cc]980*|*3[Cc][Ss][Oo][Hh][Oo]100*)
- echo "Adding 3c59x to probe list"
- LIST="3c59x $LIST"
- ;;
-
- *3[Cc]55[56]*|*3[Cc]575*|*3[Cc]450*|*3[Cc]920*|*3[Cc]982*)
- echo "Adding 3c59x to probe list"
- LIST="3c59x $LIST"
- ;;
-
- *3[Cc][Oo][Mm]*)
- echo "Adding 3Com to probe list"
- LIST="3c501 3c503 3c505 3c507 3c509 3c515 3c59x 3c589 3c574 $LIST"
- ;;
-
- *82557*)
- echo "Adding Intel Ethernet Pro 100 to probe list"
- LIST="eepro100 $LIST"
- ;;
-
- *8139*)
- echo "Adding RealTek RTL-8139 to probe list"
- LIST="8139too $LIST"
- ;;
-
- *82596*)
- echo "Adding 82596 to probe list"
- LIST="82596 $LIST"
- ;;
-
- *[Rr][Tt][Ll]8002*)
- echo "Adding Realtek Parallel to probe list"
- LIST="atp $LIST"
- ;;
-
-
- *[Dd][Ll]2000*)
- echo "Adding D-Link DL2000 to probe list"
- LIST="dl2k $LIST"
- ;;
-
-
- *[Nn][Ee]2000*)
- echo "Adding PCI NE2000 to probe list"
- LIST="ne2k-pci ne $LIST"
- ;;
-
- *[Nn][Ee]1000*)
- echo "Adding NE1000/NE2000 ISA/PnP to probe list"
- LIST="ne ne2k-pci $LIST"
- ;;
-
- *[Ww][Dd]80[01]3*)
- echo "Adding SMC Elite to probe list"
- LIST="wd $LIST"
- ;;
-
- *[Ww]89[Cc]840*)
- echo "Adding Winbond W89c840 to probe list"
- LIST="winbond-840 $LIST"
- ;;
-
-
- *[Uu][Ll][Tt][Rr][Aa]*)
- echo "Adding SMC Ultra to probe list"
- LIST="smc-ultra $LIST"
- ;;
-
- *[Pp][Cc][Nn][Ee][Tt]*)
- echo "Adding PCNet 32"
- LIST="pcnet32 $LIST"
- ;;
-
- *[Ss][Ii][Ss]900*)
- echo "Adding SiS900"
- LIST="sis900 $LIST"
- ;;
-
- *)
- continue
- ;;
- esac
- done
- echo "Probing Ethernet modules"
-
- if [ "x$LIST" = "x" ] ; then
- LIST="3c501 3c503 3c505 3c507 3c509 3c515 3c59x via-rhine eepro100 tulip smc9194 smc-ultra wd ne2k-pci 8139too sis900 acenic dl2k e1000 ns83820 3c589 3c574 smc91c92 xirc2ps_cs"
- fi
-
-
- I=0
- for DEVICE in $LIST ; do
- if [ -e /etc/watchboot ]; then
- echo "101050: Press Enter to Continue"
- read A
- fi
-
- echo -n "Probing for $DEVICE..."
- logger -p kern.info "Attempting to load module $DEVICE..."
- modprobe -q -s $DEVICE 2> /dev/null 1>/dev/null
- if [ $? -eq 0 ] ; then
- echo "Found and loading"
- insmod $DEVICE
- logger -p kern.info "Successfully loaded module $DEVICE"
- let I++
- if [ $I -ge $INDEX ]; then break; fi
- else
- logger -p kern.info "Could not load module $DEVICE"
- echo "Not Found"
- fi
- done
-
- #LIST=`ls -1 /lib/modules/2.4.22/kernel/drivers/net | awk -F. '{ print $1 }'`
-