mirror of
https://github.com/sipeed/LicheeRV-Nano-Build.git
synced 2026-09-11 05:09:56 -05:00
add usb adbd support, enable with create /boot/usb.adbd file
This commit is contained in:
1
.gitignore
vendored
1
.gitignore
vendored
@@ -420,3 +420,4 @@ osdrv/extdrv/wireless/.tmp_4261/
|
||||
middleware/v2/lib
|
||||
host-tools/
|
||||
kvm/
|
||||
.vscode*
|
||||
|
||||
@@ -168,7 +168,33 @@ then
|
||||
ln -s functions/hid.GS2 configs/c.1
|
||||
fi
|
||||
|
||||
ls /sys/class/udc/ | cat > UDC
|
||||
# adbd
|
||||
if [ -e /boot/usb.adbd ]
|
||||
then
|
||||
echo 0x18d1 > idVendor # google
|
||||
mkdir -p configs/c.1/strings/0x409
|
||||
echo "" > configs/c.1/strings/0x409/configuration
|
||||
echo 0x80 > configs/c.1/bmAttributes
|
||||
mkdir functions/ffs.adb
|
||||
ln -s functions/ffs.adb configs/c.1/
|
||||
mkdir -p /dev/usb-ffs/adb
|
||||
mount -t functionfs adb /dev/usb-ffs/adb/
|
||||
/usr/bin/adbd &
|
||||
for i in $(seq 1 40); do
|
||||
if [ -e /dev/usb-ffs/adb/ep2 ]; then
|
||||
break
|
||||
fi
|
||||
sleep 0.1
|
||||
done
|
||||
fi
|
||||
while true; do
|
||||
ls /sys/class/udc/ | cat > UDC || true
|
||||
res=$(cat UDC)
|
||||
if [[ "x$res" != "x" ]]; then
|
||||
break
|
||||
fi
|
||||
sleep 0.4
|
||||
done
|
||||
echo device > /proc/cviusb/otg_role
|
||||
fi
|
||||
fi
|
||||
|
||||
@@ -41,6 +41,13 @@ BR2_PACKAGE_AIC8800_SDIO_FIRMWARE=y
|
||||
|
||||
BR2_PACKAGE_CVITEK_RISCV64_MUSL_SYSROOT=y
|
||||
|
||||
BR2_PACKAGE_ANDROID_TOOLS=y
|
||||
BR2_PACKAGE_ANDROID_TOOLS_FASTBOOT_GOOD_KERNEL_HEADERS=y
|
||||
# BR2_PACKAGE_ANDROID_TOOLS_FASTBOOT is not set
|
||||
# BR2_PACKAGE_ANDROID_TOOLS_ADB is not set
|
||||
BR2_PACKAGE_ANDROID_TOOLS_ADBD=y
|
||||
# BR2_PACKAGE_HOST_ANDROID_TOOLS is not set
|
||||
|
||||
BR2_INIT_SYSV=y
|
||||
BR2_ROOTFS_MERGED_USR=y
|
||||
BR2_ENABLE_LOCALE_WHITELIST="C en_US en_US.utf8"
|
||||
|
||||
Reference in New Issue
Block a user