From 5ab4bafbebf7bf6ef65e753fbf7ccc5dae4b75c7 Mon Sep 17 00:00:00 2001 From: Jonah Weissman Date: Wed, 17 Feb 2021 16:48:31 -0500 Subject: [PATCH 1/6] Update wireguard and clean up recipe --- package/wireguard/package | 26 +++++++++++--------------- 1 file changed, 11 insertions(+), 15 deletions(-) diff --git a/package/wireguard/package b/package/wireguard/package index 3a5dc9eb5..8ca57d9a7 100755 --- a/package/wireguard/package +++ b/package/wireguard/package @@ -5,12 +5,11 @@ pkgnames=(wireguard) pkgdesc="Fast, modern, secure VPN tunnel" url=https://www.wireguard.com -_wireguardver=1.0.20201221 -pkgver=$_wireguardver-1 -timestamp=2020-12-21T11:54Z +pkgver=1.0.20210124-1 +timestamp=2021-01-24T13:45Z section=utils maintainer="Jonah Weissman " -license=GPL-2.0 +license=GPL-2.0-only depends=(wireguard-tools) flags=(nostrip) @@ -23,14 +22,10 @@ _defconfigs=( arch/arm/configs/zero-gravitas_defconfig arch/arm/configs/zero-sugar_defconfig ) -_moddirs=( - 4.9.84-zero-gravitas - 4.14.78 -) image=base:v1.2.1 -source=(https://git.zx2c4.com/wireguard-linux-compat/snapshot/wireguard-linux-compat-"$_wireguardver".zip) -sha256sums=(c74cedb10c9b830d937b5575e4b7d2625a8534d2c06a80368e5530db23e69d3b) +source=("https://git.zx2c4.com/wireguard-linux-compat/snapshot/wireguard-linux-compat-${pkgver%-*}.tar.xz") +sha256sums=(dac6e68cd4c3db441499850dfa8a70706384a3295f37fda1b839a50b79faef54) build() { apt-get update @@ -43,23 +38,24 @@ build() { for i in $(seq 0 1); do git fetch --depth=1 "$_kernelrepo" "${_kernelrevs[$i]}" git checkout -f "${_kernelrevs[$i]}" + make mrproper touch .scmversion cp "${_defconfigs[$i]}" .config echo "CONFIG_NET_FOU=m" >> .config make olddefconfig - make modules + make net/ipv4/udp_tunnel.ko + make net/ipv6/ip6_udp_tunnel.ko make modules_prepare - # make wireguard.ko - KERNELDIR=$(pwd) make -C src/ - export MOD_INSTALL_PATH=".pc/${_moddirs[$i]}" + make -C src/ "KERNELDIR=$(pwd)" + KERNELRELEASE=$(cat include/config/kernel.release) + export MOD_INSTALL_PATH=".pc/$KERNELRELEASE" install -D -m 644 net/ipv4/udp_tunnel.ko \ "$MOD_INSTALL_PATH/kernel/net/ipv4/udp_tunnel.ko" install -D -m 644 net/ipv6/ip6_udp_tunnel.ko \ "$MOD_INSTALL_PATH/kernel/net/ipv6/ip6_udp_tunnel.ko" install -D -m 644 src/wireguard.ko \ "$MOD_INSTALL_PATH/extra/wireguard.ko" - make mrproper done } From 774812dbd815d25baa77d16964043846cc9073ee Mon Sep 17 00:00:00 2001 From: Jonah Weissman Date: Wed, 17 Feb 2021 17:52:49 -0500 Subject: [PATCH 2/6] Create wg-tools package --- package/wireguard-tools/package | 39 +++++++++++++++++++++++++++++++++ package/wireguard/package | 2 +- 2 files changed, 40 insertions(+), 1 deletion(-) create mode 100755 package/wireguard-tools/package diff --git a/package/wireguard-tools/package b/package/wireguard-tools/package new file mode 100755 index 000000000..391fdf1f2 --- /dev/null +++ b/package/wireguard-tools/package @@ -0,0 +1,39 @@ +#!/usr/bin/env bash +# Copyright (c) 2020 The Toltec Contributors +# SPDX-License-Identifier: MIT + +pkgnames=(wg-tools) +pkgdesc="WireGuard userspace control programs (wg and wg-quick)" +url=https://www.wireguard.com +pkgver=1.0.20200827-1 +timestamp=2020-08-27T08:22Z +section=utils +maintainer="Jonah Weissman " +license=GPL-2.0-only + +image=base:v1.3.2 +source=( + "https://git.zx2c4.com/wireguard-tools/snapshot/wireguard-tools-${pkgver%-*}.tar.xz" +) +noextract=("wireguard-tools-${pkgver%-*}.tar.xz") +sha256sums=(51bc85e33a5b3cf353786ae64b0f1216d7a871447f058b6137f793eb0f53b7fd) + +prepare() { + bsdtar -x \ + --directory "$srcdir" \ + --file "$srcdir/"wireguard-tools-1.0.20200827.tar.xz + mv "$srcdir/"wireguard-tools-1.0.20200827/* "$srcdir" + # the symlink at src/wg-quick/wg needs something to point to + touch "$srcdir/src/wg" +} + +build() { + make -C src PLATFORM=linux "CC=${CROSS_COMPILE}cc" +} + +package() { + make -C "$srcdir/src" DESTDIR="$pkgdir/" WITH_WGQUICK=yes \ + WITH_SYSTEMDUNITS=yes WITH_BASHCOMPLETION=no install + # remove man pages + rm -r "${pkgdir:?}/usr/share" +} diff --git a/package/wireguard/package b/package/wireguard/package index 8ca57d9a7..58c76cb08 100755 --- a/package/wireguard/package +++ b/package/wireguard/package @@ -10,7 +10,7 @@ timestamp=2021-01-24T13:45Z section=utils maintainer="Jonah Weissman " license=GPL-2.0-only -depends=(wireguard-tools) +depends=(wg-tools) flags=(nostrip) _kernelrepo=https://github.com/remarkable/linux From dca12c24cc73736bf4ea5bb7fcde02d193ad97f8 Mon Sep 17 00:00:00 2001 From: Jonah Weissman Date: Fri, 19 Feb 2021 17:01:43 -0500 Subject: [PATCH 3/6] Update wireguard to 1.0.20210219 --- package/wireguard/package | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/package/wireguard/package b/package/wireguard/package index 58c76cb08..ceb03e9c3 100755 --- a/package/wireguard/package +++ b/package/wireguard/package @@ -5,7 +5,7 @@ pkgnames=(wireguard) pkgdesc="Fast, modern, secure VPN tunnel" url=https://www.wireguard.com -pkgver=1.0.20210124-1 +pkgver=1.0.20210219-1 timestamp=2021-01-24T13:45Z section=utils maintainer="Jonah Weissman " @@ -25,7 +25,7 @@ _defconfigs=( image=base:v1.2.1 source=("https://git.zx2c4.com/wireguard-linux-compat/snapshot/wireguard-linux-compat-${pkgver%-*}.tar.xz") -sha256sums=(dac6e68cd4c3db441499850dfa8a70706384a3295f37fda1b839a50b79faef54) +sha256sums=(99d35296b8d847a0d4db97a4dda96b464311a6354e75fe0bef6e7c4578690f00) build() { apt-get update From 50c629194a2e25667a840dc43ca0b6703abe922b Mon Sep 17 00:00:00 2001 From: Jonah Weissman Date: Sun, 21 Feb 2021 23:11:19 -0500 Subject: [PATCH 4/6] Include man pages --- package/wireguard-tools/package | 2 -- 1 file changed, 2 deletions(-) diff --git a/package/wireguard-tools/package b/package/wireguard-tools/package index 391fdf1f2..2e77545ed 100755 --- a/package/wireguard-tools/package +++ b/package/wireguard-tools/package @@ -34,6 +34,4 @@ build() { package() { make -C "$srcdir/src" DESTDIR="$pkgdir/" WITH_WGQUICK=yes \ WITH_SYSTEMDUNITS=yes WITH_BASHCOMPLETION=no install - # remove man pages - rm -r "${pkgdir:?}/usr/share" } From 6018ec085a2b1b5a3ed9c0ec94bde0e0729e9e0c Mon Sep 17 00:00:00 2001 From: Jonah Weissman Date: Mon, 1 Mar 2021 16:47:16 -0500 Subject: [PATCH 5/6] Add wireguard-tools files to wireguard --- package/wireguard/package | 69 +++++++++++++++++++++++++-------------- 1 file changed, 45 insertions(+), 24 deletions(-) diff --git a/package/wireguard/package b/package/wireguard/package index ceb03e9c3..a753baaa3 100755 --- a/package/wireguard/package +++ b/package/wireguard/package @@ -6,11 +6,11 @@ pkgnames=(wireguard) pkgdesc="Fast, modern, secure VPN tunnel" url=https://www.wireguard.com pkgver=1.0.20210219-1 +_wireguardtoolsver=1.0.20210223 timestamp=2021-01-24T13:45Z section=utils maintainer="Jonah Weissman " license=GPL-2.0-only -depends=(wg-tools) flags=(nostrip) _kernelrepo=https://github.com/remarkable/linux @@ -23,36 +23,55 @@ _defconfigs=( arch/arm/configs/zero-sugar_defconfig ) -image=base:v1.2.1 -source=("https://git.zx2c4.com/wireguard-linux-compat/snapshot/wireguard-linux-compat-${pkgver%-*}.tar.xz") -sha256sums=(99d35296b8d847a0d4db97a4dda96b464311a6354e75fe0bef6e7c4578690f00) +image=base:v1.3.2 +source=( + "https://git.zx2c4.com/wireguard-linux-compat/snapshot/wireguard-linux-compat-${pkgver%-*}.tar.xz" + "https://git.zx2c4.com/wireguard-tools/snapshot/wireguard-tools-${_wireguardtoolsver}.tar.xz" +) +noextract=("wireguard-tools-${_wireguardtoolsver}.tar.xz") +sha256sums=( + 99d35296b8d847a0d4db97a4dda96b464311a6354e75fe0bef6e7c4578690f00 + 1f72da217044622d79e0bab57779e136a3df795e3761a3fc1dc0941a9055877c +) + +prepare() { + bsdtar -x \ + --directory "$srcdir" \ + --file "$srcdir/wireguard-tools-${_wireguardtoolsver}.tar.xz" + mv "$srcdir/wireguard-tools-${_wireguardtoolsver}" "$srcdir/wireguard-tools" + # the symlink at src/wg-quick/wg needs something to point to + touch "$srcdir/wireguard-tools/src/wg" +} build() { + make -C wireguard-tools/src PLATFORM=linux "CC=${CROSS_COMPILE}cc" + apt-get update apt-get install -y bc lzop git - # we will save the generated files in .pc, - # so that they will not be deleted by `make mrproper` - mkdir .pc - git init + mkdir pkg + git init linux for i in $(seq 0 1); do - git fetch --depth=1 "$_kernelrepo" "${_kernelrevs[$i]}" - git checkout -f "${_kernelrevs[$i]}" - make mrproper - touch .scmversion - cp "${_defconfigs[$i]}" .config - echo "CONFIG_NET_FOU=m" >> .config - make olddefconfig - make net/ipv4/udp_tunnel.ko - make net/ipv6/ip6_udp_tunnel.ko - make modules_prepare + ( + cd linux + git fetch --depth=1 "$_kernelrepo" "${_kernelrevs[$i]}" + git checkout -f "${_kernelrevs[$i]}" + make mrproper + touch .scmversion + cp "${_defconfigs[$i]}" .config + echo "CONFIG_NET_FOU=m" >> .config + make olddefconfig + make net/ipv4/udp_tunnel.ko + make net/ipv6/ip6_udp_tunnel.ko + make modules_prepare + ) - make -C src/ "KERNELDIR=$(pwd)" - KERNELRELEASE=$(cat include/config/kernel.release) - export MOD_INSTALL_PATH=".pc/$KERNELRELEASE" - install -D -m 644 net/ipv4/udp_tunnel.ko \ + make -C src/ "KERNELDIR=$(realpath linux)" + KERNELRELEASE=$(cat linux/include/config/kernel.release) + export MOD_INSTALL_PATH="pkg/$KERNELRELEASE" + install -D -m 644 linux/net/ipv4/udp_tunnel.ko \ "$MOD_INSTALL_PATH/kernel/net/ipv4/udp_tunnel.ko" - install -D -m 644 net/ipv6/ip6_udp_tunnel.ko \ + install -D -m 644 linux/net/ipv6/ip6_udp_tunnel.ko \ "$MOD_INSTALL_PATH/kernel/net/ipv6/ip6_udp_tunnel.ko" install -D -m 644 src/wireguard.ko \ "$MOD_INSTALL_PATH/extra/wireguard.ko" @@ -60,8 +79,10 @@ build() { } package() { + make -C "$srcdir/wireguard-tools/src" DESTDIR="$pkgdir" WITH_WGQUICK=yes \ + WITH_SYSTEMDUNITS=yes WITH_BASHCOMPLETION=no install mkdir -p "$pkgdir/lib/modules" - cp -r "$srcdir/.pc"/* "$pkgdir/lib/modules" + cp -r "$srcdir/pkg"/* "$pkgdir/lib/modules" } configure() { From 45989ac7902be8f0d81415beee2a882d046b9c5b Mon Sep 17 00:00:00 2001 From: Jonah Weissman Date: Mon, 1 Mar 2021 17:25:32 -0500 Subject: [PATCH 6/6] Remove separate wireguard-tools package --- package/wireguard-tools/package | 37 --------------------------------- 1 file changed, 37 deletions(-) delete mode 100755 package/wireguard-tools/package diff --git a/package/wireguard-tools/package b/package/wireguard-tools/package deleted file mode 100755 index 2e77545ed..000000000 --- a/package/wireguard-tools/package +++ /dev/null @@ -1,37 +0,0 @@ -#!/usr/bin/env bash -# Copyright (c) 2020 The Toltec Contributors -# SPDX-License-Identifier: MIT - -pkgnames=(wg-tools) -pkgdesc="WireGuard userspace control programs (wg and wg-quick)" -url=https://www.wireguard.com -pkgver=1.0.20200827-1 -timestamp=2020-08-27T08:22Z -section=utils -maintainer="Jonah Weissman " -license=GPL-2.0-only - -image=base:v1.3.2 -source=( - "https://git.zx2c4.com/wireguard-tools/snapshot/wireguard-tools-${pkgver%-*}.tar.xz" -) -noextract=("wireguard-tools-${pkgver%-*}.tar.xz") -sha256sums=(51bc85e33a5b3cf353786ae64b0f1216d7a871447f058b6137f793eb0f53b7fd) - -prepare() { - bsdtar -x \ - --directory "$srcdir" \ - --file "$srcdir/"wireguard-tools-1.0.20200827.tar.xz - mv "$srcdir/"wireguard-tools-1.0.20200827/* "$srcdir" - # the symlink at src/wg-quick/wg needs something to point to - touch "$srcdir/src/wg" -} - -build() { - make -C src PLATFORM=linux "CC=${CROSS_COMPILE}cc" -} - -package() { - make -C "$srcdir/src" DESTDIR="$pkgdir/" WITH_WGQUICK=yes \ - WITH_SYSTEMDUNITS=yes WITH_BASHCOMPLETION=no install -}