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