Introduction
~~~~~~~~~~~~~~~
USB gadget is a mode of Linux USB port handling when Linux is not driving
the port as a host port, but as a device - this lets Linux act as a mass
storage (usb hdd, usb cdrom, etc.), a hid device (mouse, keyboard), a
webcam, etc.
Orange PI and some other cheap arm boards feature an OTG port; OTG means
on-the-go: the electronics implements both host and device roles, the software
driver can change the role any time. The Linux kernel calls device mode
drivers "gadgets".
Converting one of the ports to a gadget is often useful:
- the cheap arm board can become the hardware implementation of a complex
USB peripheral for a PC
- an arm mini-server can expose some of its internals over the USB to a PC,
e.g. an orange PI used as a NAS also mountable as a mass storage over USB
- a second ethernet port using g_ether
How to set it up
~~~~~~~~~~~~~~~~~~~
As of Jun 2016, the following process worked for