android-tools-conf-configfs: handle multiple UDC controllers

For the boards with multiple UDC ports, adb funtion will be impacted due
to below error.

ls /sys/class/udc/ > /sys/kernel/config/usb_gadget/adb/UDC
ls: write error: Device or resource busy

Signed-off-by: Shoudi Li <shoudil@qti.qualcomm.com>
This commit is contained in:
Shoudi Li 2026-01-23 09:14:56 +08:00
parent 7bbe4a4e20
commit 9a4533e682

View File

@ -2,6 +2,8 @@
set -e
sleep 3
sleep 10
ls /sys/class/udc/ > /sys/kernel/config/usb_gadget/adb/UDC
ls /sys/class/udc/ | head -n 1 | xargs echo -n > /sys/kernel/config/usb_gadget/adb/UDC
echo "Setting UDC $(ls /sys/class/udc/ | head -n 1) for USB ADB Gadget usage"