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