summaryrefslogtreecommitdiffstats
path: root/recipes/adbd/files/adb-init
diff options
context:
space:
mode:
Diffstat (limited to 'recipes/adbd/files/adb-init')
-rwxr-xr-xrecipes/adbd/files/adb-init26
1 files changed, 14 insertions, 12 deletions
diff --git a/recipes/adbd/files/adb-init b/recipes/adbd/files/adb-init
index 6faed60..92500d7 100755
--- a/recipes/adbd/files/adb-init
+++ b/recipes/adbd/files/adb-init
@@ -2,25 +2,27 @@
2 2
3DAEMON=/usr/bin/adbd 3DAEMON=/usr/bin/adbd
4 4
5VENDOR=0x18d1 5. /etc/default/adbd
6PRODUCT=0x0000
7SERIAL=$(hostname)-$(sed -e 's/://g' /sys/class/net/eth0/address)
8 6
9case "$1" in 7case "$1" in
10start) 8start)
11 modprobe g_ffs idVendor=${VENDOR} idProduct=${PRODUCT} iSerialNumber=${SERIAL} 9 if [ "$USE_ETHERNET" = "no" ]; then
12 mkdir -p /dev/usb-ffs 10 modprobe g_ffs idVendor=${VENDOR} idProduct=${PRODUCT} iSerialNumber=${SERIAL}
13 chmod 770 /dev/usb-ffs 11 mkdir -p /dev/usb-ffs
14 mkdir -p /dev/usb-ffs/adb 12 chmod 770 /dev/usb-ffs
15 chmod 770 /dev/usb-ffs/adb 13 mkdir -p /dev/usb-ffs/adb
16 mount -t functionfs adb /dev/usb-ffs/adb -o uid=0,gid=0 14 chmod 770 /dev/usb-ffs/adb
15 mount -t functionfs adb /dev/usb-ffs/adb -o uid=0,gid=0
16 fi
17 start-stop-daemon --start --quiet --exec $DAEMON & 17 start-stop-daemon --start --quiet --exec $DAEMON &
18 ;; 18 ;;
19stop) 19stop)
20 start-stop-daemon --stop --quiet --exec $DAEMON 20 start-stop-daemon --stop --quiet --exec $DAEMON
21 sleep 1 21 if [ "$USE_ETHERNET" = "no" ]; then
22 umount /dev/usb-ffs/adb 22 sleep 1
23 rmmod g_ffs 23 umount /dev/usb-ffs/adb
24 rmmod g_ffs
25 fi
24 ;; 26 ;;
25restart) 27restart)
26 start-stop-daemon --stop --quiet --exec $DAEMON 28 start-stop-daemon --stop --quiet --exec $DAEMON