diff options
author | Samuli Piippo <samuli.piippo@digia.com> | 2013-06-24 15:24:35 +0300 |
---|---|---|
committer | Samuli Piippo <samuli.piippo@digia.com> | 2013-06-24 15:47:10 +0300 |
commit | 278ea611017e85f4e059455fde5e9080efde2fa3 (patch) | |
tree | a83996b97cb406d1af242c22e741c06a04b60640 /recipes/adbd/files/adb-init | |
parent | 29f971bec6ad8bbbf3f6bbcf1ab67f1f4e0b59ff (diff) | |
download | meta-boot2qt-278ea611017e85f4e059455fde5e9080efde2fa3.tar.gz |
Update on adbd recipes
-using hostname + mac address for serialnumber
-using start-stop-daemon for adbd
-using RRECOMMENDS to include g-ffs module
-android sources are Apache licensed
Change-Id: Iaec92b93cf22702586d39fa7923b8735f650ea57
Reviewed-by: Samuli Piippo <samuli.piippo@digia.com>
Diffstat (limited to 'recipes/adbd/files/adb-init')
-rwxr-xr-x | recipes/adbd/files/adb-init | 22 |
1 files changed, 17 insertions, 5 deletions
diff --git a/recipes/adbd/files/adb-init b/recipes/adbd/files/adb-init index 6f2910e..e88df23 100755 --- a/recipes/adbd/files/adb-init +++ b/recipes/adbd/files/adb-init | |||
@@ -1,22 +1,34 @@ | |||
1 | #!/bin/sh | 1 | #!/bin/sh |
2 | |||
3 | DAEMON=/usr/bin/adbd | ||
4 | |||
5 | VENDOR=0x18d1 | ||
6 | PRODUCT=0x0000 | ||
7 | SERIAL=$(hostname)-$(sed -e 's/://g' /sys/class/net/eth0/address) | ||
8 | |||
2 | case "$1" in | 9 | case "$1" in |
3 | start) | 10 | start) |
4 | insmod $(busybox find /lib/modules/$(uname -r) -name "g_ffs.ko") idVendor=0x18d1 idProduct=0x4e26 iSerialNumber=$(hostname) | 11 | insmod $(busybox find /lib/modules/$(uname -r) -name "g_ffs.ko") idVendor=${VENDOR} idProduct=${PRODUCT} iSerialNumber=${SERIAL} |
5 | mkdir -p /dev/usb-ffs | 12 | mkdir -p /dev/usb-ffs |
6 | chmod 770 /dev/usb-ffs | 13 | chmod 770 /dev/usb-ffs |
7 | mkdir -p /dev/usb-ffs/adb | 14 | mkdir -p /dev/usb-ffs/adb |
8 | chmod 770 /dev/usb-ffs/adb | 15 | chmod 770 /dev/usb-ffs/adb |
9 | mount -t functionfs adb /dev/usb-ffs/adb -o uid=0,gid=0 | 16 | mount -t functionfs adb /dev/usb-ffs/adb -o uid=0,gid=0 |
10 | 17 | start-stop-daemon --start --quiet --exec $DAEMON & | |
11 | /usr/bin/adbd & | ||
12 | ;; | 18 | ;; |
13 | stop) | 19 | stop) |
14 | killall adbd | 20 | start-stop-daemon --stop --quiet --exec $DAEMON |
21 | sleep 1 | ||
15 | umount /dev/usb-ffs/adb | 22 | umount /dev/usb-ffs/adb |
16 | rmmod g_ffs | 23 | rmmod g_ffs |
17 | ;; | 24 | ;; |
25 | restart) | ||
26 | start-stop-daemon --stop --quiet --exec $DAEMON | ||
27 | sleep 1 | ||
28 | start-stop-daemon --start --quiet --exec $DAEMON & | ||
29 | ;; | ||
18 | *) | 30 | *) |
19 | echo "Usage: $0 {start|stop}" | 31 | echo "Usage: $0 {start|stop|restart}" |
20 | exit 1 | 32 | exit 1 |
21 | esac | 33 | esac |
22 | exit 0 | 34 | exit 0 |