Subversion Repositories f9daq

Rev

Details | Last modification | View Log | RSS feed

Rev Author Line No. Line
86 f9daq 1
#!/bin/sh
2
#
3
# Copyright (C) 2005  ARW Elektronik, Germany
4
#
5
# This is a small script to generate device node entries at /dev for
6
# PCICC32 devices. The script uses the entries from /proc/devices.
7
# This means the driver have to be installed before using the script.
8
#
9
# Maintainer: Klaus Hitschler (klaus.hitschler@gmx.de)
10
#
11
# $Log: pcicc32_make_devices,v $
12
# Revision 1.1  2005/10/08 13:23:24  klaus
13
# release 6.7, added helper script for persistent installation
14
#
15
#
16
 
17
module="pcicc32"
18
device="cc32_"
19
group="root"
20
mode="666"
21
 
22
if test $UID -ne 0; then
23
  echo "ERROR: you must be root to use pcicc32_make_devices!"
24
  echo ""
25
  exit -1
26
fi
27
 
28
# check command line arguments
29
if test $# -le 0; then
30
  echo "ERROR: please provide the number of devices per interface type!"
31
  echo "usage: pcicc32_make_devices n"
32
  echo ""
33
  exit -1
34
fi
35
 
36
# get major number from /proc/devices
37
major=`cat /proc/devices | awk "\\$2==\"$module\" {print \\$1}"`
38
 
39
# make device nodes
40
if test "$major"; then
41
  i=0;
42
  while test $i -le $1; do
43
    rm -f /dev/$device$i;
44
    mknod /dev/$device$i c $major $i;
45
    chgrp $group /dev/$device$i;
46
    chmod $mode  /dev/$device$i;
47
    i=$[$i + 1];
48
  done;
49
else
50
  echo "Please do first a \"insmod pcicc32.ko or insmod pcicc32.o ...\"";
51
fi
52
 
53
# end of script
54