summaryrefslogtreecommitdiffstats
path: root/recipes/adbd/files/adb-init
diff options
context:
space:
mode:
authorSamuli Piippo <samuli.piippo@digia.com>2014-03-12 14:01:21 +0200
committerSamuli Piippo <samuli.piippo@digia.com>2014-03-14 10:03:22 +0200
commitd469a7df484e1916a25d566d53f2d733ae6edbb1 (patch)
treea4ca4aad6ba42e09f1679d01d778d7349164d837 /recipes/adbd/files/adb-init
parent0975201e0a0e09ec878b210aa461949a3da9c32e (diff)
downloadmeta-boot2qt-d469a7df484e1916a25d566d53f2d733ae6edbb1.tar.gz
adbd: make switching between usb and ethernet easier
Using settings in /etc/default/adbd, user can easily switch between usb and ethernet connection for the adbd. Task-number: QTEE-172 Change-Id: I8652f85878983d0bc9b9139cee6af874b8207fce Reviewed-by: Rainer Keller <rainer.keller@digia.com>
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