install.sh 938 Bytes
#!/bin/bash

#
# script to install the BBRDB driver loadable module
# and required files
#
# this script must be run as 'root'
#

KVERSION=`uname -r`
DRIVER=$KVERSION/bbrdb.o
MODMAP=/lib/modules/$KVERSION/modules.usbmap

echo Running linux kernel version is $KVERSION

if [ ! -f $DRIVER ]; then
	echo $DRIVER: not found
	echo No driver binary available for linux kernel $KVERSION;
	exit 1;
fi

cp -f $DRIVER /lib/modules/$KVERSION/kernel/drivers/usb
if grep bbrdb $MODMAP > /dev/null; then
	echo bbrdb spec already in modules.usbmap;
else 
	echo Adding bbrdb spec to $MODMAP;
	cat modules.usbmap.append >> $MODMAP;
fi
/sbin/depmod -a
if [ -c /dev/usb/bbrdb0 ]; then
	echo /dev entries already exist;
else
	echo Creating /dev entries;
	mknod /dev/usb/bbrdb0 c 180 160;
	mknod /dev/usb/bbrdb1 c 180 161;
	mknod /dev/usb/bbrdb2 c 180 162;
	mknod /dev/usb/bbrdb3 c 180 163;
	chmod 666 /dev/usb/bbrdb?;
fi
/sbin/rmmod bbrdb
/sbin/insmod bbrdb