fp@224: #!/bin/sh 
fp@232: module="ec_msr_sample"
fp@224: device="msr"
fp@224: mode="664"
fp@224: 
fp@224: # Group: since distributions do it differently, look for wheel or use staff
fp@224: if grep '^staff:' /etc/group > /dev/null; then
fp@224:     group="staff"
fp@224: else
fp@224:     group="wheel"
fp@224: fi
fp@224: 
fp@224: # invoke insmod with all arguments we got
fp@224: # and use a pathname, as newer modutils don't look in . by default
fp@224: /sbin/insmod -f ./$module.ko $* || exit 1
fp@224: 
fp@224: major=`cat /proc/devices | awk "\\$2==\"$device\" {print \\$1}"`
fp@224: 
fp@224: echo $major
fp@224: # Remove stale nodes and replace them, then give gid and perms
fp@224: # Usually the script is shorter, it's scull that has several devices in it.
fp@224: 
fp@224: rm -f /dev/${device}
fp@224: mknod /dev/${device} c $major 0
fp@224: # ln -sf ${device}0 /dev/${device}
fp@224: chgrp users /dev/${device}
fp@224: chmod $mode  /dev/${device}
fp@224: 
fp@224: 
fp@224: 
fp@224: 
fp@224: 
fp@224: 
fp@224: 
fp@224: 
fp@224: