#!/bin/sh
#set -x
                                                                                
##########################
# select the driver name #
##########################
uname -r > /tmp/b
b=`cat /tmp/b | grep "2."`
echo "Current kernel is $b"

echo "unloading the Open Source Drivers"
#/sbin/rmmod -f libata
/sbin/rmmod -f sata_sil                                                                                
echo "Installing SiI Driver"

#Red Hat
mkdir /tmp/cpio
echo "Unzipping drivers ..."
cp modules.cgz /tmp/cpio
cd /tmp/cpio
cat modules.cgz | gunzip | cpio -ivH crc

c=$b"BOOT"
echo $c
if [ -d /tmp/cpio/$c ] ;then
   cd /tmp/cpio/$c/
   /bin/insmod si3531r5.ko
   echo "installed SiI 3531 driver"
elif [ -d /tmp/cpio/$b ] ;then
   cd /tmp/cpio/$b/
   /bin/insmod si3531r5.ko
   echo "installed SiI 3531 driver"
fi

dmesg
cat /proc/scsi/si*/*

