diff options
author | Denys Dmytriyenko <denis@denix.org> | 2009-03-17 14:32:59 -0400 |
---|---|---|
committer | Denys Dmytriyenko <denis@denix.org> | 2009-03-17 14:32:59 -0400 |
commit | 709c4d66e0b107ca606941b988bad717c0b45d9b (patch) | |
tree | 37ee08b1eb308f3b2b6426d5793545c38396b838 /recipes/linux-hotplug/files/sleeve.rc | |
parent | fa6cd5a3b993f16c27de4ff82b42684516d433ba (diff) |
rename packages/ to recipes/ per earlier agreement
See links below for more details:
http://thread.gmane.org/gmane.comp.handhelds.openembedded/21326
http://thread.gmane.org/gmane.comp.handhelds.openembedded/21816
Signed-off-by: Denys Dmytriyenko <denis@denix.org>
Acked-by: Mike Westerhof <mwester@dls.net>
Acked-by: Philip Balister <philip@balister.org>
Acked-by: Khem Raj <raj.khem@gmail.com>
Acked-by: Marcin Juszkiewicz <hrw@openembedded.org>
Acked-by: Koen Kooi <koen@openembedded.org>
Acked-by: Frans Meulenbroeks <fransmeulenbroeks@gmail.com>
Diffstat (limited to 'recipes/linux-hotplug/files/sleeve.rc')
-rwxr-xr-x | recipes/linux-hotplug/files/sleeve.rc | 60 |
1 files changed, 60 insertions, 0 deletions
diff --git a/recipes/linux-hotplug/files/sleeve.rc b/recipes/linux-hotplug/files/sleeve.rc new file mode 100755 index 0000000000..864a2eb182 --- /dev/null +++ b/recipes/linux-hotplug/files/sleeve.rc @@ -0,0 +1,60 @@ +#!/bin/sh +# +# H3600 Sleeve hotplug *.rc agent. +# This script is called by /etc/init.d/hotplug whenever +# a run level has changed. +# +# A single argument is passed - start, restart, status, or stop +# +# We set up parameters that are equivalent to the ones created +# by the Kernel and pass them along to /sbin/hotplug (the +# function called by the kernel). +# +# Kernel NET hotplug params include: +# +# ACTION=%s [add or remove] +# VENDOR_ID=%s +# DEVICE_ID=%x +# DEVICE_NAME=%s +# + +. /etc/hotplug/hotplug.functions +# DEBUG=yes export DEBUG + +SLEEVEFILE="/proc/bus/sleeve/device" +[ ! -f $SLEEVEFILE ] && exit 0 + +# give the sleeve driver a kick to make sure it recognizes the card -Jamey 6/26/01 +# echo > /proc/sys/sleeve/insert + +export DEVICE_NAME=`/bin/grep driver $SLEEVEFILE | /bin/sed -e 's/.*=//'` +export DEVICE_ID=`/bin/grep device $SLEEVEFILE | /bin/sed -e 's/.*=//'` +export VENDOR_ID=`/bin/grep vendor $SLEEVEFILE | /bin/sed -e 's/.*=//'` + +case "$1" in + start) + export ACTION="add" + /sbin/hotplug sleeve + ;; + stop) + export ACTION="remove" + /sbin/hotplug sleeve + ;; + restart) + export ACTION="remove" + /sbin/hotplug sleeve + export ACTION="add" + /sbin/hotplug sleeve + ;; + status) + if [ -f /var/lock/subsys/hotplug ]; then + mesg "Hot plug sleeve has been started, current device $DEVICE_NAME" + else + mesg "Hot plug sleeve has not been started, current device $DEVICE_NAME" + fi + ;; + *) + mesg "Usage: $0 {start|stop|status|restart}" + ;; +esac + |