diff options
author | Marcin Juszkiewicz <hrw@openembedded.org> | 2004-09-14 18:59:37 +0000 |
---|---|---|
committer | Marcin Juszkiewicz <hrw@openembedded.org> | 2004-09-14 18:59:37 +0000 |
commit | 47f2814a069d69df3e4a39e967ef952dfef456da (patch) | |
tree | ebb4e68d67b0603ce273fa34f360be54c2f738f1 | |
parent | 34c681cbc7527d65f0cd97a6e4f1bd16ad21a89c (diff) |
Merge bk://openembedded@openembedded.bkbits.net/packages
into home.hrw.one.pl:/home/szczepan/zaurus/oe/packages
2004/09/14 20:59:10+02:00 hrw.one.pl!hrw
hotplug: sleeve.rc quit quietly on non-ipaq devices
BKrev: 41473f991-dwy9wPFcjfV9-PZNHDKg
-rw-r--r-- | hotplug/files/sleeve.rc | 60 |
1 files changed, 60 insertions, 0 deletions
diff --git a/hotplug/files/sleeve.rc b/hotplug/files/sleeve.rc index e69de29bb2..864a2eb182 100644 --- a/hotplug/files/sleeve.rc +++ b/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 + |