Andrzej Pietrasiewicz of Samsung submitted an interesting patch about
FunctionFS:
https://android-review.googlesource.com/#/c/31640/
It demonstrates the possibility of using adbd (Android Debug Bridge
daemon) with
a generic FunctionFS gadget instead of a custom adb usb gadget in the
Linux kernel.
The patch adds a replacement usb access layer to adbd: it adds a new layer as
a copy of an existing usb_linux_client.c and introduces
FunctionFS support proper on top of the copied layer. The former usb access
method is still available, the method is chosen at compilation time by
setting USE_USB_FUNCFS variable to false in adb's Android.mk in the section
dedicated to adbd.
How to use on the target device:
$ insmod g_ffs.ko idVendor=<vendor ID> iSerialNumber=<some string>
$ mount -t functionfs adb /dev/usbgadget/adb -o uid=2000,gid=2000
$ ./adbd
Sincerely,
Jim Huang (jserv)
http://0xlab.org/