#!/bin/sh module="trigmod" modulex="vmetrigmod" device="trigvme" mode="664" # Group: since distributions do it differently, look for wheel or use staff if grep -q '^staff:' /etc/group; then group="staff" else group="wheel" fi /sbin/insmod ./$module.ko # retrieve major number major=$(awk "\$2==\"$modulex\" {print \$1}" /proc/devices) echo "${device} Major: $major" rm -f /dev/${device}0 mknod /dev/${device}0 c $major 0 chmod a+rw /dev/${device}0 ln -sf ${device}0 /dev/${device} ls -l /dev/${device}*