module="kbddrv"
device="kbddrv"
group="wheel"
mode="664"

if uname -r | grep -q "2.2.14"; then
	if uname -a | grep -q "SMP"; then
		rh62smp="-P smp"
	fi
fi

# invoke insmod with all arguments we got
if grep -q $module /proc/devices; then
	echo $module" already installed"
	exit
else
	/sbin/insmod -f $rh62smp $module.o $* &> /dev/null || exit 1
fi

major=`cat /proc/devices | awk "\\$2==\"$module\" {print \\$1}"`
#echo "major = "$major

# remove stale nodes and replace them, then give gid and perms
rm -f /dev/$device
mknod /dev/$device c $major 0
chgrp $group /dev/$device
chmod $mode  /dev/$device
