trigger adbd by /mnt/adb file detection

This commit is contained in:
Michel-FK 2022-01-05 19:25:28 +01:00
parent 5cdcd6ab80
commit dbddad6f77
1 changed files with 10 additions and 0 deletions

View File

@ -13,6 +13,10 @@ GADGET=/sys/kernel/config/usb_gadget/FunKey
[ ! -f /mnt/usbnet ]
USBNET=${?}
# Check if Android Debug Bridge is requested
[ ! -f /mnt/adb ]
ADB=${?}
# USB VID for Linux Foundation
ID_VENDOR="0x1d6b"
@ -37,6 +41,12 @@ init_usb_gadget() {
return 0
fi
# ADB has precedence over USB Mass Storage / Ethernet over USB
if [ ${ADB} -eq 1 ]; then
adb start
return 0
fi
# Get the legacy drivers out of the way
modprobe -r g_ether
modprobe -r g_mass_storage