Subversion Repositories f9daq

Rev

Rev 9 | Blame | Compare with Previous | Last modification | View Log | RSS feed

#!/bin/sh
#
# a simple shell script to load the pcivme driver module
# and to install the associated device files (Hi, 2004)
#
# $Log: pcivme_load,v $
# Revision 1.4  2004/08/13 19:34:45  klaus
# Changed to support kernels 2.6 and lesser
#
# Revision 1.3  2004/08/13 19:23:26  klaus
# conversion to kernel-version 2.6, released version 3.0
#
#
module="pcivme"
device="vmemm_"
group="root"
mode="666"

# the modulenumber must be given
if test $1
then
  # invoke insmod
 lsmod | grep $module
 /sbin/rmmod $module
 # invoke insmod
 /sbin/insmod $module.ko || /sbin/insmod $module.o || exit 1

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

 rm -f /dev/${device}$1
 mknod /dev/${device}$1 c $major $1

 chgrp $group /dev/${device}$1
 chmod $mode  /dev/${device}$1
 ls -latr  /dev/${device}$1
else
 echo "usage:  pcivme_load module_number"
fi