]> code.ossystems Code Review - openembedded-core.git/commitdiff
usbinit: updated to more generic version
authorMarcin Juszkiewicz <hrw@openedhand.com>
Fri, 1 Jun 2007 11:36:41 +0000 (11:36 +0000)
committerMarcin Juszkiewicz <hrw@openedhand.com>
Fri, 1 Jun 2007 11:36:41 +0000 (11:36 +0000)
git-svn-id: https://svn.o-hand.com/repos/poky/trunk@1845 311d38ba-8fff-0310-9ca6-ca027cbcb966

meta/packages/oh/usbinit.bb
meta/packages/oh/usbinit/usb-gether

index 0adcae1b9cabddde13d55dfe1acdefaedfa908c6..1d4575bddb572e12209ff83895acb1c9eed3f83c 100644 (file)
@@ -1,8 +1,7 @@
-DESCRIPTION = "Quick hack to start gadget Ethernet on the 770"
+DESCRIPTION = "Initscript to manage gadget Ethernet"
 LICENSE = "GPL"
-SECTION = "x11"
 PRIORITY = "optional"
-PR = "r0"
+PR = "r1"
 
 SRC_URI = "file://usb-gether"
 S = "${WORKDIR}"
index 590e77b22a1a68d0bb8265fe41946363dd41d9a4..e80a0bb30ea0bb62355f59343870dd933e228541 100755 (executable)
@@ -1,19 +1,23 @@
-#!/bin/sh
+#! /bin/sh
+#
+# usb-ether    Start up the gadget usb ethernet interface.
+#
 
 case "$1" in
-  start)
-    /sbin/depmod -a
-    /sbin/modprobe g_ether
-    ifconfig usb0 192.168.1.120
-  ;;
-
-  stop)
-    
-  ;;
-
-  *)
-        echo "usage: $0 { start | stop }"
-  ;;
+       start|"")
+               test "$VERBOSE" != no && echo "Initializing g_ether gadget..."
+               modprobe g_ether
+               ifup usb0
+               ;;
+       stop)
+               test "$VERBOSE" != no && echo "Disabling g_ether..."
+               ifdown usb0
+               rmmod g_ether
+               ;;
+       *)
+               echo "Usage: usb-ether {start|stop}" >&2
+               exit 1
+               ;;
 esac
 
 exit 0