GNU bug report logs - #40683
[PATCH] gnu: Add wireguard-module.

Previous Next

Package: guix-patches;

Reported by: Brice Waegeneire <brice <at> waegenei.re>

Date: Fri, 17 Apr 2020 16:00:02 UTC

Severity: normal

Tags: patch

Done: Leo Famulari <leo <at> famulari.name>

Bug is archived. No further changes may be made.

To add a comment to this bug, you must first unarchive it, by sending
a message to control AT debbugs.gnu.org, with unarchive 40683 in the body.
You can then email your comments to 40683 AT debbugs.gnu.org in the normal way.

Toggle the display of automated, internal messages from the tracker.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to guix-patches <at> gnu.org:
bug#40683; Package guix-patches. (Fri, 17 Apr 2020 16:00:02 GMT) Full text and rfc822 format available.

Acknowledgement sent to Brice Waegeneire <brice <at> waegenei.re>:
New bug report received and forwarded. Copy sent to guix-patches <at> gnu.org. (Fri, 17 Apr 2020 16:00:02 GMT) Full text and rfc822 format available.

Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):

From: Brice Waegeneire <brice <at> waegenei.re>
To: guix-patches <at> gnu.org
Subject: [PATCH] gnu: Add wireguard-module.
Date: Fri, 17 Apr 2020 17:58:55 +0200
* 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 <leo <at> famulari.name>
 ;;; Copyright © 2019 Rutger Helling <rhelling <at> mykolab.com>
 ;;; Copyright © 2019 Ricardo Wurmus <rekado <at> elephly.net>
+;;; Copyright © 2020 Brice Waegeneire <brice <at> waegenei.re>
 ;;;
 ;;; 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





Information forwarded to guix-patches <at> gnu.org:
bug#40683; Package guix-patches. (Fri, 17 Apr 2020 16:48:01 GMT) Full text and rfc822 format available.

Message #8 received at 40683 <at> debbugs.gnu.org (full text, mbox):

