Skip to content

Commit 6138ae8

Browse files
committed
Bump wireguard module to version 1.0.20211208
* Add option to choose whether to load built-in or external module * Bump openresolv version to 3.12.0
1 parent f1126ce commit 6138ae8

File tree

8 files changed

+27
-49
lines changed

8 files changed

+27
-49
lines changed

README.md

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,10 +22,10 @@ The Unifi UDM is built on a powerful quad core ARM64 CPU that can sustain up to
2222

2323

2424
## Install
25-
1. We first need to download the tar file onto the UDM. Connect to it via SSH and type the following command to download the tar file. You need to download the following tar file. NOTE: always [this link](https://github.com/tusc/wireguard-kmod/releases) check for the latest release.
25+
1. We first need to download the tar file onto the UDM. Connect to it via SSH and type the following command to download the tar file. You need to download the following tar file. NOTE: always check [this link](https://github.com/tusc/wireguard-kmod/releases) for the latest release.
2626

2727
```sh
28-
curl -LJo wireguard-kmod.tar.Z https://github.com/tusc/wireguard-kmod/releases/download/v11-05-21/wireguard-kmod-11-05-21.tar.Z
28+
curl -LJo wireguard-kmod.tar.Z https://github.com/tusc/wireguard-kmod/releases/download/v01-22-22/wireguard-kmod-01-22-22.tar.Z
2929
```
3030

3131
2. From this directory type the following to extract the files:
@@ -54,6 +54,8 @@ The Unifi UDM is built on a powerful quad core ARM64 CPU that can sustain up to
5454
[13540.520126] wireguard: Copyright (C) 2015-2019 Jason A. Donenfeld <Jason@zx2c4.com>. All Rights Reserved.
5555
```
5656
57+
The script will first try to load the built-in wireguard module if it exists. If it doesn't exist, the external module provided by this package will be loaded instead. You can set `LOAD_BUILTIN=0` at the top of the `setup_wireguard.sh` script to always load the external module. Note that only recent UDM releases since 1.11.0 have the built-in module, and it is not always up-to-date.
58+
5759
The tar file includes other useful utils such as htop, iftop and [qrencode.](#faq)
5860

5961
## Build from source

src/bases/udm-1.11.0/kernel-config

Lines changed: 1 addition & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -3730,44 +3730,7 @@ CONFIG_PSTORE_PMSG=y
37303730
CONFIG_PSTORE_RAM=y
37313731
# CONFIG_SYSV_FS is not set
37323732
# CONFIG_UFS_FS is not set
3733-
CONFIG_NETWORK_FILESYSTEMS=y
3734-
CONFIG_NFS_FS=m
3735-
CONFIG_NFS_V2=m
3736-
CONFIG_NFS_V3=m
3737-
# CONFIG_NFS_V3_ACL is not set
3738-
CONFIG_NFS_V4=m
3739-
# CONFIG_NFS_SWAP is not set
3740-
# CONFIG_NFS_V4_1 is not set
3741-
# CONFIG_NFS_USE_LEGACY_DNS is not set
3742-
CONFIG_NFS_USE_KERNEL_DNS=y
3743-
CONFIG_NFSD=m
3744-
CONFIG_NFSD_V3=y
3745-
# CONFIG_NFSD_V3_ACL is not set
3746-
CONFIG_NFSD_V4=y
3747-
# CONFIG_NFSD_BLOCKLAYOUT is not set
3748-
# CONFIG_NFSD_SCSILAYOUT is not set
3749-
# CONFIG_NFSD_FLEXFILELAYOUT is not set
3750-
CONFIG_GRACE_PERIOD=m
3751-
CONFIG_LOCKD=m
3752-
CONFIG_LOCKD_V4=y
3753-
CONFIG_NFS_COMMON=y
3754-
CONFIG_SUNRPC=m
3755-
CONFIG_SUNRPC_GSS=m
3756-
CONFIG_RPCSEC_GSS_KRB5=m
3757-
# CONFIG_SUNRPC_DEBUG is not set
3758-
# CONFIG_CEPH_FS is not set
3759-
CONFIG_CIFS=m
3760-
# CONFIG_CIFS_STATS2 is not set
3761-
CONFIG_CIFS_ALLOW_INSECURE_LEGACY=y
3762-
# CONFIG_CIFS_WEAK_PW_HASH is not set
3763-
# CONFIG_CIFS_UPCALL is not set
3764-
# CONFIG_CIFS_XATTR is not set
3765-
CONFIG_CIFS_DEBUG=y
3766-
# CONFIG_CIFS_DEBUG2 is not set
3767-
# CONFIG_CIFS_DEBUG_DUMP_KEYS is not set
3768-
# CONFIG_CIFS_DFS_UPCALL is not set
3769-
# CONFIG_CODA_FS is not set
3770-
# CONFIG_AFS_FS is not set
3733+
# CONFIG_NETWORK_FILESYSTEMS is not set
37713734
CONFIG_NLS=y
37723735
CONFIG_NLS_DEFAULT="iso8859-1"
37733736
# CONFIG_NLS_CODEPAGE_437 is not set

src/build-wireguard.sh

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ do
7171
make wireguard-linux-compat-dirclean
7272
sed -i -e '/CONFIG_LOCALVERSION=/s/.*/CONFIG_LOCALVERSION="'$ver'"/' kernel-config
7373
make wireguard-linux-compat-rebuild -j6
74-
cp ./output/build/wireguard-linux-compat-1.0.20210606/src/wireguard.ko ../wireguard/modules/wireguard-${prefix}${ver}.ko
74+
cp ./output/build/wireguard-linux-compat-1.0.20211208/src/wireguard.ko ../wireguard/modules/wireguard-${prefix}${ver}.ko
7575
# the netfiler raw module is required in the wg-quick script for iptables-restore
7676
cp ./output/build/linux-custom/net/ipv4/netfilter/iptable_raw.ko ../wireguard/modules/iptable_raw-${prefix}${ver}.ko
7777
cp ./output/build/linux-custom/net/ipv6/netfilter/ip6table_raw.ko ../wireguard/modules/ip6table_raw-${prefix}${ver}.ko
@@ -87,7 +87,17 @@ if [ ! -f "../wireguard/usr/sbin/iftop" ]; then
8787
mkdir -p ../wireguard/sbin
8888

8989
# Use 1.9.0-10 buildroot config for utilities
90-
cp ../bases/udm-1.9.0-10/buildroot-config.txt ./.config
90+
base="../bases/udm-1.9.0-10"
91+
cp "${base}/buildroot-config.txt" ./.config
92+
cp "${base}/kernel-config" ./
93+
rm -rf ./linux-patches ./patches
94+
if [ -d "${base}/linux-patches" ]; then
95+
cp -rf "${base}/linux-patches" ./
96+
fi
97+
if [ -d "${base}/patches" ]; then
98+
cp -rf "${base}/patches" ./
99+
fi
100+
rm -rf output/build/linux-*
91101

92102
make wireguard-tools-rebuild
93103
cp ./output/target/usr/bin/wg ../wireguard/usr/bin
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
# Locally calculated
2-
sha256 7d74c669849183ecefdfcec30d25664b1ca24ba1ca8c2ad5de50fcaeef3b4810 openresolv-3.10.0.tar.gz
2+
sha256 96b573e26d145f208d3758c2cd6fbf824b01005fc4cb7cedbdae29b3a3c8cb02 openresolv-3.12.0.tar.gz
33
sha256 384740bf5e19e7628d20f4dcc22925062fdc6020e9a6f074e567d4d797be57a0 LICENSE

src/packages/openresolv/openresolv.mk

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
#
55
################################################################################
66

7-
OPENRESOLV_VERSION = 3.10.0
7+
OPENRESOLV_VERSION = 3.12.0
88
OPENRESOLV_SITE = $(call github,rsmarples,openresolv,openresolv-$(OPENRESOLV_VERSION))
99
OPENRESOLV_LICENSE = BSD-2-Clause
1010
OPENRESOLV_LICENSE_FILES = LICENSE
Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
# https://lists.zx2c4.com/pipermail/wireguard/2020-April/005296.html
2-
sha256 cf166348fbb67419528e73049ce001d29131aea367fa6aef9d3e223f7251e116 wireguard-linux-compat-1.0.20200413.tar.xz
31
# Locally calculated
42
sha256 8177f97513213526df2cf6184d8ff986c675afb514d4e68a404010521b880643 COPYING
5-
sha256 3f5d990006e6eabfd692d925ec314fff2c5ee7dcdb869a6510d579acfdd84ec0 wireguard-linux-compat-1.0.20210606.tar.xz
3+
sha256 c0e607138a17daac656f508d8e63ea3737b5221fa5d9288191ddeb099f5a3b92 wireguard-linux-compat-1.0.20211208.tar.xz

src/packages/wireguard-linux-compat/wireguard-linux-compat.mk

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
#
55
################################################################################
66

7-
WIREGUARD_LINUX_COMPAT_VERSION = 1.0.20210606
7+
WIREGUARD_LINUX_COMPAT_VERSION = 1.0.20211208
88
WIREGUARD_LINUX_COMPAT_SITE = https://git.zx2c4.com/wireguard-linux-compat/snapshot
99
WIREGUARD_LINUX_COMPAT_SOURCE = wireguard-linux-compat-$(WIREGUARD_LINUX_COMPAT_VERSION).tar.xz
1010
WIREGUARD_LINUX_COMPAT_LICENSE = GPL-2.0

src/wireguard/setup_wireguard.sh

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,11 @@
77
# v4-10-21 Updated release to include utils such as htop, iftop and qrencode. The last one allows easy import of wireguard configs
88
# into your IOS/Android WireGuard client using QR codes.
99
# v6-23-21 Added support for resolvconf
10+
11+
# Set this to 1 to try to load the built-in wireguard module first. External module will still be loaded if built-in one doesn't exist.
12+
# Set to 0 to only load external module.
13+
LOAD_BUILTIN=1
14+
1015
DATA_DIR="."
1116
if [ -d "/mnt/data" ]; then
1217
DATA_DIR="/mnt/data"
@@ -50,7 +55,7 @@ if [ $? -eq 1 ]
5055
then
5156
ver=`uname -r`
5257
echo "loading wireguard..."
53-
if [ -e /lib/modules/$ver/extra/wireguard.ko ]; then
58+
if [ "$LOAD_BUILTIN" = "1" -a -e /lib/modules/$ver/extra/wireguard.ko ]; then
5459
modprobe wireguard
5560
elif [ -e $WIREGUARD/modules/wireguard-$ver.ko ]; then
5661
insmod $WIREGUARD/modules/wireguard-$ver.ko

0 commit comments

Comments
 (0)