From patchwork Fri Apr 17 15:58:55 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Brice Waegeneire X-Patchwork-Id: 21341 Return-Path: X-Original-To: patchwork@mira.cbaines.net Delivered-To: patchwork@mira.cbaines.net Received: by mira.cbaines.net (Postfix, from userid 113) id 5313A27BBE4; Fri, 17 Apr 2020 17:00:19 +0100 (BST) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on mira.cbaines.net X-Spam-Level: X-Spam-Status: No, score=-2.9 required=5.0 tests=BAYES_00,MAILING_LIST_MULTI, URIBL_BLOCKED autolearn=unavailable autolearn_force=no version=3.4.2 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mira.cbaines.net (Postfix) with ESMTP id 0FF6927BBE1 for ; Fri, 17 Apr 2020 17:00:19 +0100 (BST) Received: from localhost ([::1]:48950 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jPTPe-0006JT-G9 for patchwork@mira.cbaines.net; Fri, 17 Apr 2020 12:00:18 -0400 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 X-Loop: help-debbugs@gnu.org Subject: [bug#40683] [PATCH] gnu: Add wireguard-module. Resent-From: Brice Waegeneire Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Fri, 17 Apr 2020 16:00:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 40683 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 40683@debbugs.gnu.org X-Debbugs-Original-To: guix-patches@gnu.org Received: via spool by submit@debbugs.gnu.org id=B.15871391556352 (code B ref -1); Fri, 17 Apr 2020 16:00:02 +0000 Received: (at submit) by debbugs.gnu.org; 17 Apr 2020 15:59:15 +0000 Received: from localhost ([127.0.0.1]:41536 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1jPTOd-0001eO-48 for submit@debbugs.gnu.org; Fri, 17 Apr 2020 11:59:15 -0400 Received: from lists.gnu.org ([209.51.188.17]:45151) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1jPTOb-0001eH-Ia for submit@debbugs.gnu.org; Fri, 17 Apr 2020 11:59:14 -0400 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 X-Originating-IP: 78.237.113.178 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> X-Mailer: git-send-email 2.26.0 MIME-Version: 1.0 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 209.51.188.43 X-BeenThere: guix-patches@gnu.org List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-patches-bounces+patchwork=mira.cbaines.net@gnu.org Sender: "Guix-patches" X-getmail-retrieved-from-mailbox: Patches * 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")