load_drv()
{
# invoke insmod with all arguments we got
# and use a pathname, as newer modutils don't look in . by default
if [ -n "$KERNEL_V26" ]; then
modparas=""
modflag=""
else
modparas="Configuration_Interface=$1 baseAddress=$2 regSpacing=$3 IOMap=$4"
modflag=""
fi
if [ -f /etc/redhat-release ]; then
DISTRO=redhat
DISTROFILE=/etc/redhat-release
elif [ -f /etc/SuSE-release ]; then
DISTRO=suse
DISTROFILE=/etc/SuSE-release
elif [ -f /etc/UnitedLinux-release ]; then
DISTRO=UnitedLinux
DISTROFILE=/etc/UnitedLinux-release
elif [ -f /etc/issue ]; then
if [ "`cat /etc/issue | grep -i "vmware esx"`" != "" ]; then
DISTRO=vmesx
DISTROFILE=/etc/issue
fi
fi
if [ "$DISTRO" == "UnitedLinux" ]; then
DISTRO=suse
fi
if [ "`cat /proc/modules | grep $module`" = "" ]; then
if [ -f $MODPATH/$module.$modsuf ]; then
# for kernels built with 64GB RAM mode, we have to use '-f' to force install
# the driver.
if [ "`uname -r | grep 64GB`" != "" ]; then
if [ "$DISTRO" == "suse" ]; then
# /sbin/insmod $module $modparas &> /dev/null
/sbin/insmod -f $module $modparas
else
/sbin/insmod $module $modparas &> /dev/null
# /sbin/insmod -f $modflag $module $modparas
fi
else
if [ "$DISTRO" == "suse" ]; then
if [ "`uname -r | awk -F'-' '{print $1}'`" = "2.6.5" ]; then
/sbin/modprobe $modflag $module $modparas
elif [ "`uname -r | awk -F'-' '{print $1}'`" = "2.6.13" ]; then
/sbin/modprobe $modflag $module $modparas
elif [ "`uname -r | awk -F'-' '{print $1}'`" = "2.6.16.21" ]; then
/sbin/modprobe $modflag $module $modparas
else
/sbin/insmod -f $modflag $module $modparas
fi
else
if [ "`uname -r | awk -F'-' '{print $1}'`" = "2.4.21" ]; then
/sbin/insmod -f $modflag $module $modparas
else
/sbin/modprobe $modflag $module $modparas
fi
fi
fi
elif [ -f `pwd`/$module.$modsuf ]; then
/sbin/insmod -f $module.$modsuf $modparas
else
echo "ERROR: cannot find $module.$modsuf in $MODPATH and current dir, abort."
return 1
fi
[ $? -ne 0 ] && return 1
else
echo "$module.$modsuf already inserted into kernel."
return 1
fi
major=`cat /proc/devices | awk "\\$2==\"$module\" {print \\$1}"`
rm -f $device
mknod $device c $major 0
chmod $mode $device
return 0
}