]> pilppa.org Git - familiar-h63xx-build.git/blob - org.handhelds.familiar/packages/linux-hotplug/files/sleeve.rc
OE tree imported from monotone branch org.openembedded.oz354fam083 at revision 8b12e3...
[familiar-h63xx-build.git] / org.handhelds.familiar / packages / linux-hotplug / files / sleeve.rc
1 #!/bin/sh
2 #
3 # H3600 Sleeve hotplug *.rc agent.
4 # This script is called by /etc/init.d/hotplug whenever
5 # a run level has changed.
6
7 # A single argument is passed - start, restart, status, or stop
8 #
9 # We set up parameters that are equivalent to the ones created
10 # by the Kernel and pass them along to /sbin/hotplug (the
11 # function called by the kernel).
12 #
13 # Kernel NET hotplug params include:
14 #       
15 #       ACTION=%s [add or remove]
16 #       VENDOR_ID=%s
17 #       DEVICE_ID=%x
18 #       DEVICE_NAME=%s
19 #
20
21 . /etc/hotplug/hotplug.functions
22 # DEBUG=yes export DEBUG
23
24 SLEEVEFILE="/proc/bus/sleeve/device"
25 [ ! -f $SLEEVEFILE ] && exit 0
26
27 # give the sleeve driver a kick to make sure it recognizes the card -Jamey 6/26/01
28 # echo > /proc/sys/sleeve/insert
29
30 export DEVICE_NAME=`/bin/grep driver $SLEEVEFILE | /bin/sed -e 's/.*=//'`
31 export DEVICE_ID=`/bin/grep device $SLEEVEFILE | /bin/sed -e 's/.*=//'`
32 export VENDOR_ID=`/bin/grep vendor $SLEEVEFILE | /bin/sed -e 's/.*=//'`
33
34 case "$1" in
35     start)
36         export ACTION="add"
37         /sbin/hotplug sleeve
38         ;;
39     stop)
40         export ACTION="remove"
41         /sbin/hotplug sleeve
42         ;;
43     restart)
44         export ACTION="remove"
45         /sbin/hotplug sleeve
46         export ACTION="add"
47         /sbin/hotplug sleeve
48         ;;
49     status)
50         if [ -f /var/lock/subsys/hotplug ]; then
51             mesg "Hot plug sleeve has been started, current device $DEVICE_NAME"
52         else
53             mesg "Hot plug sleeve has not been started, current device $DEVICE_NAME"
54         fi
55         ;;
56     *)
57         mesg "Usage: $0 {start|stop|status|restart}"
58         ;;
59 esac
60