diff mbox series

[bug#40683] gnu: Add wireguard-module.

Message ID 20200417155855.6210-1-brice@waegenei.re
State Accepted
Headers show
Series [bug#40683] gnu: Add wireguard-module. | expand

Checks

Context Check Description
cbaines/comparison success View comparision
cbaines/git branch success View Git branch
cbaines/applying patch success View Laminar job

Commit Message

Brice Waegeneire April 17, 2020, 3:58 p.m. UTC
* 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(+)

Comments

ashish.is--- via Guix-patches" via April 17, 2020, 4:47 p.m. UTC | #1
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
Brice Waegeneire April 23, 2020, 12:44 p.m. UTC | #2
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
diff mbox series

Patch

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@famulari.name>
 ;;; Copyright © 2019 Rutger Helling <rhelling@mykolab.com>
 ;;; Copyright © 2019 Ricardo Wurmus <rekado@elephly.net>
+;;; Copyright © 2020 Brice Waegeneire <brice@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")