Dmitry Baryshkov 50efc66dcb
android-tools-conf-configs: revert deletion of the recipe
The commit 33c1e33d2303 ("android-tools: remove android-tools 5.x from
meta-oe/recipes-devtools") blindly dropped all recipes from the
android-tools dir. Later commits moved the android-tools recipe and
other related recipes from the SELinux dynamic layer, bumping the
version to 29.x, but somehow the author of the patches didn't notice
that the resulting set of packages doesn't work out of box on any
upstream kernels, as the default android-tools-conf setup scripts use
Android-proprietary way of setting up the USB gadget
(/sys/class/android_usb).

Bring back the android-tools-conf-configs recipe, which uses upstream
mechanism (ConfigFS) to setup the USB gadget for ADB.

Fixes: 33c1e33d2303 ("android-tools: remove android-tools 5.x from meta-oe/recipes-devtools")
Signed-off-by: Dmitry Baryshkov <dmitry.baryshkov@oss.qualcomm.com>
Signed-off-by: Khem Raj <khem.raj@oss.qualcomm.com>
2026-06-09 07:26:33 -07:00

39 lines
838 B
Bash

#!/bin/sh
set -e
conf="Conf 1"
manufacturer=RPB
model="Android device"
product=0xd002
serial=0123456789ABCDEF
vendor=0x18d1
if [ -r /etc/android-gadget-setup.machine ] ; then
. /etc/android-gadget-setup.machine
fi
[ -d /sys/kernel/config/usb_gadget ] || modprobe libcomposite
cd /sys/kernel/config/usb_gadget
[ -d adb ] && /usr/bin/android-gadget-cleanup || true
mkdir adb
cd adb
mkdir configs/c.1
mkdir functions/ffs.usb0
mkdir strings/0x409
mkdir configs/c.1/strings/0x409
echo -n "$vendor" > idVendor
echo -n "$product" > idProduct
echo "$serial" > strings/0x409/serialnumber
echo "$manufacturer" > strings/0x409/manufacturer
echo "$model" > strings/0x409/product
echo "$conf" > configs/c.1/strings/0x409/configuration
ln -s functions/ffs.usb0 configs/c.1
mkdir -p /dev/usb-ffs/adb
mount -t functionfs usb0 /dev/usb-ffs/adb