summaryrefslogtreecommitdiffstats
path: root/dynamic-layers/selinux/android-tools/android-tools-conf/android-gadget-setup
diff options
context:
space:
mode:
authorNisha Parrakat <nishaparrakat@gmail.com>2021-08-08 08:18:35 +0000
committerKhem Raj <raj.khem@gmail.com>2021-08-12 10:08:16 -0700
commit1f1d3812a10e5a20069545d3ec1e2ae034ab05af (patch)
tree8526dd017f373037618726fe20db169d8a561c31 /dynamic-layers/selinux/android-tools/android-tools-conf/android-gadget-setup
parenteb92914e31ff872c032155997c42ca8b6e6d82a3 (diff)
downloadmeta-clang-1f1d3812a10e5a20069545d3ec1e2ae034ab05af.tar.gz
upgrade of android-tools to 10.0.0.r36
An older version is present in the meta-oe layer. Took the old recipe and adapted it in the following way: --Deleted all the old patches that were applicable for old version. --Used all the makefiles that come with the new version directly from the source code, just modifying them to install output to a specific folder as below a)added rules_yocto.mk that will mimic the debian/rules b)modified the makefiles of the components to output to a common dir. c) Built boringssl crypto with the option -DOPENSSL_NO_ASM to solve the below errors libcrypto.so.0: undefined reference to `aes_hw_encrypt' libcrypto.so.0: undefined reference to `aes_hw_set_encrypt_key' libcrypto.so.0: undefined reference to `gcm_gmult_v8' libcrypto.so.0: undefined reference to `gcm_init_v8' libcrypto.so.0: undefined reference to `sha256_block_data_order' libcrypto.so.0: undefined reference to `aes_hw_ctr32_encrypt_blocks' libcrypto.so.0: undefined reference to `aes_hw_cbc_encrypt' libcrypto.so.0: undefined reference to `vpaes_decrypt' libcrypto.so.0: undefined reference to `vpaes_encrypt' libcrypto.so.0: undefined reference to `gcm_gmult_neon' libcrypto.so.0: undefined reference to `sha1_block_data_order' libcrypto.so.0: undefined reference to `sha512_block_data_order' libcrypto.so.0: undefined reference to `gcm_init_neon' libcrypto.so.0: undefined reference to `aes_hw_set_decrypt_key' libcrypto.so.0: undefined reference to `vpaes_set_decrypt_key' libcrypto.so.0: undefined reference to `gcm_ghash_neon' libcrypto.so.0: undefined reference to `bn_mul_mont' libcrypto.so.0: undefined reference to `aes_hw_decrypt' libcrypto.so.0: undefined reference to `gcm_ghash_v8' libcrypto.so.0: undefined reference to `vpaes_cbc_encrypt' libcrypto.so.0: undefined reference to `ChaCha20_ctr32' libcrypto.so.0: undefined reference to `vpaes_ctr32_encrypt_blocks' libcrypto.so.0: undefined reference to `vpaes_set_encrypt_key' Attention : https://github.com/grpc/grpc/issues/9440 d) compiled android compatible version of libunwind to be used to build libbacktrace e) REQUIRES meta-selinux for libselinux, thus added it to BBFILES_DYNAMIC of this layer. f) checked compilation and packaging for for x86_64 and aarch64 g) UNTESTED android-tools-adbd.service , couldn't find how to build adbd that is needed by the service with the new version of android-tools. At present the service is still packaged but may not work. h) tested the adb and fastboot on the core-image-minimal by including the android-tools in the image and ran the commands with 'help' Signed-off-by: Nisha Parrakat <Nisha.Parrakat@kpit.com> Signed-off-by: Nisha Parrakat <nishaparrakat@gmail.com>
Diffstat (limited to 'dynamic-layers/selinux/android-tools/android-tools-conf/android-gadget-setup')
-rw-r--r--dynamic-layers/selinux/android-tools/android-tools-conf/android-gadget-setup37
1 files changed, 37 insertions, 0 deletions
diff --git a/dynamic-layers/selinux/android-tools/android-tools-conf/android-gadget-setup b/dynamic-layers/selinux/android-tools/android-tools-conf/android-gadget-setup
new file mode 100644
index 0000000..26cf30e
--- /dev/null
+++ b/dynamic-layers/selinux/android-tools/android-tools-conf/android-gadget-setup
@@ -0,0 +1,37 @@
1#!/bin/sh
2
3[ ! -e /dev/pts ] && mkdir -p /dev/pts
4[ ! -e /dev/pts/0 ] && mount devpts /dev/pts -t devpts
5
6# TODO enable the lines below once we have support for getprop
7# retrieve the product info from Android
8# manufacturer=$(getprop ro.product.manufacturer Android)
9# model=$(getprop ro.product.model Android)
10# serial=$(getprop ro.serialno 0123456789ABCDEF)
11
12#below are now needed in order to use FunctionFS for ADB, tested to work with 3.4+ kernels
13if grep -q functionfs /proc/filesystems; then
14 mkdir -p /dev/usb-ffs/adb
15 mount -t functionfs adb /dev/usb-ffs/adb
16 #android-gadget-setup doesn't provide below 2 and without them it won't work, so we provide them here.
17 echo adb > /sys/class/android_usb/android0/f_ffs/aliases
18 echo ffs > /sys/class/android_usb/android0/functions
19fi
20
21manufacturer="$(cat /system/build.prop | grep -o 'ro.product.manufacturer=.*' | cut -d'=' -f 2)"
22model="$(cat /system/build.prop | grep -o 'ro.product.model=.*' | cut -d'=' -f 2)"
23# get the device serial number from /proc/cmdline directly(since we have no getprop on
24# GNU/Linux)
25serial="$(cat /proc/cmdline | sed 's/.*androidboot.serialno=//' | sed 's/ .*//')"
26
27echo $serial > /sys/class/android_usb/android0/iSerial
28echo $manufacturer > /sys/class/android_usb/android0/iManufacturer
29echo $model > /sys/class/android_usb/android0/iProduct
30
31echo "0" > /sys/class/android_usb/android0/enable
32echo "18d1" > /sys/class/android_usb/android0/idVendor
33echo "D002" > /sys/class/android_usb/android0/idProduct
34echo "adb" > /sys/class/android_usb/android0/functions
35echo "1" > /sys/class/android_usb/android0/enable
36
37sleep 4