#!/bin/sh
# Last Update: -lky, 89/6/20-
#

module="ipmdrv"
RH62smp_opt="-P smp"
RH60smp_opt="-P smp_"
device="ipmdrv"
group="wheel"
mode="664"

# invoke insmod with all arguments we got
if grep $module /proc/devices; then
        echo $module" already installed"
	exit
else
  if uname -r | grep "2.2.14"; then
	# RH62smp
	/sbin/insmod -f $RH62smp_opt $module.o $* || exit 1
  else
  	# RH60smp
	/usr/local/share/asm/insmod -f $RH60smp_opt $module.o $* || exit 1
  fi
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
ln -f -s /dev/$device /dev/ipmidrv
