-
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
-
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
-
Check that the UDM kernel sources downloaded correctly by examining that their file sizes are ~100MB+ each.
ls -lh bases/*.tar.gz
- If the size is a few bytes instead of 100MB, then the kernel sources did not download correctly. This is most probably due to Git LFS not being installed or the LFS quota being exceeded.
- If you are having trouble with Git LFS, you can try to download the files manually through the GitHub web interface or one of these mirrors:
-
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 exampleudm-<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 otherversions.txt
files for what it should look like.
- Your firmware version can be found by running
-
Run
build-wireguard.sh
in this directory to build the wireguard module and utilities for each version in theversions.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.
-
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
- You can transfer the tarball or modules to your UDM using
- The newly built kernel modules and utilities under the
-
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/*