Gadget API. However I quickly discovered that this feature was not present in Ubuntu, even in the form of a kernel module in linux-extra. The only solution remaining was to rebuild the missing kernel module manually.
The main issue with a Linux kernel is that both the API and the ABI are not stable, meaning:
Now the proces was fairly simple.
linux-sourceto have the kernel sources matching the currently installed kernel.
This part is fairly easy.
dummy_hcdkmod from these sources and,
For a Makefile, you can retrieve the current version of the kernel from
uname plus some
Then extract and move the
dummy_hcd.c file from the current kernel source to the current folder.
Following the basic example found in the documentation.
First we should install DKMS.
Then add a
ls /usr/src/dummy_hcd-0.1/ along with the Makefile we previously created.
PACKAGE_NAME="dummy_hcd" PACKAGE_VERSION="0.1" CLEAN="make clean" MAKE="make all KVERSION=$kernelver" BUILT_MODULE_NAME="dummy_hcd" DEST_MODULE_LOCATION="/extra" AUTOINSTALL="yes"
We can then add our DKMS module to be built and added to our kernel modules.
Finally, we can test our module is working by loading it and mounting the Gadget Filesystem.
The complete project is published on Github.