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