#! /bin/sh #---------------------------------------------------------------------------- # /etc/rc.d/eth - configuration of your ethernet card # # Creation: 15.10.2001 fm # Last Update: $Id$ # # Copyright (c) 2001-2003 Frank Meyer # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2 of the License, or # (at your option) any later version. #---------------------------------------------------------------------------- script='eth:' . /etc/config.d/base if [ "$ETH_DO_DEBUG" = yes ] then set -x fi kernel_version=`uname -r` case $1 in start) /usr/local/bin/colecho "loading ethernet drivers ..." gn idx=1 case "$kernel_version" in 2.2.*) insmod 8390 2>/dev/null insmod pci-scan 2>/dev/null ;; esac while [ "$idx" -le "$ETH_DRV_N" ] do eval drv='$ETH_DRV_'$idx eval opt='$ETH_DRV_'$idx'_OPTION' case $drv in *_cs) echo "$drv should be loaded by pcmcia cardmgr in a few seconds ..." ;; *) case "$kernel_version" in 2.2.*) insmod $drv $opt rtc=$? ;; *) case $drv in rtl8139-orig) drv=8139too;; esac modprobe $drv $opt rtc=$? if [ $rtc != 0 -a "$opt" != "" ] then echo "Loading of $drv failed, trying again without options..." modprobe $drv # some drivers (e.g. ne.o) don't want options anymore rtc=$? fi ;; esac if [ $rtc != 0 ] then echo $script" modul $drv $opt failed!" >>/bootmsg.txt fi ;; esac idx=`/usr/bin/expr $idx + 1` done ;; stop) /usr/local/bin/colecho "unloading ethernet drivers ..." gn idx=1 while [ "$idx" -le "$ETH_DRV_N" ] do eval drv='$ETH_DRV_'$idx case $drv in *_cs) ;; *) case "$kernel_version" in 2.2.*) rmmod $drv ;; *) rmmod -r $drv 2>/dev/null ;; esac ;; esac idx=`/usr/bin/expr $idx + 1` done case "$kernel_version" in 2.2.*) rmmod pci-scan 2>/dev/null rmmod 8390 2>/dev/null ;; esac ;; esac set +x