Skip to content

Commit

Permalink
Wireguard support
Browse files Browse the repository at this point in the history
  • Loading branch information
dclark committed Apr 11, 2020
1 parent 0c87896 commit c4e139c
Show file tree
Hide file tree
Showing 2 changed files with 40 additions and 24 deletions.
53 changes: 30 additions & 23 deletions Dockerfile.dapper
Original file line number Diff line number Diff line change
Expand Up @@ -7,37 +7,40 @@ ARG LINUX_SOURCE=linux-source-5.0.0=5.0.0-43.47~18.04.1

ENV DEBIAN_FRONTEND=noninteractive
RUN set -x \
&& apt-get --assume-yes update \
&& apt-get --assume-yes download \
&& apt-get --assume-yes update \
&& apt-get --assume-yes download \
${LINUX_FIRMWARE} \
${LINUX_SOURCE} \
&& mkdir -vp ${DOWNLOADS} \
&& mv -vf linux-firmware* ${DOWNLOADS}/ubuntu-firmware.deb \
&& mv -vf linux-source* ${DOWNLOADS}/ubuntu-kernel.deb

&& mkdir -vp ${DOWNLOADS} \
&& mv -vf linux-firmware* ${DOWNLOADS}/ubuntu-firmware.deb \
&& mv -vf linux-source* ${DOWNLOADS}/ubuntu-kernel.deb

FROM ${APT_GCC}
ARG DOWNLOADS=/usr/src/downloads
# Wireguard support, included in Linux in 5.6+
ARG WG_URL="https://git.zx2c4.com"
ARG WG_REPO="wireguard-linux-compat"
ARG WG_TAG=v1.0.20200401
COPY --from=bionic ${DOWNLOADS}/ ${DOWNLOADS}/
RUN apt-get update \
&& apt-get install -y \
kernel-wedge \
libncurses-dev \
fakeroot \
cpio \
bison \
flex \
ccache \
vim \
gnupg2 \
locales \
bc \
kmod \
libelf-dev \
rsync \
gawk \
libudev-dev \
pciutils-dev \
kernel-wedge \
libncurses-dev \
fakeroot \
cpio \
bison \
flex \
ccache \
vim \
gnupg2 \
locales \
bc \
kmod \
libelf-dev \
rsync \
gawk \
libudev-dev \
pciutils-dev \
&& rm -f /bin/sh && ln -s /bin/bash /bin/sh

########## Dapper Configuration #####################
Expand All @@ -54,6 +57,10 @@ WORKDIR ${DAPPER_SOURCE}
ARG DAPPER_HOST_ARCH
ENV ARCH $DAPPER_HOST_ARCH
ENV DOWNLOADS ${DOWNLOADS}
ENV WG_URL=${WG_URL}
ENV WG_REPO=${WG_REPO}
ENV WG_TAG=${WG_TAG}


ENTRYPOINT ["./scripts/entry"]
CMD ["ci"]
11 changes: 10 additions & 1 deletion scripts/prepare
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,17 @@ tar xf ${DOWNLOADS}/kernel/usr/src/linux-source-*/linux-source*.tar.bz2 -C ./bui
# patches
PATCHES_DIR=$(pwd)/patches
pushd build/kernel
for p in `find ${PATCHES_DIR} -name "*.patch"`; do
for p in $(find ${PATCHES_DIR} -name "*.patch"); do
echo "applying $p"
patch -p1 -i $p
done

# https://www.wireguard.com/compilation/
WG_DIR=$(mktemp -d)
git clone "${WG_URL}/${WG_REPO}" -b "$WG_TAG" "$WG_DIR"
"${WG_DIR}/kernel-tree-scripts/create-patch.sh" | patch -p1
CONFIG="debian.hwe/config/config.common.ubuntu"
echo CONFIG_WIREGUARD=m >>$CONFIG
echo CONFIG_WIREGUARD_DEBUG=n >>$CONFIG

popd

0 comments on commit c4e139c

Please sign in to comment.