#!/bin/sh
#set -x
                                                                                
##########################
# select the driver name #
##########################
uname -r > /tmp/b
b=`cat /tmp/b | grep "2.6"`
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 sii3124.ko
elif [ -d /tmp/cpio/$b ] ;then
  cd /tmp/cpio/$b/
  /bin/insmod sii3124.ko
fi

dmesg
echo "installed default driver"
cat /proc/scsi/si*/*

