diff options
| author | Viswanath Kraleti <viswanath.kraleti@oss.qualcomm.com> | 2026-03-18 10:33:33 +0530 |
|---|---|---|
| committer | Khem Raj <raj.khem@gmail.com> | 2026-03-18 14:33:33 -0700 |
| commit | ad2a5ac0a0ef66227ed95bf5ee045f616309fef0 (patch) | |
| tree | bab822ccc4bd00e85652593228cf9338d8df814e | |
| parent | 62b17d28060e63e8fb6992b8c75a98bc2f7a376c (diff) | |
| download | meta-openembedded-ad2a5ac0a0ef66227ed95bf5ee045f616309fef0.tar.gz | |
android-tools-conf-configfs: make USB gadget IDs configurable
The android-gadget-setup script currently hardcodes the USB vendor ID,
product ID, and configuration string. This makes it difficult for BSP
layers to customize USB gadget identity with platform specific values.
Introduce variables for the vendor ID, product ID, and configuration
string when populating the configfs attributes. This allows machine
or distro specific overrides via `/etc/android-gadget-setup.machine`,
while preserving the existing default values.
Signed-off-by: Viswanath Kraleti <viswanath.kraleti@oss.qualcomm.com>
Signed-off-by: Khem Raj <raj.khem@gmail.com>
| -rw-r--r-- | meta-oe/recipes-devtools/android-tools/android-tools-conf-configfs/android-gadget-setup | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/meta-oe/recipes-devtools/android-tools/android-tools-conf-configfs/android-gadget-setup b/meta-oe/recipes-devtools/android-tools/android-tools-conf-configfs/android-gadget-setup index dbd7115151..47e4edb9be 100644 --- a/meta-oe/recipes-devtools/android-tools/android-tools-conf-configfs/android-gadget-setup +++ b/meta-oe/recipes-devtools/android-tools/android-tools-conf-configfs/android-gadget-setup | |||
| @@ -2,9 +2,12 @@ | |||
| 2 | 2 | ||
| 3 | set -e | 3 | set -e |
| 4 | 4 | ||
| 5 | conf="Conf 1" | ||
| 5 | manufacturer=RPB | 6 | manufacturer=RPB |
| 6 | model="Android device" | 7 | model="Android device" |
| 8 | product=0xd002 | ||
| 7 | serial=0123456789ABCDEF | 9 | serial=0123456789ABCDEF |
| 10 | vendor=0x18d1 | ||
| 8 | 11 | ||
| 9 | if [ -r /etc/android-gadget-setup.machine ] ; then | 12 | if [ -r /etc/android-gadget-setup.machine ] ; then |
| 10 | . /etc/android-gadget-setup.machine | 13 | . /etc/android-gadget-setup.machine |
| @@ -23,12 +26,12 @@ mkdir configs/c.1 | |||
| 23 | mkdir functions/ffs.usb0 | 26 | mkdir functions/ffs.usb0 |
| 24 | mkdir strings/0x409 | 27 | mkdir strings/0x409 |
| 25 | mkdir configs/c.1/strings/0x409 | 28 | mkdir configs/c.1/strings/0x409 |
| 26 | echo -n 0x18d1 > idVendor | 29 | echo -n "$vendor" > idVendor |
| 27 | echo -n 0xd002 > idProduct | 30 | echo -n "$product" > idProduct |
| 28 | echo "$serial" > strings/0x409/serialnumber | 31 | echo "$serial" > strings/0x409/serialnumber |
| 29 | echo "$manufacturer" > strings/0x409/manufacturer | 32 | echo "$manufacturer" > strings/0x409/manufacturer |
| 30 | echo "$model" > strings/0x409/product | 33 | echo "$model" > strings/0x409/product |
| 31 | echo "Conf 1" > configs/c.1/strings/0x409/configuration | 34 | echo "$conf" > configs/c.1/strings/0x409/configuration |
| 32 | ln -s functions/ffs.usb0 configs/c.1 | 35 | ln -s functions/ffs.usb0 configs/c.1 |
| 33 | 36 | ||
| 34 | mkdir -p /dev/usb-ffs/adb | 37 | mkdir -p /dev/usb-ffs/adb |
