This directory contains a copy of the Raw Gadget module source code patched to allow out-of-tree building.
This code is provided only for convenience;
Raw Gadget is maintained as a part of the mainline Linux kernel source code (merged in 5.7
).
-
Install the Linux kernel headers.
On a desktop Ubuntu, you can get them by installing
linux-headers-`uname -r`
.On a Raspberry Pi, follow these instructions.
-
Depending on the used kernel version, possibly patch the Raw Gadget module source code.
For
5.19+
kernels, no patching should be required.For building Raw Gadget on
4.19
–5.18
kernels, apply the revert of theUSB: gadget: Rename usb_gadget_probe_driver()
patch viagit apply ./patches/usb_gadget_probe_driver.patch
.For building Raw Gadget on
4.14
–4.18
kernels, manually revert theusb: gadget: Fix non-unique driver names in raw-gadget driver
patch.Building Raw Gadget on kernels older than
4.14
might be possible but not supported. -
Build the module:
make
-
Load the module:
./insmod.sh
You can optionally update the Raw Gadget module source code to fetch the changes from the usb-next
Raw Gadget version:
./update.sh
Note:
Do not run the updating script if you're on the dev
branch: it will revert all changes applied to that branch.