aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEric Bénard <eric@eukrea.com>2010-10-30 02:35:50 +0200
committerEric Bénard <eric@eukrea.com>2010-10-30 02:36:48 +0200
commitfd25d654ca692e768d41147d389731a2a5f8dd4e (patch)
treeff36303b25930edbfcc217ae17392435bb375f31
parent291693ea81a4b65fbb7f75db10790d72d37b1ec0 (diff)
downloadopenembedded-fd25d654ca692e768d41147d389731a2a5f8dd4e.tar.gz
openembedded-fd25d654ca692e768d41147d389731a2a5f8dd4e.tar.bz2
openembedded-fd25d654ca692e768d41147d389731a2a5f8dd4e.zip
add missing script for usb detection
this script is missing in commit cd7c9542bad478df9df733a6639ab3b6ef41ef72 Signed-off-by: Eric Bénard <eric@eukrea.com>
-rw-r--r--recipes/busybox/files/usb.sh37
1 files changed, 37 insertions, 0 deletions
diff --git a/recipes/busybox/files/usb.sh b/recipes/busybox/files/usb.sh
new file mode 100644
index 0000000000..9faf14106b
--- /dev/null
+++ b/recipes/busybox/files/usb.sh
@@ -0,0 +1,37 @@
+#!/bin/sh
+
+case "$ACTION" in
+ add|"")
+ for uevent in /sys/class/usb_device/usbdev?.*/*/uevent; do
+ . $uevent
+ if [ ! -e /dev/bus/usb/$BUSNUM/$DEVNUM ]; then
+ mkdir -p /dev/bus/usb/$BUSNUM
+ mknod /dev/bus/usb/$BUSNUM/$DEVNUM c 189 $MINOR
+ fi
+ done
+ ;;
+ remove)
+ for device in /dev/bus/usb/*/*; do
+ REMOVED=1
+ dev=`basename $device`
+ bus=`basename $(dirname $device)`
+ for uevent in /sys/class/usb_device/usbdev?.*/*/uevent; do
+ . $uevent
+ echo $dev $DEVNUM $bus $BUSNUM >> /tmp/rem.txt
+ if [ $dev -eq $DEVNUM ] && [ $bus -eq $BUSNUM ]; then
+ REMOVED=0
+ break;
+ fi
+ done
+ if [ $REMOVED -eq 1 ]; then
+ rm /dev/bus/usb/$bus/$dev
+ if [ -z $(ls /dev/bus/usb/$bus/) ]; then
+ rmdir /dev/bus/usb/$bus/
+ fi
+ fi
+ done
+ ;;
+esac
+--
+1.6.3.3
+