Files
meta-openembedded/meta-oe/recipes-devtools/android-tools/android-tools-conf/android-gadget-setup
Fathi Boudra a231c431a5 android-tools: add recipe from AOSP tag android-5.1.1_r37
Android tools offer filsystem tools for creating sparse images,
so package them in package of its own.

This recipe is re-worked and not a straight import from meta-shr.

It's built from AOSP source. I've dropped the ubuntu-ism which will
never be upstreamed.

The intent is to be closer to the upstream AOSP source code and be able
to update the recipe regularly.

Signed-off-by: Fathi Boudra <fathi.boudra@linaro.org>
Signed-off-by: Martin Jansa <Martin.Jansa@gmail.com>
2016-09-15 10:22:46 +02:00

26 lines
1.1 KiB
Bash

#!/bin/sh
# TODO enable the lines below once we have support for getprop
# retrieve the product info from Android
# manufacturer=$(getprop ro.product.manufacturer Android)
# model=$(getprop ro.product.model Android)
# serial=$(getprop ro.serialno 0123456789ABCDEF)
manufacturer="$(cat /system/build.prop | grep -o 'ro.product.manufacturer=.*' | cut -d'=' -f 2)"
model="$(cat /system/build.prop | grep -o 'ro.product.model=.*' | cut -d'=' -f 2)"
# get the device serial number from /proc/cmdline directly(since we have no getprop on
# GNU/Linux)
serial="$(cat /proc/cmdline | sed 's/.*androidboot.serialno=//' | sed 's/ .*//')"
echo $serial > /sys/class/android_usb/android0/iSerial
echo $manufacturer > /sys/class/android_usb/android0/iManufacturer
echo $model > /sys/class/android_usb/android0/iProduct
echo "0" > /sys/class/android_usb/android0/enable
echo "18d1" > /sys/class/android_usbid_usb/android0/idVendor
echo "D002" > /sys/class/android_usb/android0/idProduct
echo "adb" > /sys/class/android_usb/android0/functions
echo "1" > /sys/class/android_usb/android0/enable
sleep 4