From 42c51fab2bb273fe4f2a307ffde89361a71c1c8e Mon Sep 17 00:00:00 2001 From: Rolf Neugebauer Date: Fri, 10 Apr 2020 11:25:40 +0100 Subject: [PATCH] kernel: Use in kernel WireGuard if present 5.6.x has WireGuard upstream. Skip pulling it for kernel where WireGuard is present. Signed-off-by: Rolf Neugebauer --- kernel/Dockerfile | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/kernel/Dockerfile b/kernel/Dockerfile index 8823d3ac7..9ae47b95d 100644 --- a/kernel/Dockerfile +++ b/kernel/Dockerfile @@ -163,12 +163,14 @@ RUN case $(uname -m) in \ cp System.map /out && \ ([ -n "${DEBUG}" ] && cp vmlinux /out || true) -# WireGuard -RUN curl -fsSL -o /wireguard.tar.xz "${WIREGUARD_URL}" && \ - echo "${WIREGUARD_SHA256} /wireguard.tar.xz" | sha256sum -c - && \ - cp /wireguard.tar.xz /out/src/ && \ - tar -C / --one-top-level=wireguard --strip-components=2 -xJf /wireguard.tar.xz "wireguard-linux-compat-${WIREGUARD_VERSION}/src" && \ - make -j "$(getconf _NPROCESSORS_ONLN)" M="/wireguard" modules +# WireGuard (skip kernels which have it in tree) +RUN if [ ! -d /linux/drivers/net/wireguard ]; then \ + curl -fsSL -o /wireguard.tar.xz "${WIREGUARD_URL}" && \ + echo "${WIREGUARD_SHA256} /wireguard.tar.xz" | sha256sum -c - && \ + cp /wireguard.tar.xz /out/src/ && \ + tar -C / --one-top-level=wireguard --strip-components=2 -xJf /wireguard.tar.xz "wireguard-linux-compat-${WIREGUARD_VERSION}/src" && \ + make -j "$(getconf _NPROCESSORS_ONLN)" M="/wireguard" modules; \ + fi # Modules and Device Tree binaries RUN make INSTALL_MOD_PATH=/tmp/kernel-modules modules_install && \