diff --git a/README.md b/README.md index 39980e1..29519c0 100644 --- a/README.md +++ b/README.md @@ -268,7 +268,7 @@ Once registered you can define the dockerfile to use with `-f Dockerfile.aarch64 ## Versions -* **19.06.20:** - Compile wireguard tools and kernel module instead of using the ubuntu packages. Make module install optional. Improve verbosity in logs. +* **19.06.20:** - Add support for Ubuntu Focal (20.04) kernels. Compile wireguard tools and kernel module instead of using the ubuntu packages. Make module install optional. Improve verbosity in logs. * **29.05.20:** - Add support for 64bit raspbian. * **28.04.20:** - Add Buster/Stretch backports repos for Debian. Tested with OMV 5 and OMV 4 (on kernel 4.19.0-0.bpo.8-amd64). * **20.04.20:** - Fix typo in client mode conf existence check. diff --git a/readme-vars.yml b/readme-vars.yml index f3ae4b9..f9966e5 100644 --- a/readme-vars.yml +++ b/readme-vars.yml @@ -85,7 +85,7 @@ app_setup_block: | # changelog changelogs: - - { date: "19.06.20:", desc: "Compile wireguard tools and kernel module instead of using the ubuntu packages. Make module install optional. Improve verbosity in logs." } + - { date: "19.06.20:", desc: "Add support for Ubuntu Focal (20.04) kernels. Compile wireguard tools and kernel module instead of using the ubuntu packages. Make module install optional. Improve verbosity in logs." } - { date: "29.05.20:", desc: "Add support for 64bit raspbian." } - { date: "28.04.20:", desc: "Add Buster/Stretch backports repos for Debian. Tested with OMV 5 and OMV 4 (on kernel 4.19.0-0.bpo.8-amd64)." } - { date: "20.04.20:", desc: "Fix typo in client mode conf existence check." } diff --git a/root/etc/cont-init.d/30-config b/root/etc/cont-init.d/30-config index 7e3236d..81dbd84 100644 --- a/root/etc/cont-init.d/30-config +++ b/root/etc/cont-init.d/30-config @@ -36,16 +36,32 @@ if [ "$SKIP_COMPILE" != "true" ]; then apt-get install -y \ raspberrypi-kernel-headers elif uname -v | grep -q 'Ubuntu'; then + echo "**** Ubuntu kernel detected, but likely not Bionic. ****" echo "**** Attempting to install kernel headers from Ubuntu Xenial repo ****" - echo -e \ - "deb http://archive.ubuntu.com/ubuntu/ xenial main restricted\ndeb-src http://archive.ubuntu.com/ubuntu/ xenial main restricted\n\ndeb http://archive.ubuntu.com/ubuntu/ xenial-updates main restricted\ndeb-src http://archive.ubuntu.com/ubuntu/ xenial-updates main restricted" \ - > /etc/apt/sources.list.d/xenial.list + if uname -m | grep -q 'x86_64'; then + echo -e \ + "deb http://archive.ubuntu.com/ubuntu/ xenial main restricted\ndeb-src http://archive.ubuntu.com/ubuntu/ xenial main restricted\n\ndeb http://archive.ubuntu.com/ubuntu/ xenial-updates main restricted\ndeb-src http://archive.ubuntu.com/ubuntu/ xenial-updates main restricted" \ + > /etc/apt/sources.list.d/xenial-focal.list + else + echo -e \ + "deb http://ports.ubuntu.com/ubuntu-ports/ xenial main restricted\ndeb-src http://ports.ubuntu.com/ubuntu-ports/ xenial main restricted\n\ndeb http://ports.ubuntu.com/ubuntu-ports/ xenial-updates main restricted\ndeb-src http://ports.ubuntu.com/ubuntu-ports/ xenial-updates main restricted" \ + > /etc/apt/sources.list.d/xenial-focal.list + fi apt-get update if apt-cache show linux-headers-$(uname -r) 2&>1 >/dev/null; then apt-get install -y \ linux-headers-$(uname -r) else - echo "**** No kernel headers found in the Ubuntu repos!! Will try the headers from host (if mapped), may or may not work ****" + echo "**** No kernel headers found in the Ubuntu Xenial repo!! Trying Ubuntu Focal. ****" + sed -i 's/xenial/focal/g' /etc/apt/sources.list.d/xenial-focal.list + apt-get update + if apt-cache show linux-headers-$(uname -r) 2&>1 >/dev/null; then + apt-get install -y \ + linux-headers-$(uname -r) + else + echo "**** No kernel headers found in the Ubuntu repos!! Will try the headers from host (if mapped), may or may not work ****" + rm -rf /etc/apt/sources.list.d/xenial-focal.list + fi fi elif uname -v | grep -q 'Debian'; then echo "**** Debian host detected, attempting to install kernel headers from Debian Buster repo ****" @@ -79,6 +95,7 @@ if [ "$SKIP_COMPILE" != "true" ]; then fi else echo "**** No kernel headers found in Debian repos!! Will try the headers from host (if mapped), may or may not work ****" + rm -rf /etc/apt/sources.list.d/debian.list fi fi else