#!/bin/sh #This software is a driver for ACCES I/O Products, Inc. PCI cards. #Copyright (C) 2007 ACCES I/O Products, Inc. #This program is free software; you can redistribute it and/or #modify it under the terms of the GNU General Public License #as published by the Free Software Foundation. This software is released under #version 2 of the GPL. #This program is distributed in the hope that it will be useful, #but WITHOUT ANY WARRANTY; without even the implied warranty of #MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the #GNU General Public License for more details. #You should have received a copy of the GNU General Public License #along with this program; if not, write to the Free Software #Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. #In addition ACCES provides other licenses with its software at customer request. #For more information please contact the ACCES software department at #(800)-326-1649 or visit www.accesio.com #This file is heavily based on samples from "Linux Device Drivers: 3rd Edition" #O'Reilly press. #Modified by Jay Dolan at ACCES I/O Products, Inc 2007 module="apci" device="apci" 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 # invoke insmod with all arguments we got # and use a pathname, as insmod doesn't look in . by default depmod -A `uname -r` /sbin/modprobe $module $* || exit 1 # retrieve major number major=$(awk "\$2==\"$module\" {print \$1}" /proc/devices) # Remove stale nodes and replace them, then give gid and perms rm -f /dev/${device} mknod /dev/${device} c $major 0 echo mknod /dev/${device} c $major 0 #ln -sf ${device}0 /dev/${device} chgrp $group /dev/${device} chmod $mode /dev/${device} # end of file