From: Tobias Geerinckx-Rice <me <at> tobias.gr>
To: 40683 <at> debbugs.gnu.org
Subject: Re: [bug#40683] [PATCH] gnu: Add wireguard-module.
Date: Fri, 17 Apr 2020 18:47:49 +0200
[Message part 1 (text/plain, inline)]
Brice!

Brice Waegeneire 写道:
> 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.

Thanks!

> +(define-public wireguard-module
> +  (package
> +    (inherit wireguard-linux-compat)
> +    (name "wireguard-module")

2x s/module/linux-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.

I think we should say ‘Linux-Libre’ here (yes, even though it 
loads on any *Linux) but I'm never entirely sure.

> 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}.")))

This can go; it belongs in the manual and is already explained 
there.

LGTM with these changes, but curious what others think about 
‘Linux’,

T G-R
[signature.asc (application/pgp-signature, inline)]

Information forwarded to guix-patches <at> gnu.org:
bug#40683; Package guix-patches. (Thu, 23 Apr 2020 12:36:01 GMT) Full text and rfc822 format available.

Message #11 received at 40683 <at> debbugs.gnu.org (full text, mbox):

From: Brice Waegeneire <brice <at> waegenei.re>
To: 40683 <at> debbugs.gnu.org
Cc: me <at> tobias.gr
Subject: [PATCH v2] gnu: Add wireguard-linux-module.
Date: Thu, 23 Apr 2020 14:34:57 +0200
* gnu/packages/vpn.scm (wireguard-linux-module): New variable.
---

Rename wireguard-module to wireguard-linux-module and remove documentation from the
description.

 gnu/packages/vpn.scm | 20 ++++++++++++++++++++
 1 file changed, 20 insertions(+)

diff --git a/gnu/packages/vpn.scm b/gnu/packages/vpn.scm
index 739522959c..be600524f5 100644
--- a/gnu/packages/vpn.scm
+++ b/gnu/packages/vpn.scm
@@ -11,6 +11,7 @@
 ;;; Copyright © 2019, 2020 Leo Famulari <leo <at> famulari.name>
 ;;; Copyright © 2019 Rutger Helling <rhelling <at> mykolab.com>
 ;;; Copyright © 2019 Ricardo Wurmus <rekado <at> elephly.net>
+;;; Copyright © 2020 Brice Waegeneire <brice <at> waegenei.re>
 ;;;
 ;;; 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,24 @@ 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-linux-module
+  (package
+    (inherit wireguard-linux-compat)
+    (name "wireguard-linux-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.")))
+
 (define-public wireguard-tools
   (package
     (name "wireguard-tools")
-- 
2.26.0





Information forwarded to guix-patches <at> gnu.org:
bug#40683; Package guix-patches. (Thu, 23 Apr 2020 12:45:01 GMT) Full text and rfc822 format available.

Message #14 received at 40683 <at> debbugs.gnu.org (full text, mbox):

From: Brice Waegeneire <brice <at> waegenei.re>
To: 40683 <at> debbugs.gnu.org, me <at> tobias.gr
Subject: Re: Re: [bug#40683] [PATCH] gnu: Add wireguard-module.
Date: Thu, 23 Apr 2020 12:44:05 +0000
Tobias,

>> +    (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.
> 
> I think we should say ‘Linux-Libre’ here (yes, even though it
> loads on any *Linux) but I'm never entirely sure.
> 
> [...]
> 
> LGTM with these changes, but curious what others think about
> ‘Linux’,

None of the similar packages like 'acpi-call-linux-module',
'rtl8812au-aircrack-ng-linux-module', 'ddcci-driver-linux' or 'zfs' use
“Linux-Libre” in their synopsis or description. So using “Linux” should 
be
good or an other patch should modify all of them.

Cheers,
- Brice




Information forwarded to guix-patches <at> gnu.org:
bug#40683; Package guix-patches. (Thu, 23 Apr 2020 17:04:02 GMT) Full text and rfc822 format available.

Message #17 received at 40683 <at> debbugs.gnu.org (full text, mbox):

From: Leo Famulari <leo <at> famulari.name>
To: Brice Waegeneire <brice <at> waegenei.re>
Cc: me <at> tobias.gr, 40683 <at> debbugs.gnu.org
Subject: Re: [bug#40683] [PATCH v2] gnu: Add wireguard-linux-module.
Date: Thu, 23 Apr 2020 13:03:50 -0400
On Thu, Apr 23, 2020 at 02:34:57PM +0200, Brice Waegeneire wrote:
> * gnu/packages/vpn.scm (wireguard-linux-module): New variable.

Can this be part of the wireguard-linux-compat package? I think it's
confusing to have two packages providing WireGuard for old kernels.




Information forwarded to guix-patches <at> gnu.org:
bug#40683; Package guix-patches. (Fri, 24 Apr 2020 19:53:01 GMT) Full text and rfc822 format available.

Message #20 received at 40683 <at> debbugs.gnu.org (full text, mbox):

From: Brice Waegeneire <brice <at> waegenei.re>
To: 40683 <at> debbugs.gnu.org
Cc: me <at> tobias.gr, leo <at> famulari.name
Subject: [PATCH v3] gnu: Add loadable module to wireguard-linux-compat.
Date: Fri, 24 Apr 2020 21:51:55 +0200
* gnu/packages/vpn.scm (wireguard-linux-compat)[build-system]: Replace
'gnu-build-system' by 'linux-module-build-system'.
[arguments]: Adjust the build system.  Add phase 'change-directory'.
Rename phases 'build' to 'build-patch' and 'install' to 'install-patch'.
[description]: Mention the loadable module.
---

This version of the patch merge the now defunct 'wireguard-linux-module' into
'wireguard-linux-compat' -- hoping that it's less confusing for users.

 gnu/packages/vpn.scm | 22 ++++++++++++++--------
 1 file changed, 14 insertions(+), 8 deletions(-)

diff --git a/gnu/packages/vpn.scm b/gnu/packages/vpn.scm
index 739522959c..6bcce8fe52 100644
--- a/gnu/packages/vpn.scm
+++ b/gnu/packages/vpn.scm
@@ -11,6 +11,7 @@
 ;;; Copyright © 2019, 2020 Leo Famulari <leo <at> famulari.name>
 ;;; Copyright © 2019 Rutger Helling <rhelling <at> mykolab.com>
 ;;; Copyright © 2019 Ricardo Wurmus <rekado <at> elephly.net>
+;;; Copyright © 2020 Brice Waegeneire <brice <at> waegenei.re>
 ;;;
 ;;; 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)
@@ -465,19 +467,22 @@ The peer-to-peer VPN implements a Layer 2 (Ethernet) network between the peers
               (sha256
                (base32
                 "0ymprz3h4b92wlcqm5k5vmcgap8pjv202bgkdx0axmp12n1lmyvx"))))
-    (build-system gnu-build-system)
+    (build-system linux-module-build-system)
     (arguments
      `(#:tests? #f ; No test suite
-       #:modules ((guix build gnu-build-system)
+       #:modules ((guix build linux-module-build-system)
                   (guix build utils)
                   (ice-9 popen)
                   (ice-9 textual-ports))
        #:phases
        (modify-phases %standard-phases
-         (delete 'configure) ; No ./configure script
-         (replace 'build
+         (add-before 'build 'change-directory
+           (lambda _
+             (chdir "./src")
+             #t))
+         (add-after 'build 'build-patch
            (lambda* (#:key outputs #:allow-other-keys)
-             (let* ((patch-builder "./kernel-tree-scripts/create-patch.sh")
+             (let* ((patch-builder "../kernel-tree-scripts/create-patch.sh")
                     (port (open-input-pipe patch-builder))
                     (str (get-string-all port)))
                (close-pipe port)
@@ -485,15 +490,16 @@ The peer-to-peer VPN implements a Layer 2 (Ethernet) network between the peers
                  (lambda (port)
                    (format port "~a" str))))
                #t))
-         (replace 'install
+         (add-after 'install 'install-patch
            (lambda* (#:key outputs #:allow-other-keys)
              (install-file "wireguard.patch"
                            (assoc-ref %outputs "out"))
              #t)))))
     (home-page "https://git.zx2c4.com/wireguard-linux-compat/")
     (synopsis "WireGuard kernel module for Linux 3.10 through 5.5")
-    (description "This is an out-of-tree Linux kernel patch adding WireGuard to
-kernel versions 3.10 through 5.5.  WireGuard was added to Linux 5.6.")
+    (description "This package contains an out-of-tree kernel patch and
+a loadable module adding WireGuard to Linux kernel versions 3.10 through 5.5.
+WireGuard was added to Linux 5.6.")
     (license license:gpl2)))
 
 (define-public wireguard-tools
-- 
2.26.0





Information forwarded to guix-patches <at> gnu.org:
bug#40683; Package guix-patches. (Sun, 26 Apr 2020 20:52:02 GMT) Full text and rfc822 format available.

Message #23 received at 40683 <at> debbugs.gnu.org (full text, mbox):

From: Brice Waegeneire <brice <at> waegenei.re>
To: 40683 <at> debbugs.gnu.org
Cc: leo <at> famulari.name
Subject: [PATCH v4] gnu: Add loadable module to wireguard-linux-compat.
Date: Sun, 26 Apr 2020 22:51:02 +0200
* gnu/packages/vpn.scm (wireguard-linux-compat)[build-system]: Replace
'gnu-build-system' by 'linux-module-build-system'.
[outputs]: Add 'kernel-patch'.
[arguments]: Adjust the build system.  Add phase 'change-directory'.
Rename phases 'build' to 'build-patch' and 'install' to 'install-patch'.
[description]: Mention the loadable module.
---

Put patch in 'kernel-patch' output.

 gnu/packages/vpn.scm | 26 +++++++++++++++++---------
 1 file changed, 17 insertions(+), 9 deletions(-)

diff --git a/gnu/packages/vpn.scm b/gnu/packages/vpn.scm
index 739522959c..8c69b4be51 100644
--- a/gnu/packages/vpn.scm
+++ b/gnu/packages/vpn.scm
@@ -11,6 +11,7 @@
 ;;; Copyright © 2019, 2020 Leo Famulari <leo <at> famulari.name>
 ;;; Copyright © 2019 Rutger Helling <rhelling <at> mykolab.com>
 ;;; Copyright © 2019 Ricardo Wurmus <rekado <at> elephly.net>
+;;; Copyright © 2020 Brice Waegeneire <brice <at> waegenei.re>
 ;;;
 ;;; 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)
@@ -465,19 +467,24 @@ The peer-to-peer VPN implements a Layer 2 (Ethernet) network between the peers
               (sha256
                (base32
                 "0ymprz3h4b92wlcqm5k5vmcgap8pjv202bgkdx0axmp12n1lmyvx"))))
-    (build-system gnu-build-system)
+    (build-system linux-module-build-system)
+    (outputs '("out"
+               "kernel-patch"))
     (arguments
      `(#:tests? #f ; No test suite
-       #:modules ((guix build gnu-build-system)
+       #:modules ((guix build linux-module-build-system)
                   (guix build utils)
                   (ice-9 popen)
                   (ice-9 textual-ports))
        #:phases
        (modify-phases %standard-phases
-         (delete 'configure) ; No ./configure script
-         (replace 'build
+         (add-before 'build 'change-directory
+           (lambda _
+             (chdir "./src")
+             #t))
+         (add-after 'build 'build-patch
            (lambda* (#:key outputs #:allow-other-keys)
-             (let* ((patch-builder "./kernel-tree-scripts/create-patch.sh")
+             (let* ((patch-builder "../kernel-tree-scripts/create-patch.sh")
                     (port (open-input-pipe patch-builder))
                     (str (get-string-all port)))
                (close-pipe port)
@@ -485,15 +492,16 @@ The peer-to-peer VPN implements a Layer 2 (Ethernet) network between the peers
                  (lambda (port)
                    (format port "~a" str))))
                #t))
-         (replace 'install
+         (add-after 'install 'install-patch
            (lambda* (#:key outputs #:allow-other-keys)
              (install-file "wireguard.patch"
-                           (assoc-ref %outputs "out"))
+                           (assoc-ref %outputs "kernel-patch"))
              #t)))))
     (home-page "https://git.zx2c4.com/wireguard-linux-compat/")
     (synopsis "WireGuard kernel module for Linux 3.10 through 5.5")
-    (description "This is an out-of-tree Linux kernel patch adding WireGuard to
-kernel versions 3.10 through 5.5.  WireGuard was added to Linux 5.6.")
+    (description "This package contains an out-of-tree kernel patch and
+a loadable module adding WireGuard to Linux kernel versions 3.10 through 5.5.
+WireGuard was added to Linux 5.6.")
     (license license:gpl2)))
 
 (define-public wireguard-tools
-- 
2.26.0





Information forwarded to guix-patches <at> gnu.org:
bug#40683; Package guix-patches. (Sun, 26 Apr 2020 21:17:02 GMT) Full text and rfc822 format available.

Message #26 received at 40683 <at> debbugs.gnu.org (full text, mbox):

From: Leo Famulari <leo <at> famulari.name>
To: Brice Waegeneire <brice <at> waegenei.re>
Cc: 40683 <at> debbugs.gnu.org
Subject: Re: [PATCH v4] gnu: Add loadable module to wireguard-linux-compat.
Date: Sun, 26 Apr 2020 17:16:36 -0400
[Message part 1 (text/plain, inline)]
On Sun, Apr 26, 2020 at 10:51:02PM +0200, Brice Waegeneire wrote:
> * gnu/packages/vpn.scm (wireguard-linux-compat)[build-system]: Replace
> 'gnu-build-system' by 'linux-module-build-system'.
> [outputs]: Add 'kernel-patch'.
> [arguments]: Adjust the build system.  Add phase 'change-directory'.
> Rename phases 'build' to 'build-patch' and 'install' to 'install-patch'.
> [description]: Mention the loadable module.

Thanks! I've attached a v5 that ensures the license files still get
installed. Does it work for you?
[0001-gnu-Add-loadable-module-to-wireguard-linux-compat.patch (text/plain, attachment)]
[signature.asc (application/pgp-signature, inline)]

Reply sent to Leo Famulari <leo <at> famulari.name>:
You have taken responsibility. (Sun, 26 Apr 2020 22:26:01 GMT) Full text and rfc822 format available.

Notification sent to Brice Waegeneire <brice <at> waegenei.re>:
bug acknowledged by developer. (Sun, 26 Apr 2020 22:26:01 GMT) Full text and rfc822 format available.

Message #31 received at 40683-done <at> debbugs.gnu.org (full text, mbox):

From: Leo Famulari <leo <at> famulari.name>
To: Brice Waegeneire <brice <at> waegenei.re>
Cc: 40683-done <at> debbugs.gnu.org
Subject: Re: [PATCH v4] gnu: Add loadable module to wireguard-linux-compat.
Date: Sun, 26 Apr 2020 18:25:48 -0400
[Message part 1 (text/plain, inline)]
On Sun, Apr 26, 2020 at 05:16:36PM -0400, Leo Famulari wrote:
> Thanks! I've attached a v5 that ensures the license files still get
> installed. Does it work for you?

I pushed this as 3b177a6c33baa0d78ebd5407119511807d59a590 based on
feedback on #guix
[signature.asc (application/pgp-signature, inline)]

bug archived. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> debbugs.gnu.org. (Mon, 25 May 2020 11:24:07 GMT) Full text and rfc822 format available.

This bug report was last modified 5 years and 21 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.