pandora-usbhost.bb: New Startup daemon to enable USB Host on boot
authorMichael Mrozek <EvilDragon@openpandora.de>
Fri, 27 Apr 2012 00:24:38 +0000 (02:24 +0200)
committerMichael Mrozek <EvilDragon@openpandora.de>
Fri, 27 Apr 2012 00:24:38 +0000 (02:24 +0200)
recipes/pandora-system/pandora-usbhost.bb [new file with mode: 0644]
recipes/pandora-system/pandora-usbhost/rc.usbhost [new file with mode: 0644]

diff --git a/recipes/pandora-system/pandora-usbhost.bb b/recipes/pandora-system/pandora-usbhost.bb
new file mode 100644 (file)
index 0000000..1a06579
--- /dev/null
@@ -0,0 +1,19 @@
+DESCRIPTION = "Startup service for USB Host"
+LICENSE = "GPLV2"
+
+COMPATIBLE_MACHINE = "omap3-pandora"
+
+PR = "r1"
+
+SRC_URI = " \
+          file://rc.usbhost \
+"
+
+do_install() {
+          install -d ${D}${sysconfdir}/init.d/
+          install -m 0755 ${WORKDIR}/rc.usbhost ${D}${sysconfdir}/init.d/usbhost
+}
+
+PACKAGE_ARCH = "${MACHINE_ARCH}"
+
+FILES_${PN} += "${prefix} ${datadir}"
diff --git a/recipes/pandora-system/pandora-usbhost/rc.usbhost b/recipes/pandora-system/pandora-usbhost/rc.usbhost
new file mode 100644 (file)
index 0000000..2783ecc
--- /dev/null
@@ -0,0 +1,39 @@
+#!/bin/sh
+DESC="USB HOST"
+NAME="EHCI Driver"
+
+d_stop() {
+       if `grep -q ehci_hcd /proc/modules` ; then
+               rmmod ehci_hcd 2> /dev/null
+       fi
+}
+
+d_start() {
+       modprobe ehci-hcd
+       }
+
+case "$1" in
+  start)
+       echo -n "Starting $DESC: $NAME"
+       d_start &
+       echo "."
+       ;;
+  stop)
+       echo -n "Stopping $DESC: $NAME"
+       d_stop
+       echo "."
+       ;;
+  restart|force-reload)
+       echo -n "Restarting $DESC: $NAME"
+       d_stop
+       sleep 1
+       d_start
+       echo "."
+       ;;
+  *)
+       echo "Usage: $0 {start|stop|restart|force-reload}" >&2
+       exit 1
+       ;;
+esac
+
+exit 0