Andrew Geissler | 72956ed | 2021-01-08 16:11:14 -0600 | [diff] [blame] | 1 | #!/bin/sh |
| 2 | |
| 3 | set -e |
| 4 | |
| 5 | manufacturer=RPB |
| 6 | model="Android device" |
| 7 | serial=0123456789ABCDEF |
| 8 | |
| 9 | if [ -r /etc/android-gadget-setup.machine ] ; then |
| 10 | . /etc/android-gadget-setup.machine |
| 11 | fi |
| 12 | |
| 13 | [ -d /sys/kernel/config/usb_gadget ] || modprobe libcomposite |
| 14 | |
| 15 | cd /sys/kernel/config/usb_gadget |
| 16 | |
| 17 | [ -d adb ] && /usr/bin/android-gadget-cleanup || true |
| 18 | |
| 19 | mkdir adb |
| 20 | cd adb |
| 21 | |
| 22 | mkdir configs/c.1 |
| 23 | mkdir functions/ffs.usb0 |
| 24 | mkdir strings/0x409 |
| 25 | mkdir configs/c.1/strings/0x409 |
Patrick Williams | 213cb26 | 2021-08-07 19:21:33 -0500 | [diff] [blame] | 26 | echo -n 0x18d1 > idVendor |
| 27 | echo -n 0xd002 > idProduct |
Andrew Geissler | 72956ed | 2021-01-08 16:11:14 -0600 | [diff] [blame] | 28 | echo "$serial" > strings/0x409/serialnumber |
| 29 | echo "$manufacturer" > strings/0x409/manufacturer |
| 30 | echo "$model" > strings/0x409/product |
| 31 | echo "Conf 1" > configs/c.1/strings/0x409/configuration |
| 32 | ln -s functions/ffs.usb0 configs/c.1 |
| 33 | |
| 34 | mkdir -p /dev/usb-ffs/adb |
| 35 | mount -t functionfs usb0 /dev/usb-ffs/adb |