From f120fab78fa8834de0ed5ae1ed7a20d2fc2bdd59 Mon Sep 17 00:00:00 2001 From: MichaIng Date: Fri, 10 Jun 2022 14:38:10 +0200 Subject: [PATCH 1/3] Add support for xz-compressed WireGuard kernel module which is the default since Linux 5.15. Signed-off-by: MichaIng --- auto_install/install.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/auto_install/install.sh b/auto_install/install.sh index 6652a39..cb567bd 100755 --- a/auto_install/install.sh +++ b/auto_install/install.sh @@ -492,7 +492,7 @@ preconfigurePackages(){ # and not part of the .deb). # Source: https://github.com/MichaIng/DietPi/blob/7bf5e1041f3b2972d7827c48215069d1c90eee07/dietpi/dietpi-software#L1807-L1815 WIREGUARD_BUILTIN=0 - for i in /lib/modules/**/wireguard.ko; do + for i in /lib/modules/**/wireguard.ko{,.xz}; do [[ -f $i ]] || continue dpkg-query -S "$i" &> /dev/null || continue WIREGUARD_BUILTIN=1 From d861de291867fe663a4169a40aec394ac4f8839a Mon Sep 17 00:00:00 2001 From: MichaIng Date: Fri, 10 Jun 2022 15:15:25 +0200 Subject: [PATCH 2/3] Add support for builtin WireGuard module in which case there is no dedicated file in /lib/modules. A rare case but possible. Additionally the recursive globbing has been replaced by dpkg-query's internal recursive asterisk matching, which performs better/faster. This does now also match on "wireguard.kosomething", but I think "wireguard" is specific enough and dots in kernel modules names uncommon, to no be an issue. Signed-off-by: MichaIng --- auto_install/install.sh | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) diff --git a/auto_install/install.sh b/auto_install/install.sh index cb567bd..5c086b4 100755 --- a/auto_install/install.sh +++ b/auto_install/install.sh @@ -93,9 +93,6 @@ c=$(( c < 70 ? 70 : c )) # Override localization settings so the output is in English language. export LC_ALL=C -# Enable recursive globbing to find wireguard.ko in /lib/modules. -shopt -s globstar - main(){ # Pre install checks and configs rootCheck @@ -492,12 +489,9 @@ preconfigurePackages(){ # and not part of the .deb). # Source: https://github.com/MichaIng/DietPi/blob/7bf5e1041f3b2972d7827c48215069d1c90eee07/dietpi/dietpi-software#L1807-L1815 WIREGUARD_BUILTIN=0 - for i in /lib/modules/**/wireguard.ko{,.xz}; do - [[ -f $i ]] || continue - dpkg-query -S "$i" &> /dev/null || continue + if dpkg-query -S '/lib/modules/*/wireguard.ko*' &> /dev/null || modinfo wireguard 2> /dev/null | grep -q '^filename:[[:blank:]]*(builtin)$'; then WIREGUARD_BUILTIN=1 - break - done + fi if # If the module is builtin and the package available, we only need to install wireguard-tools. From 712d39888617b2395616a6cc37e06e17279ef313 Mon Sep 17 00:00:00 2001 From: 4s3ti <4s3ti@4s3ti.net> Date: Fri, 10 Jun 2022 16:01:25 +0200 Subject: [PATCH 3/3] Pre Merge commit Updated CHANGELOG.md fixes #1548 fixes #1549 --- CHANGELOG.md | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 520d02b..7dc1961 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,6 +1,11 @@ # Change Log All notable changes to this project will be documented in this file. +## June 10th 2022 + +- Bug fixes & Improvements + - Add support for builtin WireGuard module [#1548](#1548) [#1549](#1549) + ## May 23rd 2022 - Code quality and improvements