Skip to content

Latest commit

 

History

History
49 lines (29 loc) · 2.04 KB

README.md

File metadata and controls

49 lines (29 loc) · 2.04 KB

Raw Gadget Kernel Module

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).

Building and loading

  1. 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.

  2. 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.195.18 kernels, apply the revert of the USB: gadget: Rename usb_gadget_probe_driver() patch via git apply ./patches/usb_gadget_probe_driver.patch.

    For building Raw Gadget on 4.144.18 kernels, manually revert the usb: 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.

  3. Build the module:

    make
  4. Load the module:

    ./insmod.sh

Updating

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.