aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/staging/dt3155/dt3155.sysvinit
blob: 92ec0939cb7ace043aeb85b66d6475cae9b97687 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
#! /bin/sh
#
# Module load/unload script for use with SysV-style /etc/init.d/ systems.
# On a Debian system, copy this to /etc/init.d/dt3155 and then run
# 	/usr/sbin/update-rc.d dt3155 defaults 55
# to create the appropriate /etc/rc?.d/[SK]55dt3155 start/stop links.
# (The "55" is arbitrary but is what I use to load this rather late.)
#
#    Andy Dougherty   Feb 22 2000	doughera@lafayette.edu
#    Dept. of Physics
#    Lafayette College, Easton PA 18042
#

PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin

# Edit to point to your local copy.
FILE=/usr/local/lib/modules/dt3155/dt3155.o
NAME="dt3155"
DESC="dt3155 Frame Grabber module"
DEV="dt3155"

if test ! -f $FILE; then
    echo "Unable to locate $FILE"
    exit 0
fi

set -e

case "$1" in
  start)
    echo -n "Loading $DESC "
    if /sbin/insmod -v -f $FILE; then
	major=`grep $DEV /proc/devices | awk "{print \\$1}"`
	rm -f /dev/dt3155?
	mknod /dev/dt3155a c $major 0
	mknod /dev/dt3155b c $major 1
	chmod go+rw /dev/dt3155?
	echo
    else
	echo "$FILE not loaded."
    fi
    ;;
  stop)
    echo -n "Unloading $DESC: "
    if /sbin/rmmod $NAME ; then
	echo
    else
	echo "$DEV not removed"
	exit 0
    fi
    rm -f /dev/dt3155?
    ;;
  *)
    echo "Usage: /etc/init.d/$NAME {start|stop}"
    exit 1
    ;;
esac

exit 0