Skip to content

Latest commit

 

History

History
52 lines (36 loc) · 2.99 KB

README.building.md

File metadata and controls

52 lines (36 loc) · 2.99 KB

Building the Kernel Module

  1. Make sure you have Git LFS installed on your system, which you will need to download the kernel sources. This is sometimes an extra package you have to download from your distro's package manager. Once you install it, make sure to run the following to install LFS:

    git lfs install
  2. Clone the wireguard-kmod repository onto your computer and cd into it.

    git clone https://github.com/tusc/wireguard-kmod.git
    cd wireguard-kmod/src
  3. Check that the UDM kernel sources downloaded correctly by examining that their file sizes are ~100MB+ each.

    ls -lh bases/*.tar.gz
  4. The build is divided into multiple kernel bases, where each kernel base is used for multiple firmware versions. Add any custom versions you want to build to the versions.txt file in the correct base folder (for example udm-<BASE_VERSION>).

    • Your firmware version can be found by running uname -r on the UDM and taking the end -vX.Y.Z.xxxx-yyyyyyy suffix, where X.Y.Z is your UDM version. Look at the other versions.txt files for what it should look like.
  5. Run build-wireguard.sh in this directory to build the wireguard module and utilities for each version in the versions.txt files.

    ./build-wireguard.sh
    • This will take anywhere from 20 minutes to a couple of hours depending on the CPU power of your system.
  6. If successful, you should find:

    • The newly built kernel modules and utilities under the wireguard directory in the current folder
    • A newly built tarball named wireguard-kmod-MM-DD-YY.tar.Z in the releases folder one directory up (../releases) that you can install on your UDM following the regular instructions in the main README.
      • You can transfer the tarball or modules to your UDM using scp. For example, assuming your UDM is at 192.168.1.254, the following command will transfer the tarball to the your UDM's /mnt/data directory.
        scp ../releases/wireguard-kmod-06-23-21.tar.Z [email protected]:/mnt/data
  7. If building multiple times, the build script will skip building previously built modules. If you want to force re-build everything, then delete the previously built modules and utilities from the wireguard folder first.

    rm -rf wireguard/*.ko wireguard/usr/*