summaryrefslogtreecommitdiff
path: root/packages/linux-kernel/build-wireguard-modules.sh
diff options
context:
space:
mode:
authorChristian Poessinger <christian@poessinger.com>2020-06-24 20:16:04 +0200
committerChristian Poessinger <christian@poessinger.com>2020-06-24 21:04:17 +0200
commitc1abd123989f82feca0223bbb462bce3a62fc618 (patch)
tree07762da1874f97c4bf8cb0b04398c649889847dd /packages/linux-kernel/build-wireguard-modules.sh
parent488ebdf6ca0de558dbbadcab1342f7625aa3a588 (diff)
downloadvyos-build-c1abd123989f82feca0223bbb462bce3a62fc618.tar.gz
vyos-build-c1abd123989f82feca0223bbb462bce3a62fc618.zip
Jenkins: T2625: import Kernel Pipeline
Imported from https://github.com/vyos/vyos-build-kernel commit 9e7c12b
Diffstat (limited to 'packages/linux-kernel/build-wireguard-modules.sh')
-rwxr-xr-xpackages/linux-kernel/build-wireguard-modules.sh30
1 files changed, 30 insertions, 0 deletions
diff --git a/packages/linux-kernel/build-wireguard-modules.sh b/packages/linux-kernel/build-wireguard-modules.sh
new file mode 100755
index 00000000..c45aa2b4
--- /dev/null
+++ b/packages/linux-kernel/build-wireguard-modules.sh
@@ -0,0 +1,30 @@
+#!/bin/sh
+CWD=$(pwd)
+KERNEL_VAR_FILE=${CWD}/kernel-vars
+WIREGUARD_SRC=${CWD}/wireguard-linux-compat
+
+if [ ! -d ${WIREGUARD_SRC} ]; then
+ echo "WireGuard source not found"
+ exit 1
+fi
+
+if [ ! -f ${KERNEL_VAR_FILE} ]; then
+ echo "Kernel variable file '${KERNEL_VAR_FILE}' does not exist, run ./build_kernel.sh first"
+ exit 1
+fi
+
+. ${KERNEL_VAR_FILE}
+cd ${WIREGUARD_SRC}
+
+# We need some WireGuard patches for building, it's easier to have them here
+# and make use of the upstream repository instead of maintaining a full fork,
+# saving time/resources is essential :-)
+PATCH_DIR=${CWD}/patches/wireguard-linux-compat
+for patch in $(ls ${PATCH_DIR})
+do
+ echo "I: Apply WireGuard patch: ${PATCH_DIR}/${patch}"
+ patch -p1 < ${PATCH_DIR}/${patch}
+done
+
+echo "I: Build Debian WireGuard package"
+KERNELDIR=$KERNEL_DIR dpkg-buildpackage -b -us -uc -tc