#!/bin/sh ROOTDIR=$1 MODDIR=$2 TARGET=$3 USE_UDEV=$4 DEV_CHANGE_PERMISSION_MSG=$5 TARGET_BASENAME=`basename $TARGET` MODULE_NAME=`echo $TARGET_BASENAME | awk -F "." '{print $1}'` TARGET_USB=`dirname $TARGET`/$MODULE_NAME"_usb".`echo $TARGET_BASENAME | awk -F "." '{print $2}'` PRODUCT=`basename $ROOTDIR` if [ KernelDriver = $PRODUCT ] then touch /etc/.kerneldriver.rc echo $ROOTDIR"/" > /etc/.kerneldriver.rc else if [ GoHotSwap = $PRODUCT ] then touch /etc/.gohotswap.rc echo $ROOTDIR"/" > /etc/.gohotswap.rc fi touch /etc/.windriver.rc echo $ROOTDIR"/" > /etc/.windriver.rc fi echo echo "Installing the WinDriver kernel module(s)" echo "-----------------------------------------" if [ -e $TARGET_USB ] then echo "WinDriver's kernel modules ($TARGET_BASENAME and `basename $TARGET_USB`)" else echo "WinDriver's kernel module ($TARGET_BASENAME)" fi echo "can be reloaded upon every boot." echo "The kernel module will be loaded after running the wdreg script upon boot" echo "in the following manner:" echo " /wdreg $MODULE_NAME auto" echo "Alternatively you can manually load the kernel module as explained" echo "in WinDriver's User's Manual." echo "It is recommended to add this call in your rc.local file." echo "NOTE: Due to security reasons, by default, /dev/$MODULE_NAME is created with" echo "permissions only for the root user. To enable other user access," echo "$DEV_CHANGE_PERMISSION_MSG" echo mkdir -p $MODDIR if [ -e $TARGET_USB ] then cp $TARGET_USB $MODDIR fi cp $TARGET $MODDIR ./wdreg $MODULE_NAME $USE_UDEV