#!/bin/bash # # Generic binary Acx100 driver install script, attempts to find matching kernel version # to install, or re-label an existing kernel to use. # # Original: Alex Huang - alexcmhuang@globalsuntech.com # Updated: Ivor Hewitt - ivor@ivor.org # MODULE=acx100sta.o KERNEL=`uname -r` TARGET=kernel/drivers/net if [ `id -u` -ne 0 ] then echo echo "Please change to Super-User to continue this installion " echo exit 1 fi if which iwconfig then echo "Wireless extensions found." else echo "Wireless extensions must be installed." exit 1 fi #unload any module resident /sbin/modprobe -r acx100sta #remove any old copies of this module lying around rm `/sbin/modprobe -l $MODULE` #check for other acx100 drivers if /sbin/modprobe -l | grep "acx100" then echo "I think there are old acx drivers lying around," echo "please check your modules." exit 1 fi if [ -d ./$KERNEL ] then cd ./$KERNEL cp acx100sta-`uname -r`.o ../$MODULE cd .. else echo echo 'Acx100 Installation failed: There is no available acx100 module for you' echo 'Your kernel version is - '`uname -r` echo exit 1 fi if [ -f /lib/modules/`uname -r`/$TARGET/$MODULE ] then rm -f /lib/modules/`uname -r`/$TARGET/$MODULE fi chmod +x $MODULE cp -f $MODULE /lib/modules/`uname -r`/$TARGET/. STOP=0 until [ $STOP -eq 1 ] do echo echo "Acx100 Module for $KERNEL will be installed" echo echo "...........Installation is executing..........." echo RET=0 if /sbin/insmod /lib/modules/`uname -r`/$TARGET/$MODULE then RET=1 fi echo "Checking dependencies." if /sbin/depmod -aqu -F /proc/ksyms then RET=1 fi if [ $RET -ne 1 ] then read -p "Dependency failure, try to fix symbols? [y]|n : " FIX echo "Removing driver" /sbin/modprobe -r acx100sta rm `/sbin/modprobe -l $MODULE` if [ "$FIX" != "n" ] then ./fixscript $MODULE /lib/modules/`uname -r`/$TARGET/$MODULE else STOP=1 fi else STOP=1 fi done rm -f $MODULE if [ $RET -eq 1 ] then echo echo "Acx100 Module has sucessfully installed" echo else echo echo "The installation is Failed" echo fi