From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:470:142:3::10]:56808) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jPTPP-00067F-Nu for guix-patches@gnu.org; Fri, 17 Apr 2020 12:00:04 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1jPTPO-0006tM-I5 for guix-patches@gnu.org; Fri, 17 Apr 2020 12:00:03 -0400 Received: from debbugs.gnu.org ([209.51.188.43]:58223) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1jPTPO-0006t4-FH for guix-patches@gnu.org; Fri, 17 Apr 2020 12:00:02 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1jPTPO-0001g3-DX for guix-patches@gnu.org; Fri, 17 Apr 2020 12:00:02 -0400 Subject: [bug#40683] [PATCH] gnu: Add wireguard-module. Resent-Message-ID: Received: from eggs.gnu.org ([2001:470:142:3::10]:56717) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jPTOa-00061L-Br for guix-patches@gnu.org; Fri, 17 Apr 2020 11:59:13 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1jPTOY-0006BG-Q2 for guix-patches@gnu.org; Fri, 17 Apr 2020 11:59:11 -0400 Received: from relay5-d.mail.gandi.net ([217.70.183.197]:44055) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1jPTOY-00067x-K5 for guix-patches@gnu.org; Fri, 17 Apr 2020 11:59:10 -0400 Received: from localhost (luy13-1-78-237-113-178.fbx.proxad.net [78.237.113.178]) (Authenticated sender: brice@waegenei.re) by relay5-d.mail.gandi.net (Postfix) with ESMTPSA id 675161C0007 for ; Fri, 17 Apr 2020 15:59:04 +0000 (UTC) From: Brice Waegeneire Date: Fri, 17 Apr 2020 17:58:55 +0200 Message-Id: <20200417155855.6210-1-brice@waegenei.re> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-patches-bounces+kyle=kyleam.com@gnu.org Sender: "Guix-patches" To: 40683@debbugs.gnu.org * gnu/packages/vpn.scm (wireguard-module): New variable. --- This patch add wireguard as a loadable Linux kernel module which allow using it Linux version < 5.6 without having to rebuild the entire kernel. Following is a usage example: --8<---------------cut here---------------start------------->8--- (use-modules (gnu) (gnu services)) (use-package-modules vpn) (use-service-modules linux) (operating-system ... (services (cons* (service kernel-module-loader-service-type '("wireguard")) %base-services)) (kernel-loadable-modules (list wireguard-module))) --8<---------------cut here---------------end--------------->8--- gnu/packages/vpn.scm | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/gnu/packages/vpn.scm b/gnu/packages/vpn.scm index 739522959c..654c9d8db1 100644 --- a/gnu/packages/vpn.scm +++ b/gnu/packages/vpn.scm @@ -11,6 +11,7 @@ ;;; Copyright © 2019, 2020 Leo Famulari ;;; Copyright © 2019 Rutger Helling ;;; Copyright © 2019 Ricardo Wurmus +;;; Copyright © 2020 Brice Waegeneire ;;; ;;; This file is part of GNU Guix. ;;; @@ -34,6 +35,7 @@ #:use-module (guix git-download) #:use-module (guix build-system cmake) #:use-module (guix build-system gnu) + #:use-module (guix build-system linux-module) #:use-module (guix build-system python) #:use-module (gnu packages) #:use-module (gnu packages admin) @@ -496,6 +498,26 @@ The peer-to-peer VPN implements a Layer 2 (Ethernet) network between the peers kernel versions 3.10 through 5.5. WireGuard was added to Linux 5.6.") (license license:gpl2))) +(define-public wireguard-module + (package + (inherit wireguard-linux-compat) + (name "wireguard-module") + (build-system linux-module-build-system) + (arguments + `(#:tests? #f ; No test suite + #:phases + (modify-phases %standard-phases + (add-before 'build 'change-directory + (lambda _ + (chdir "./src") + #t))))) + (synopsis "WireGuard loadable kernel module for Linux 3.10 through 5.5") + (description "This is a loadable Linux kernel module for WireGuard +supporting kernel versions 3.10 through 5.5. WireGuard was added to Linux +5.6. It ought to be used by adding it to the @code{kernel-loadable-modules} +field and loaded in memeory by @command{modprobe} or +@code{kernel-module-loader-service-type}."))) + (define-public wireguard-tools (package (name "wireguard-tools") -- 2.26.0