GNU logs - #42193, boring messages


Message sent to guix-patches@HIDDEN:


X-Loop: help-debbugs@HIDDEN
Subject: [bug#42193] [WIP 0/6] Add kernel-module-configuration service
Resent-From: Brice Waegeneire <brice@HIDDEN>
Original-Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
Resent-CC: guix-patches@HIDDEN
Resent-Date: Sat, 04 Jul 2020 18:53:02 +0000
Resent-Message-ID: <handler.42193.B.159388878019979 <at> debbugs.gnu.org>
Resent-Sender: help-debbugs@HIDDEN
X-GNU-PR-Message: report 42193
X-GNU-PR-Package: guix-patches
X-GNU-PR-Keywords: 
To: 42193 <at> debbugs.gnu.org
Cc: guix-devel@HIDDEN
X-Debbugs-Original-To: guix-patches@HIDDEN
Received: via spool by submit <at> debbugs.gnu.org id=B.159388878019979
          (code B ref -1); Sat, 04 Jul 2020 18:53:02 +0000
Received: (at submit) by debbugs.gnu.org; 4 Jul 2020 18:53:00 +0000
Received: from localhost ([127.0.0.1]:59612 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1jrnHR-0005C5-6M
	for submit <at> debbugs.gnu.org; Sat, 04 Jul 2020 14:53:00 -0400
Received: from lists.gnu.org ([209.51.188.17]:43110)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <brice@HIDDEN>) id 1jrnHN-0005Bv-Hf
 for submit <at> debbugs.gnu.org; Sat, 04 Jul 2020 14:52:51 -0400
Received: from eggs.gnu.org ([2001:470:142:3::10]:43338)
 by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.90_1) (envelope-from <brice@HIDDEN>)
 id 1jrnHN-0005Ko-3D; Sat, 04 Jul 2020 14:52:49 -0400
Received: from relay9-d.mail.gandi.net ([217.70.183.199]:41475)
 by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.90_1) (envelope-from <brice@HIDDEN>)
 id 1jrnHK-0006NL-Lr; Sat, 04 Jul 2020 14:52:48 -0400
X-Originating-IP: 176.181.186.101
Received: from localhost (i15-les02-ntr-176-181-186-101.sfr.lns.abo.bbox.fr
 [176.181.186.101]) (Authenticated sender: brice@HIDDEN)
 by relay9-d.mail.gandi.net (Postfix) with ESMTPSA id 3C4CFFF805;
 Sat,  4 Jul 2020 18:52:41 +0000 (UTC)
From: Brice Waegeneire <brice@HIDDEN>
Date: Sat,  4 Jul 2020 20:52:34 +0200
Message-Id: <20200704185234.12571-1-brice@HIDDEN>
X-Mailer: git-send-email 2.26.2
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Received-SPF: pass client-ip=217.70.183.199; envelope-from=brice@HIDDEN;
 helo=relay9-d.mail.gandi.net
X-detected-operating-system: by eggs.gnu.org: First seen = 2020/07/04 14:52:42
X-ACL-Warn: Detected OS   = Linux 3.11 and newer
X-Spam_score_int: -35
X-Spam_score: -3.6
X-Spam_bar: ---
X-Spam_report: (-3.6 / 5.0 requ) BAYES_00=-1.9, RCVD_IN_DNSWL_LOW=-0.7,
 RCVD_IN_MSPIKE_H2=-1, SPF_HELO_NONE=0.001, SPF_PASS=-0.001,
 URIBL_BLOCKED=0.001 autolearn=_AUTOLEARN
X-Spam_action: no action
X-Spam-Score: -1.6 (-)
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -2.6 (--)

Hello Guix,

Here is a work-in-progress to create a service centralizing the configuration
for built-in and loadable kernel modules.  The kernel module configuration
service has been implemented by making some fields from 'operating-system'
custom from the 'services' field.

Here are are some example of how to use it.
--8<---------------cut here---------------start------------->8---
;; Loadable kernel module
(simple-service 'ddcci-module kernel-module-configuration-service-type
                   (list (kernel-module
                          (name "ddcci")
                          (package ddcci-driver-linux)
                          (load? #t)
                          (options '("dyndbg" "delay=600")))
                         (kernel-module
                          (name "ddcci-backlight")
                          (blacklist? #t))))
;; Built-in kernel module
(simple-service 'intel-module
                         kernel-module-configuration-service-type
                         (list (kernel-module
                                (name "i915")
                                (options '("fastboot=1")))))
--8<---------------cut here---------------end--------------->8---

This WIP version is mainly missing the ability to configure built-in modules
trough the kernel arguments. It's the continuation of the work on
kernel-module-loader-service[1] and is needed to help fixing #41082[2].

I will try to go back to it after the GSOC network boot project.

[1]: https://issues.guix.info/40274
[2]: https://issues.guix.info/41082

- Brice

Brice Waegeneire (6):
  services: simulated-wifi: Use 'kernel-module-loader'.
  services: Add 'kernel-profile-service-type'.
  services: Add 'modprobe-service-type'.
  services: kernel-module-loader: Return a single 'shepherd-service'.
  WIP services: Add kernel-arguments-service-type.
  WIP services: Add kernel-module-configuration service.

 gnu/services.scm               | 102 +++++++++---
 gnu/services/linux.scm         | 276 +++++++++++++++++++++++++++++----
 gnu/services/networking.scm    |  25 +--
 gnu/system.scm                 |  55 +++++--
 gnu/system/linux-container.scm |   2 +
 gnu/tests/linux-modules.scm    |  65 +++++---
 6 files changed, 420 insertions(+), 105 deletions(-)

-- 
2.26.2





Message sent:


Content-Disposition: inline
Content-Transfer-Encoding: quoted-printable
MIME-Version: 1.0
X-Mailer: MIME-tools 5.505 (Entity 5.505)
Content-Type: text/plain; charset=utf-8
X-Loop: help-debbugs@HIDDEN
From: help-debbugs@HIDDEN (GNU bug Tracking System)
To: Brice Waegeneire <brice@HIDDEN>
Subject: bug#42193: Acknowledgement ([WIP 0/6] Add kernel-module-configuration
 service)
Message-ID: <handler.42193.B.159388878019979.ack <at> debbugs.gnu.org>
References: <20200704185234.12571-1-brice@HIDDEN>
X-Gnu-PR-Message: ack 42193
X-Gnu-PR-Package: guix-patches
Reply-To: 42193 <at> debbugs.gnu.org
Date: Sat, 04 Jul 2020 18:53:02 +0000

Thank you for filing a new bug report with debbugs.gnu.org.

This is an automatically generated reply to let you know your message
has been received.

Your message is being forwarded to the package maintainers and other
interested parties for their attention; they will reply in due course.

Your message has been sent to the package maintainer(s):
 guix-patches@HIDDEN

If you wish to submit further information on this problem, please
send it to 42193 <at> debbugs.gnu.org.

Please do not send mail to help-debbugs@HIDDEN unless you wish
to report a problem with the Bug-tracking system.

--=20
42193: http://debbugs.gnu.org/cgi/bugreport.cgi?bug=3D42193
GNU Bug Tracking System
Contact help-debbugs@HIDDEN with problems


Message sent to guix-patches@HIDDEN:


X-Loop: help-debbugs@HIDDEN
Subject: [bug#42193] [WIP 1/6] services: simulated-wifi: Use 'kernel-module-loader'.
Resent-From: Brice Waegeneire <brice@HIDDEN>
Original-Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
Resent-CC: guix-patches@HIDDEN
Resent-Date: Sat, 04 Jul 2020 18:55:02 +0000
Resent-Message-ID: <handler.42193.B.159388888220169 <at> debbugs.gnu.org>
Resent-Sender: help-debbugs@HIDDEN
X-GNU-PR-Message: followup 42193
X-GNU-PR-Package: guix-patches
X-GNU-PR-Keywords: 
To: 42193 <at> debbugs.gnu.org
X-Debbugs-Original-To: guix-patches@HIDDEN
Received: via spool by submit <at> debbugs.gnu.org id=B.159388888220169
          (code B ref -1); Sat, 04 Jul 2020 18:55:02 +0000
Received: (at submit) by debbugs.gnu.org; 4 Jul 2020 18:54:42 +0000
Received: from localhost ([127.0.0.1]:59617 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1jrnJB-0005FD-Kj
	for submit <at> debbugs.gnu.org; Sat, 04 Jul 2020 14:54:41 -0400
Received: from lists.gnu.org ([209.51.188.17]:45496)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <brice@HIDDEN>) id 1jrnJA-0005F6-1I
 for submit <at> debbugs.gnu.org; Sat, 04 Jul 2020 14:54:41 -0400
Received: from eggs.gnu.org ([2001:470:142:3::10]:43870)
 by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.90_1) (envelope-from <brice@HIDDEN>) id 1jrnJ9-0006S8-Or
 for guix-patches@HIDDEN; Sat, 04 Jul 2020 14:54:39 -0400
Received: from relay6-d.mail.gandi.net ([217.70.183.198]:41537)
 by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.90_1) (envelope-from <brice@HIDDEN>) id 1jrnJ7-0006n8-Jd
 for guix-patches@HIDDEN; Sat, 04 Jul 2020 14:54:39 -0400
X-Originating-IP: 176.181.186.101
Received: from localhost (i15-les02-ntr-176-181-186-101.sfr.lns.abo.bbox.fr
 [176.181.186.101]) (Authenticated sender: brice@HIDDEN)
 by relay6-d.mail.gandi.net (Postfix) with ESMTPSA id 2C1CBC0003
 for <guix-patches@HIDDEN>; Sat,  4 Jul 2020 18:54:34 +0000 (UTC)
From: Brice Waegeneire <brice@HIDDEN>
Date: Sat,  4 Jul 2020 20:54:25 +0200
Message-Id: <20200704185431.13739-1-brice@HIDDEN>
X-Mailer: git-send-email 2.26.2
In-Reply-To: <20200704185234.12571-1-brice@HIDDEN>
References: <20200704185234.12571-1-brice@HIDDEN>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Received-SPF: pass client-ip=217.70.183.198; envelope-from=brice@HIDDEN;
 helo=relay6-d.mail.gandi.net
X-detected-operating-system: by eggs.gnu.org: First seen = 2020/07/04 14:54:35
X-ACL-Warn: Detected OS   = Linux 3.11 and newer
X-Spam_score_int: -25
X-Spam_score: -2.6
X-Spam_bar: --
X-Spam_report: (-2.6 / 5.0 requ) BAYES_00=-1.9, RCVD_IN_DNSWL_LOW=-0.7,
 SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=_AUTOLEARN
X-Spam_action: no action
X-Spam-Score: -1.6 (-)
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -2.6 (--)

* gnu/services/networking.scm (simulated-wifi-shepherd-services):
Change 'mac-simulation-module' service to use 'kernel-module-loader'.
---
 gnu/services/networking.scm | 25 +++++++------------------
 1 file changed, 7 insertions(+), 18 deletions(-)

diff --git a/gnu/services/networking.scm b/gnu/services/networking.scm
index 348dc369d8..353fdce2bb 100644
--- a/gnu/services/networking.scm
+++ b/gnu/services/networking.scm
@@ -13,6 +13,7 @@
 ;;; Copyright © 2019 Maxim Cournoyer <maxim.cournoyer@HIDDEN>
 ;;; Copyright © 2019 Sou Bunnbu <iyzsong@HIDDEN>
 ;;; Copyright © 2019 Alex Griffin <a@HIDDEN>
+;;; Copyright © 2020 Brice Waegeneire <brice@HIDDEN>
 ;;;
 ;;; This file is part of GNU Guix.
 ;;;
@@ -33,6 +34,7 @@
   #:use-module (gnu services)
   #:use-module (gnu services base)
   #:use-module (gnu services configuration)
+  #:use-module (gnu services linux)
   #:use-module (gnu services shepherd)
   #:use-module (gnu services dbus)
   #:use-module (gnu system shadow)
@@ -1442,10 +1444,10 @@ simulation."
   (append (hostapd-shepherd-services config
                                      #:requirement
                                      '(unblocked-wifi
-                                       mac-simulation-module))
+                                       kernel-module-loader))
           (list (shepherd-service
                  (provision '(unblocked-wifi))
-                 (requirement '(file-systems mac-simulation-module))
+                 (requirement '(file-systems kernel-module-loader))
                  (documentation
                   "Unblock WiFi devices for use by mac80211_hwsim.")
                  (start #~(lambda _
@@ -1453,21 +1455,6 @@ simulation."
                                     "unblock" "0")
                             (invoke #$(file-append util-linux "/sbin/rfkill")
                                     "unblock" "1")))
-                 (one-shot? #t))
-                (shepherd-service
-                 (provision '(mac-simulation-module))
-                 (requirement '(file-systems))
-                 (modules '((guix build utils)))
-                 (documentation
-                  "Load the mac80211_hwsim Linux kernel module.")
-                 (start (with-imported-modules '((guix build utils))
-                          #~(lambda _
-                              ;; XXX: We can't use 'load-linux-module*' here because it
-                              ;; expects a flat module directory.
-                              (setenv "LINUX_MODULE_DIRECTORY"
-                                      "/run/booted-system/kernel/lib/modules")
-                              (invoke #$(file-append kmod "/bin/modprobe")
-                                      "mac80211_hwsim"))))
                  (one-shot? #t)))))
 
 (define simulated-wifi-service-type
@@ -1475,7 +1462,9 @@ simulation."
    (name 'simulated-wifi)
    (extensions
     (list (service-extension shepherd-root-service-type
-                             simulated-wifi-shepherd-services)))
+                             simulated-wifi-shepherd-services)
+          (service-extension kernel-module-loader-service-type
+                             (const '("mac80211_hwsim")))))
    (default-value (hostapd-configuration
                    (interface "wlan1")
                    (ssid "Test Network")))
-- 
2.26.2





Message sent to guix-patches@HIDDEN:


X-Loop: help-debbugs@HIDDEN
Subject: [bug#42193] [WIP 3/6] services: Add 'modprobe-service-type'.
Resent-From: Brice Waegeneire <brice@HIDDEN>
Original-Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
Resent-CC: guix-patches@HIDDEN
Resent-Date: Sat, 04 Jul 2020 18:55:02 +0000
Resent-Message-ID: <handler.42193.B.159388888420216 <at> debbugs.gnu.org>
Resent-Sender: help-debbugs@HIDDEN
X-GNU-PR-Message: followup 42193
X-GNU-PR-Package: guix-patches
X-GNU-PR-Keywords: 
To: 42193 <at> debbugs.gnu.org
X-Debbugs-Original-To: guix-patches@HIDDEN
Received: via spool by submit <at> debbugs.gnu.org id=B.159388888420216
          (code B ref -1); Sat, 04 Jul 2020 18:55:02 +0000
Received: (at submit) by debbugs.gnu.org; 4 Jul 2020 18:54:44 +0000
Received: from localhost ([127.0.0.1]:59625 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1jrnJD-0005Ft-UX
	for submit <at> debbugs.gnu.org; Sat, 04 Jul 2020 14:54:44 -0400
Received: from lists.gnu.org ([209.51.188.17]:45500)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <brice@HIDDEN>) id 1jrnJB-0005FG-UC
 for submit <at> debbugs.gnu.org; Sat, 04 Jul 2020 14:54:42 -0400
Received: from eggs.gnu.org ([2001:470:142:3::10]:43908)
 by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.90_1) (envelope-from <brice@HIDDEN>) id 1jrnJB-0006Sc-KH
 for guix-patches@HIDDEN; Sat, 04 Jul 2020 14:54:41 -0400
Received: from relay4-d.mail.gandi.net ([217.70.183.196]:34659)
 by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.90_1) (envelope-from <brice@HIDDEN>) id 1jrnJ9-0006nL-1M
 for guix-patches@HIDDEN; Sat, 04 Jul 2020 14:54:41 -0400
X-Originating-IP: 176.181.186.101
Received: from localhost (i15-les02-ntr-176-181-186-101.sfr.lns.abo.bbox.fr
 [176.181.186.101]) (Authenticated sender: brice@HIDDEN)
 by relay4-d.mail.gandi.net (Postfix) with ESMTPSA id 923BCE0004
 for <guix-patches@HIDDEN>; Sat,  4 Jul 2020 18:54:37 +0000 (UTC)
From: Brice Waegeneire <brice@HIDDEN>
Date: Sat,  4 Jul 2020 20:54:28 +0200
Message-Id: <20200704185431.13739-4-brice@HIDDEN>
X-Mailer: git-send-email 2.26.2
In-Reply-To: <20200704185234.12571-1-brice@HIDDEN>
References: <20200704185234.12571-1-brice@HIDDEN>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Received-SPF: pass client-ip=217.70.183.196; envelope-from=brice@HIDDEN;
 helo=relay4-d.mail.gandi.net
X-detected-operating-system: by eggs.gnu.org: First seen = 2020/07/04 14:54:36
X-ACL-Warn: Detected OS   = Linux 3.11 and newer
X-Spam_score_int: -25
X-Spam_score: -2.6
X-Spam_bar: --
X-Spam_report: (-2.6 / 5.0 requ) BAYES_00=-1.9, RCVD_IN_DNSWL_LOW=-0.7,
 RCVD_IN_MSPIKE_H3=-0.01, RCVD_IN_MSPIKE_WL=-0.01, SPF_HELO_NONE=0.001,
 SPF_PASS=-0.001 autolearn=_AUTOLEARN
X-Spam_action: no action
X-Spam-Score: -1.6 (-)
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -2.6 (--)

* gnu/services.scm (%linux-kernel-activation): Remove
'activate-modprobe' from it.
(%modprobe-wrapper): Move it…
* gnu/services/linux.scm (%modprobe-wrapper): …here and make it a
procedure taking one argument specifying the configuration directory.
(modprobe-service-type, modprobe-environment,
modprobe->activation-gexp): New variables.
* gnu/system.scm (operating-system-default-essential-services): Add
'modprobe-service-type'.
* gnu/system/linux-container.scm (container-essential-services): Add
'modprobe-service-type' to the list of services to be removed.
---
 gnu/services.scm               | 22 +-------------
 gnu/services/linux.scm         | 53 +++++++++++++++++++++++++++++++++-
 gnu/system.scm                 |  2 ++
 gnu/system/linux-container.scm |  2 ++
 4 files changed, 57 insertions(+), 22 deletions(-)

diff --git a/gnu/services.scm b/gnu/services.scm
index b5ec222207..7df9bf9d46 100644
--- a/gnu/services.scm
+++ b/gnu/services.scm
@@ -654,31 +654,11 @@ ACTIVATION-SCRIPT-TYPE."
   ;; receives.
   (service activation-service-type #t))
 
-(define %modprobe-wrapper
-  ;; Wrapper for the 'modprobe' command that knows where modules live.
-  ;;
-  ;; This wrapper is typically invoked by the Linux kernel ('call_modprobe',
-  ;; in kernel/kmod.c), a situation where the 'LINUX_MODULE_DIRECTORY'
-  ;; environment variable is not set---hence the need for this wrapper.
-  (let ((modprobe "/run/current-system/profile/bin/modprobe"))
-    (program-file "modprobe"
-                  #~(begin
-                      (setenv "LINUX_MODULE_DIRECTORY"
-                              "/run/booted-system/kernel/lib/modules")
-                      ;; FIXME: Remove this crutch when the patch #40422,
-                      ;; updating to kmod 27 is merged.
-                      (setenv "MODPROBE_OPTIONS"
-                              "-C /etc/modprobe.d")
-                      (apply execl #$modprobe
-                             (cons #$modprobe (cdr (command-line))))))))
-
+;; TODO Maybe rename it
 (define %linux-kernel-activation
   ;; Activation of the Linux kernel running on the bare metal (as opposed to
   ;; running in a container.)
   #~(begin
-      ;; Tell the kernel to use our 'modprobe' command.
-      (activate-modprobe #$%modprobe-wrapper)
-
       ;; Let users debug their own processes!
       (activate-ptrace-attach)))
 
diff --git a/gnu/services/linux.scm b/gnu/services/linux.scm
index 12934c2084..c608cc4d8d 100644
--- a/gnu/services/linux.scm
+++ b/gnu/services/linux.scm
@@ -23,6 +23,7 @@
   #:use-module (guix modules)
   #:use-module (gnu services)
   #:use-module (gnu services shepherd)
+  #:use-module (gnu system pam)
   #:use-module (gnu packages linux)
   #:use-module (srfi srfi-1)
   #:use-module (srfi srfi-26)
@@ -42,7 +43,9 @@
             earlyoom-configuration-send-notification-command
             earlyoom-service-type
 
-            kernel-module-loader-service-type))
+            kernel-module-loader-service-type
+
+            modprobe-service-type))
 
 
 ;;;
@@ -177,3 +180,51 @@ representation."
    (compose concatenate)
    (extend append)
    (default-value '())))
+
+
+;;;
+;;; Modprobe service.
+;;;
+
+(define (%modprobe-wrapper directory)
+  "Return a wrapper for modprobe loading configuration files from CONFIG."
+  ;; Wrapper for the 'modprobe' command that knows where modules live.
+  ;;
+  ;; This wrapper is typically invoked by the Linux kernel ('call_modprobe',
+  ;; in kernel/kmod.c), a situation where the 'LINUX_MODULE_DIRECTORY'
+  ;; environment variable is not set---hence the need for this wrapper.
+  (let ((modprobe "/run/current-system/profile/bin/modprobe"))
+    (program-file "modprobe"
+                  #~(begin
+                      (setenv "LINUX_MODULE_DIRECTORY"
+                              "/run/booted-system/kernel/lib/modules")
+                      (setenv "MODPROBE_OPTIONS"
+                              (string-append "--config=" #$directory))
+                      (apply execl #$modprobe
+                             (cons #$modprobe (cdr (command-line))))))))
+
+(define (modprobe->activation-gexp configs)
+  "Return a gexp to tell the kernel to use modprobe configured with CONFIGS
+files."
+  (let ((directory (file-union "modprobe.d" configs)))
+    #~(activate-modprobe #$(%modprobe-wrapper directory))))
+
+(define (modprobe-environment configs)
+  (let ((options #~(string-append
+                    "--config="
+                    #$(file-union "modprobe.d"
+                                  configs))))
+    `(("MODPROBE_OPTIONS" . ,options))))
+
+(define modprobe-service-type
+  (service-type
+   (name 'modropbe)
+   (description "Tell the kernel to use Guix's 'modprobe'.")
+   (default-value '())                  ; list of <file-like>
+   (extensions
+    (list (service-extension activation-service-type
+                             modprobe->activation-gexp)
+          (service-extension session-environment-service-type
+                             modprobe-environment)))
+   (compose concatenate)
+   (extend append)))
diff --git a/gnu/system.scm b/gnu/system.scm
index ff374dddda..ba9eeb66b8 100644
--- a/gnu/system.scm
+++ b/gnu/system.scm
@@ -58,6 +58,7 @@
   #:use-module (gnu services)
   #:use-module (gnu services shepherd)
   #:use-module (gnu services base)
+  #:use-module (gnu services linux)
   #:use-module (gnu bootloader)
   #:use-module (gnu system shadow)
   #:use-module (gnu system nss)
@@ -594,6 +595,7 @@ bookkeeping."
            (service profile-service-type
                     (operating-system-packages os))
            other-fs
+           (service modprobe-service-type)
            (append mappings swaps
 
                    ;; Add the firmware service.
diff --git a/gnu/system/linux-container.scm b/gnu/system/linux-container.scm
index c5e2e4bf9c..b8bf88e495 100644
--- a/gnu/system/linux-container.scm
+++ b/gnu/system/linux-container.scm
@@ -31,6 +31,7 @@
   #:use-module (gnu build linux-container)
   #:use-module (gnu services)
   #:use-module (gnu services base)
+  #:use-module (gnu services linux)
   #:use-module (gnu services networking)
   #:use-module (gnu services shepherd)
   #:use-module (gnu system)
@@ -48,6 +49,7 @@ from OS that are needed on the bare metal and not in a container."
     (remove (lambda (service)
               (memq (service-kind service)
                     (list (service-kind %linux-bare-metal-service)
+                          modprobe-service-type
                           firmware-service-type
                           system-service-type)))
             (operating-system-default-essential-services os)))
-- 
2.26.2





Message sent to guix-patches@HIDDEN:


X-Loop: help-debbugs@HIDDEN
Subject: [bug#42193] [WIP 5/6] WIP services: Add kernel-arguments-service-type.
Resent-From: Brice Waegeneire <brice@HIDDEN>
Original-Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
Resent-CC: guix-patches@HIDDEN
Resent-Date: Sat, 04 Jul 2020 18:55:03 +0000
Resent-Message-ID: <handler.42193.B.159388888520223 <at> debbugs.gnu.org>
Resent-Sender: help-debbugs@HIDDEN
X-GNU-PR-Message: followup 42193
X-GNU-PR-Package: guix-patches
X-GNU-PR-Keywords: 
To: 42193 <at> debbugs.gnu.org
X-Debbugs-Original-To: guix-patches@HIDDEN
Received: via spool by submit <at> debbugs.gnu.org id=B.159388888520223
          (code B ref -1); Sat, 04 Jul 2020 18:55:03 +0000
Received: (at submit) by debbugs.gnu.org; 4 Jul 2020 18:54:45 +0000
Received: from localhost ([127.0.0.1]:59627 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1jrnJE-0005G1-Iw
	for submit <at> debbugs.gnu.org; Sat, 04 Jul 2020 14:54:44 -0400
Received: from lists.gnu.org ([209.51.188.17]:45504)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <brice@HIDDEN>) id 1jrnJC-0005FP-OA
 for submit <at> debbugs.gnu.org; Sat, 04 Jul 2020 14:54:43 -0400
Received: from eggs.gnu.org ([2001:470:142:3::10]:43928)
 by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.90_1) (envelope-from <brice@HIDDEN>) id 1jrnJC-0006TR-Fj
 for guix-patches@HIDDEN; Sat, 04 Jul 2020 14:54:42 -0400
Received: from relay4-d.mail.gandi.net ([217.70.183.196]:50675)
 by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.90_1) (envelope-from <brice@HIDDEN>) id 1jrnJA-0006nX-9R
 for guix-patches@HIDDEN; Sat, 04 Jul 2020 14:54:42 -0400
X-Originating-IP: 176.181.186.101
Received: from localhost (i15-les02-ntr-176-181-186-101.sfr.lns.abo.bbox.fr
 [176.181.186.101]) (Authenticated sender: brice@HIDDEN)
 by relay4-d.mail.gandi.net (Postfix) with ESMTPSA id 086E7E0007
 for <guix-patches@HIDDEN>; Sat,  4 Jul 2020 18:54:38 +0000 (UTC)
From: Brice Waegeneire <brice@HIDDEN>
Date: Sat,  4 Jul 2020 20:54:30 +0200
Message-Id: <20200704185431.13739-6-brice@HIDDEN>
X-Mailer: git-send-email 2.26.2
In-Reply-To: <20200704185234.12571-1-brice@HIDDEN>
References: <20200704185234.12571-1-brice@HIDDEN>
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit
Received-SPF: pass client-ip=217.70.183.196; envelope-from=brice@HIDDEN;
 helo=relay4-d.mail.gandi.net
X-detected-operating-system: by eggs.gnu.org: First seen = 2020/07/04 14:54:36
X-ACL-Warn: Detected OS   = Linux 3.11 and newer
X-Spam_score_int: -25
X-Spam_score: -2.6
X-Spam_bar: --
X-Spam_report: (-2.6 / 5.0 requ) BAYES_00=-1.9, RCVD_IN_DNSWL_LOW=-0.7,
 RCVD_IN_MSPIKE_H3=-0.01, RCVD_IN_MSPIKE_WL=-0.01, SPF_HELO_NONE=0.001,
 SPF_PASS=-0.001 autolearn=_AUTOLEARN
X-Spam_action: no action
X-Spam-Score: -1.6 (-)
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -2.6 (--)

---
 gnu/services.scm | 14 ++++++++++++++
 gnu/system.scm   | 39 +++++++++++++++++++++++++++++++++++++--
 2 files changed, 51 insertions(+), 2 deletions(-)

diff --git a/gnu/services.scm b/gnu/services.scm
index 7df9bf9d46..7cf71ae97a 100644
--- a/gnu/services.scm
+++ b/gnu/services.scm
@@ -538,6 +538,20 @@ possible (that is if there's a LINUX keyword argument in the build system)."
                              (kernel kernel)   ;the kernel package to use
                              (packages (append packages additional-packages))))))))
 
+
+;;;
+;;; Kernel arguments.
+;;;
+
+;; (define kernel-arguments-service-type
+;;   (service-type (name 'kernel-arguments)
+;;                 (description "Set the kernel arguments.")
+;;                 (extensions
+;;                  (list (service-extension system-service-type
+;;                                           kernel-arguments->profile-entry)))
+;;                 (compose concatenate)
+;;                 (extend append)))
+
 
 ;;;
 ;;; Cleanup.
diff --git a/gnu/system.scm b/gnu/system.scm
index ba9eeb66b8..805aa2ab01 100644
--- a/gnu/system.scm
+++ b/gnu/system.scm
@@ -56,6 +56,7 @@
   #:use-module (gnu packages compression)
   #:use-module (gnu packages firmware)
   #:use-module (gnu services)
+  #:use-module (gnu services linux)
   #:use-module (gnu services shepherd)
   #:use-module (gnu services base)
   #:use-module (gnu services linux)
@@ -258,11 +259,37 @@
   (sudoers-file operating-system-sudoers-file     ; file-like
                 (default %sudoers-specification)))
 
+(define (operating-system-modules-kernel-arguments os)
+  "Return the kernel arguments for builtin modules specified in
+<kernel-module-configuration-service-type> from OS."
+  (let* ((kernel-module-configuration-service
+          (find (lambda (service)
+                  (eq? (service-kind service)
+                       kernel-module-configuration-service-type))
+                (operating-system-user-services os)))
+         (modules (if kernel-module-configuration-service
+                      (service-value kernel-module-configuration-service)
+                      '())))
+    (display kernel-module-configuration-service)
+    (display (concatenate
+     (filter-map (lambda (module)
+                   (if (kernel-module-is-builtin? module)
+                       (kernel-module->kernel-arguments module)
+                       #f))
+                 modules)))
+    (concatenate
+     (filter-map (lambda (module)
+                   (if (kernel-module-is-builtin? module)
+                       (kernel-module->kernel-arguments module)
+                       #f))
+                 modules))))
+
 (define (operating-system-kernel-arguments os root-device)
   "Return all the kernel arguments, including the ones not specified
 directly by the user."
   (append (bootable-kernel-arguments os root-device)
-          (operating-system-user-kernel-arguments os)))
+          (operating-system-user-kernel-arguments os)
+          (operating-system-modules-kernel-arguments os)))
 
 
 ;;;
@@ -512,6 +539,7 @@ OS."
       (file-append (operating-system-kernel os)
                       "/" (system-linux-image-file-name))))
 
+;; TODO Migrate to KMCS
 (define %default-modprobe-blacklist
   ;; List of kernel modules to blacklist by default.
   '("usbmouse" ;races with bcm5974, see <https://bugs.gnu.org/35574>
@@ -569,6 +597,11 @@ bookkeeping."
                     (kernel-profile-configuration
                      (kernel (operating-system-kernel os))
                      (packages (operating-system-kernel-loadable-modules os))))
+           ;; (service kernel-arguments-service-type
+           ;;          (kernel-arguments-configuration
+           ;;           (root (operating-system-root-file-system os))
+           ;;           (bootloader (operating-system-bootloader os))
+           ;;           (parameters "TODO")))
            %boot-service
 
            ;; %SHEPHERD-ROOT-SERVICE must come last so that the gexp that
@@ -1232,7 +1265,9 @@ such as '--root' and '--load' to <boot-parameters>."
      (kernel-arguments
       (if system-kernel-arguments?
           (operating-system-kernel-arguments os root-device)
-          (operating-system-user-kernel-arguments os)))
+          (append
+           (operating-system-user-kernel-arguments os)
+           (operating-system-modules-kernel-arguments os))))
      (initrd initrd)
      (multiboot-modules multiboot-modules)
      (bootloader-name bootloader-name)
-- 
2.26.2





Message sent to guix-patches@HIDDEN:


X-Loop: help-debbugs@HIDDEN
Subject: [bug#42193] [WIP 2/6] services: Add 'kernel-profile-service-type'.
Resent-From: Brice Waegeneire <brice@HIDDEN>
Original-Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
Resent-CC: guix-patches@HIDDEN
Resent-Date: Sat, 04 Jul 2020 18:55:03 +0000
Resent-Message-ID: <handler.42193.B.159388888520231 <at> debbugs.gnu.org>
Resent-Sender: help-debbugs@HIDDEN
X-GNU-PR-Message: followup 42193
X-GNU-PR-Package: guix-patches
X-GNU-PR-Keywords: 
To: 42193 <at> debbugs.gnu.org
X-Debbugs-Original-To: guix-patches@HIDDEN
Received: via spool by submit <at> debbugs.gnu.org id=B.159388888520231
          (code B ref -1); Sat, 04 Jul 2020 18:55:03 +0000
Received: (at submit) by debbugs.gnu.org; 4 Jul 2020 18:54:45 +0000
Received: from localhost ([127.0.0.1]:59629 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1jrnJE-0005G8-W5
	for submit <at> debbugs.gnu.org; Sat, 04 Jul 2020 14:54:45 -0400
Received: from lists.gnu.org ([209.51.188.17]:45502)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <brice@HIDDEN>) id 1jrnJC-0005FM-5d
 for submit <at> debbugs.gnu.org; Sat, 04 Jul 2020 14:54:43 -0400
Received: from eggs.gnu.org ([2001:470:142:3::10]:43916)
 by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.90_1) (envelope-from <brice@HIDDEN>) id 1jrnJB-0006TM-Tq
 for guix-patches@HIDDEN; Sat, 04 Jul 2020 14:54:41 -0400
Received: from relay7-d.mail.gandi.net ([217.70.183.200]:43355)
 by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.90_1) (envelope-from <brice@HIDDEN>) id 1jrnJ9-0006nH-5b
 for guix-patches@HIDDEN; Sat, 04 Jul 2020 14:54:41 -0400
X-Originating-IP: 176.181.186.101
Received: from localhost (i15-les02-ntr-176-181-186-101.sfr.lns.abo.bbox.fr
 [176.181.186.101]) (Authenticated sender: brice@HIDDEN)
 by relay7-d.mail.gandi.net (Postfix) with ESMTPSA id 0178A20002
 for <guix-patches@HIDDEN>; Sat,  4 Jul 2020 18:54:36 +0000 (UTC)
From: Brice Waegeneire <brice@HIDDEN>
Date: Sat,  4 Jul 2020 20:54:27 +0200
Message-Id: <20200704185431.13739-3-brice@HIDDEN>
X-Mailer: git-send-email 2.26.2
In-Reply-To: <20200704185234.12571-1-brice@HIDDEN>
References: <20200704185234.12571-1-brice@HIDDEN>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Received-SPF: pass client-ip=217.70.183.200; envelope-from=brice@HIDDEN;
 helo=relay7-d.mail.gandi.net
X-detected-operating-system: by eggs.gnu.org: First seen = 2020/07/04 14:54:37
X-ACL-Warn: Detected OS   = Linux 3.11 and newer
X-Spam_score_int: -35
X-Spam_score: -3.6
X-Spam_bar: ---
X-Spam_report: (-3.6 / 5.0 requ) BAYES_00=-1.9, RCVD_IN_DNSWL_LOW=-0.7,
 RCVD_IN_MSPIKE_H2=-1, SPF_HELO_NONE=0.001,
 SPF_PASS=-0.001 autolearn=_AUTOLEARN
X-Spam_action: no action
X-Spam-Score: -1.6 (-)
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -2.6 (--)

* gnu/system.scm (operating-system-default-essential-services): Use
'kernel-profile-service-type'.
(operating-system-default-essential-services): Remove kernel profile.
(package-for-kernel): Move it to …
* gnu/services.scm (package-for-kernel): … here.
(kernel-profile-configuration,
kernel-profile-configuration->profile-entry,
kernel-profile-service-type): New variables.
* gnu/tests/linux-modules.scm (run-loadable-kernel-modules-test): Test
'kernel-profile-service-type'.
---
 gnu/services.scm            | 66 ++++++++++++++++++++++++++++++++++++-
 gnu/system.scm              | 14 +++-----
 gnu/tests/linux-modules.scm | 10 +++---
 3 files changed, 75 insertions(+), 15 deletions(-)

diff --git a/gnu/services.scm b/gnu/services.scm
index f6dc56d940..b5ec222207 100644
--- a/gnu/services.scm
+++ b/gnu/services.scm
@@ -2,6 +2,7 @@
 ;;; Copyright © 2015, 2016, 2017, 2018, 2019, 2020 Ludovic Courtès <ludo@HIDDEN>
 ;;; Copyright © 2016 Chris Marusich <cmmarusich@HIDDEN>
 ;;; Copyright © 2020 Jan (janneke) Nieuwenhuizen <janneke@HIDDEN>
+;;; Copyright © 2020 Brice Waegeneire <brice@HIDDEN>
 ;;;
 ;;; This file is part of GNU Guix.
 ;;;
@@ -30,9 +31,11 @@
   #:use-module (guix describe)
   #:use-module (guix sets)
   #:use-module (guix ui)
-  #:use-module ((guix utils) #:select (source-properties->location))
+  #:use-module ((guix utils) #:select (source-properties->location
+                                       substitute-keyword-arguments))
   #:autoload   (guix openpgp) (openpgp-format-fingerprint)
   #:use-module (guix modules)
+  #:use-module (guix packages)
   #:use-module (gnu packages base)
   #:use-module (gnu packages bash)
   #:use-module (gnu packages hurd)
@@ -105,6 +108,12 @@
             firmware-service-type
             gc-root-service-type
 
+            kernel-profile-configuration
+            kernel-profile-configuration?
+            kernel-profile-configuration-kernel
+            kernel-profile-configuration-packages
+            kernel-profile-service-type
+
             %boot-service
             %activation-service
             etc-service))
@@ -474,6 +483,61 @@ channels in use and CONFIG-FILE, if it is true."
 itself: the channels used when building the system, and its configuration
 file, when available.")))
 
+
+;;;
+;;; Kernel profile.
+;;;
+
+(define-record-type* <kernel-profile-configuration>
+  kernel-profile-configuration make-kernel-profile-configuration
+  kernel-profile-configuration?
+  (kernel   kernel-profile-configuration-kernel)   ; <package>
+  (packages kernel-profile-configuration-packages  ; list of <package>
+            (default '())))
+
+(define (package-for-kernel target-kernel module-package)
+  "Return a package like MODULE-PACKAGE, adapted for TARGET-KERNEL, if
+possible (that is if there's a LINUX keyword argument in the build system)."
+  (package
+    (inherit module-package)
+    (arguments
+     (substitute-keyword-arguments (package-arguments module-package)
+       ((#:linux kernel #f)
+        target-kernel)))))
+
+(define (kernel-profile-configuration->profile-entry config)
+  "Return a system entry for the kernel profile CONFIG."
+  (let* ((kernel (kernel-profile-configuration-kernel config))
+         (packages (map (lambda (package)
+                          (if (package? package)
+                              (package-for-kernel kernel
+                                                  package)
+                              package))
+                        (kernel-profile-configuration-packages config))))
+    (with-monad %store-monad
+      (return `(("kernel"
+                 ,(profile
+                   (content (packages->manifest
+                             (cons kernel
+                                   (delete-duplicates packages eq?))))
+                   (hooks (list linux-module-database)))))))))
+
+(define kernel-profile-service-type
+  (service-type (name 'kernel-profile)
+                (description "This is the @dfn{kernel profile}, available as
+@file{/run/current-system/kernel}.")
+                (extensions
+                 (list (service-extension
+                        system-service-type
+                        kernel-profile-configuration->profile-entry)))
+                (compose concatenate)
+                (extend (lambda (config additional-packages)
+                          (match-record config <kernel-profile-configuration>
+                            (kernel packages)
+                            (kernel-profile-configuration
+                             (kernel kernel)   ;the kernel package to use
+                             (packages (append packages additional-packages))))))))
+
 
 ;;;
 ;;; Cleanup.
diff --git a/gnu/system.scm b/gnu/system.scm
index bfbcb6fbdd..ff374dddda 100644
--- a/gnu/system.scm
+++ b/gnu/system.scm
@@ -511,16 +511,6 @@ OS."
       (file-append (operating-system-kernel os)
                       "/" (system-linux-image-file-name))))
 
-(define (package-for-kernel target-kernel module-package)
-  "Return a package like MODULE-PACKAGE, adapted for TARGET-KERNEL, if
-possible (that is if there's a LINUX keyword argument in the build system)."
-  (package
-    (inherit module-package)
-    (arguments
-     (substitute-keyword-arguments (package-arguments module-package)
-       ((#:linux kernel #f)
-        target-kernel)))))
-
 (define %default-modprobe-blacklist
   ;; List of kernel modules to blacklist by default.
   '("usbmouse" ;races with bcm5974, see <https://bugs.gnu.org/35574>
@@ -574,6 +564,10 @@ bookkeeping."
          (host-name (host-name-service (operating-system-host-name os)))
          (entries   (operating-system-directory-base-entries os)))
     (cons* (service system-service-type entries)
+           (service kernel-profile-service-type
+                    (kernel-profile-configuration
+                     (kernel (operating-system-kernel os))
+                     (packages (operating-system-kernel-loadable-modules os))))
            %boot-service
 
            ;; %SHEPHERD-ROOT-SERVICE must come last so that the gexp that
diff --git a/gnu/tests/linux-modules.scm b/gnu/tests/linux-modules.scm
index 953b132ef7..22e9a0c65c 100644
--- a/gnu/tests/linux-modules.scm
+++ b/gnu/tests/linux-modules.scm
@@ -73,10 +73,12 @@ are loaded in memory."
     (marionette-operating-system
      (operating-system
       (inherit (simple-operating-system))
-      (services (cons (service kernel-module-loader-service-type module-names)
-                      (operating-system-user-services
-                       (simple-operating-system))))
-      (kernel-loadable-modules module-packages))
+      (services (cons* (service kernel-module-loader-service-type module-names)
+                       (simple-service 'kernel-module-packages
+                                       kernel-profile-service-type
+                                       module-packages)
+                       (operating-system-user-services
+                        (simple-operating-system)))))
      #:imported-modules '((guix combinators))))
   (define vm (virtual-machine os))
   (define (test script)
-- 
2.26.2





Message sent to guix-patches@HIDDEN:


X-Loop: help-debbugs@HIDDEN
Subject: [bug#42193] [WIP 1/6] services: simulated-wifi: Use 'kernel-module-loader'.
Resent-From: Brice Waegeneire <brice@HIDDEN>
Original-Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
Resent-CC: guix-patches@HIDDEN
Resent-Date: Sat, 04 Jul 2020 18:55:04 +0000
Resent-Message-ID: <handler.42193.B.159388888620238 <at> debbugs.gnu.org>
Resent-Sender: help-debbugs@HIDDEN
X-GNU-PR-Message: followup 42193
X-GNU-PR-Package: guix-patches
X-GNU-PR-Keywords: 
To: 42193 <at> debbugs.gnu.org
X-Debbugs-Original-To: guix-patches@HIDDEN
Received: via spool by submit <at> debbugs.gnu.org id=B.159388888620238
          (code B ref -1); Sat, 04 Jul 2020 18:55:04 +0000
Received: (at submit) by debbugs.gnu.org; 4 Jul 2020 18:54:46 +0000
Received: from localhost ([127.0.0.1]:59631 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1jrnJF-0005GG-GD
	for submit <at> debbugs.gnu.org; Sat, 04 Jul 2020 14:54:45 -0400
Received: from lists.gnu.org ([209.51.188.17]:45506)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <brice@HIDDEN>) id 1jrnJC-0005FV-Uk
 for submit <at> debbugs.gnu.org; Sat, 04 Jul 2020 14:54:43 -0400
Received: from eggs.gnu.org ([2001:470:142:3::10]:43932)
 by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.90_1) (envelope-from <brice@HIDDEN>) id 1jrnJC-0006TV-Md
 for guix-patches@HIDDEN; Sat, 04 Jul 2020 14:54:42 -0400
Received: from relay4-d.mail.gandi.net ([217.70.183.196]:40309)
 by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.90_1) (envelope-from <brice@HIDDEN>) id 1jrnJ8-0006nC-Tp
 for guix-patches@HIDDEN; Sat, 04 Jul 2020 14:54:42 -0400
X-Originating-IP: 176.181.186.101
Received: from localhost (i15-les02-ntr-176-181-186-101.sfr.lns.abo.bbox.fr
 [176.181.186.101]) (Authenticated sender: brice@HIDDEN)
 by relay4-d.mail.gandi.net (Postfix) with ESMTPSA id 3675AE0002
 for <guix-patches@HIDDEN>; Sat,  4 Jul 2020 18:54:35 +0000 (UTC)
From: Brice Waegeneire <brice@HIDDEN>
Date: Sat,  4 Jul 2020 20:54:26 +0200
Message-Id: <20200704185431.13739-2-brice@HIDDEN>
X-Mailer: git-send-email 2.26.2
In-Reply-To: <20200704185234.12571-1-brice@HIDDEN>
References: <20200704185234.12571-1-brice@HIDDEN>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Received-SPF: pass client-ip=217.70.183.196; envelope-from=brice@HIDDEN;
 helo=relay4-d.mail.gandi.net
X-detected-operating-system: by eggs.gnu.org: First seen = 2020/07/04 14:54:36
X-ACL-Warn: Detected OS   = Linux 3.11 and newer
X-Spam_score_int: -25
X-Spam_score: -2.6
X-Spam_bar: --
X-Spam_report: (-2.6 / 5.0 requ) BAYES_00=-1.9, RCVD_IN_DNSWL_LOW=-0.7,
 RCVD_IN_MSPIKE_H3=-0.01, RCVD_IN_MSPIKE_WL=-0.01, SPF_HELO_NONE=0.001,
 SPF_PASS=-0.001 autolearn=_AUTOLEARN
X-Spam_action: no action
X-Spam-Score: -1.6 (-)
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -2.6 (--)

* gnu/services/networking.scm (simulated-wifi-shepherd-services):
Change 'mac-simulation-module' service to use 'kernel-module-loader'.
---
 gnu/services/networking.scm | 25 +++++++------------------
 1 file changed, 7 insertions(+), 18 deletions(-)

diff --git a/gnu/services/networking.scm b/gnu/services/networking.scm
index 348dc369d8..353fdce2bb 100644
--- a/gnu/services/networking.scm
+++ b/gnu/services/networking.scm
@@ -13,6 +13,7 @@
 ;;; Copyright © 2019 Maxim Cournoyer <maxim.cournoyer@HIDDEN>
 ;;; Copyright © 2019 Sou Bunnbu <iyzsong@HIDDEN>
 ;;; Copyright © 2019 Alex Griffin <a@HIDDEN>
+;;; Copyright © 2020 Brice Waegeneire <brice@HIDDEN>
 ;;;
 ;;; This file is part of GNU Guix.
 ;;;
@@ -33,6 +34,7 @@
   #:use-module (gnu services)
   #:use-module (gnu services base)
   #:use-module (gnu services configuration)
+  #:use-module (gnu services linux)
   #:use-module (gnu services shepherd)
   #:use-module (gnu services dbus)
   #:use-module (gnu system shadow)
@@ -1442,10 +1444,10 @@ simulation."
   (append (hostapd-shepherd-services config
                                      #:requirement
                                      '(unblocked-wifi
-                                       mac-simulation-module))
+                                       kernel-module-loader))
           (list (shepherd-service
                  (provision '(unblocked-wifi))
-                 (requirement '(file-systems mac-simulation-module))
+                 (requirement '(file-systems kernel-module-loader))
                  (documentation
                   "Unblock WiFi devices for use by mac80211_hwsim.")
                  (start #~(lambda _
@@ -1453,21 +1455,6 @@ simulation."
                                     "unblock" "0")
                             (invoke #$(file-append util-linux "/sbin/rfkill")
                                     "unblock" "1")))
-                 (one-shot? #t))
-                (shepherd-service
-                 (provision '(mac-simulation-module))
-                 (requirement '(file-systems))
-                 (modules '((guix build utils)))
-                 (documentation
-                  "Load the mac80211_hwsim Linux kernel module.")
-                 (start (with-imported-modules '((guix build utils))
-                          #~(lambda _
-                              ;; XXX: We can't use 'load-linux-module*' here because it
-                              ;; expects a flat module directory.
-                              (setenv "LINUX_MODULE_DIRECTORY"
-                                      "/run/booted-system/kernel/lib/modules")
-                              (invoke #$(file-append kmod "/bin/modprobe")
-                                      "mac80211_hwsim"))))
                  (one-shot? #t)))))
 
 (define simulated-wifi-service-type
@@ -1475,7 +1462,9 @@ simulation."
    (name 'simulated-wifi)
    (extensions
     (list (service-extension shepherd-root-service-type
-                             simulated-wifi-shepherd-services)))
+                             simulated-wifi-shepherd-services)
+          (service-extension kernel-module-loader-service-type
+                             (const '("mac80211_hwsim")))))
    (default-value (hostapd-configuration
                    (interface "wlan1")
                    (ssid "Test Network")))
-- 
2.26.2





Message sent to guix-patches@HIDDEN:


X-Loop: help-debbugs@HIDDEN
Subject: [bug#42193] [WIP 4/6] services: kernel-module-loader: Return a single 'shepherd-service'.
Resent-From: Brice Waegeneire <brice@HIDDEN>
Original-Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
Resent-CC: guix-patches@HIDDEN
Resent-Date: Sat, 04 Jul 2020 18:55:04 +0000
Resent-Message-ID: <handler.42193.B.159388888620244 <at> debbugs.gnu.org>
Resent-Sender: help-debbugs@HIDDEN
X-GNU-PR-Message: followup 42193
X-GNU-PR-Package: guix-patches
X-GNU-PR-Keywords: 
To: 42193 <at> debbugs.gnu.org
X-Debbugs-Original-To: guix-patches@HIDDEN
Received: via spool by submit <at> debbugs.gnu.org id=B.159388888620244
          (code B ref -1); Sat, 04 Jul 2020 18:55:04 +0000
Received: (at submit) by debbugs.gnu.org; 4 Jul 2020 18:54:46 +0000
Received: from localhost ([127.0.0.1]:59633 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1jrnJF-0005GN-SL
	for submit <at> debbugs.gnu.org; Sat, 04 Jul 2020 14:54:46 -0400
Received: from lists.gnu.org ([209.51.188.17]:45508)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <brice@HIDDEN>) id 1jrnJD-0005Fb-3G
 for submit <at> debbugs.gnu.org; Sat, 04 Jul 2020 14:54:43 -0400
Received: from eggs.gnu.org ([2001:470:142:3::10]:43934)
 by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.90_1) (envelope-from <brice@HIDDEN>) id 1jrnJC-0006TY-Qz
 for guix-patches@HIDDEN; Sat, 04 Jul 2020 14:54:42 -0400
Received: from relay5-d.mail.gandi.net ([217.70.183.197]:53489)
 by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.90_1) (envelope-from <brice@HIDDEN>) id 1jrnJA-0006nU-Jw
 for guix-patches@HIDDEN; Sat, 04 Jul 2020 14:54:42 -0400
X-Originating-IP: 176.181.186.101
Received: from localhost (i15-les02-ntr-176-181-186-101.sfr.lns.abo.bbox.fr
 [176.181.186.101]) (Authenticated sender: brice@HIDDEN)
 by relay5-d.mail.gandi.net (Postfix) with ESMTPSA id 6B9A91C0003
 for <guix-patches@HIDDEN>; Sat,  4 Jul 2020 18:54:38 +0000 (UTC)
From: Brice Waegeneire <brice@HIDDEN>
Date: Sat,  4 Jul 2020 20:54:29 +0200
Message-Id: <20200704185431.13739-5-brice@HIDDEN>
X-Mailer: git-send-email 2.26.2
In-Reply-To: <20200704185234.12571-1-brice@HIDDEN>
References: <20200704185234.12571-1-brice@HIDDEN>
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit
Received-SPF: pass client-ip=217.70.183.197; envelope-from=brice@HIDDEN;
 helo=relay5-d.mail.gandi.net
X-detected-operating-system: by eggs.gnu.org: First seen = 2020/07/04 14:54:38
X-ACL-Warn: Detected OS   = Linux 3.11 and newer
X-Spam_score_int: -35
X-Spam_score: -3.6
X-Spam_bar: ---
X-Spam_report: (-3.6 / 5.0 requ) BAYES_00=-1.9, RCVD_IN_DNSWL_LOW=-0.7,
 RCVD_IN_MSPIKE_H2=-1, SPF_HELO_NONE=0.001,
 SPF_PASS=-0.001 autolearn=_AUTOLEARN
X-Spam_action: no action
X-Spam-Score: -1.6 (-)
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -2.6 (--)

* gnu/services/linux.scm (kernel-module-loader-shepherd-service): Return
a 'shepherd-service' instead of a list of it.
(kernel-module-loader-service-type): Adjust it.
---
 gnu/services/linux.scm | 59 +++++++++++++++++++++---------------------
 1 file changed, 29 insertions(+), 30 deletions(-)

diff --git a/gnu/services/linux.scm b/gnu/services/linux.scm
index c608cc4d8d..7ea30a1270 100644
--- a/gnu/services/linux.scm
+++ b/gnu/services/linux.scm
@@ -140,35 +140,34 @@ representation."
 (define kernel-module-loader-shepherd-service
   (match-lambda
     ((and (? list? kernel-modules) ((? string?) ...))
-     (list
-      (shepherd-service
-       (documentation "Load kernel modules.")
-       (provision '(kernel-module-loader))
-       (requirement '(file-systems))
-       (one-shot? #t)
-       (modules `((srfi srfi-1)
-                  (srfi srfi-34)
-                  (srfi srfi-35)
-                  (rnrs io ports)
-                  ,@%default-modules))
-       (start
-        #~(lambda _
-            (cond
-             ((null? '#$kernel-modules) #t)
-             ((file-exists? "/proc/sys/kernel/modprobe")
-              (let ((modprobe (call-with-input-file
-                               "/proc/sys/kernel/modprobe" get-line)))
-                (guard (c ((message-condition? c)
-                           (format (current-error-port) "~a~%"
-                                   (condition-message c))
-                           #f))
-                  (every (lambda (module)
-                         (invoke/quiet modprobe "--" module))
-                         '#$kernel-modules))))
-             (else
-               (format (current-error-port) "error: ~a~%"
-                       "Kernel is missing loadable module support.")
-               #f)))))))))
+     (shepherd-service
+      (documentation "Load kernel modules.")
+      (provision '(kernel-module-loader))
+      (requirement '(file-systems))
+      (one-shot? #t)
+      (modules `((srfi srfi-1)
+                 (srfi srfi-34)
+                 (srfi srfi-35)
+                 (rnrs io ports)
+                 ,@%default-modules))
+      (start
+       #~(lambda _
+           (cond
+            ((null? '#$kernel-modules) #t)
+            ((file-exists? "/proc/sys/kernel/modprobe")
+             (let ((modprobe (call-with-input-file
+                                 "/proc/sys/kernel/modprobe" get-line)))
+               (guard (c ((message-condition? c)
+                          (format (current-error-port) "~a~%"
+                                  (condition-message c))
+                          #f))
+                 (every (lambda (module)
+                          (invoke/quiet modprobe "--" module))
+                        '#$kernel-modules))))
+            (else
+             (format (current-error-port) "error: ~a~%"
+                     "Kernel is missing loadable module support.")
+             #f))))))))
 
 (define kernel-module-loader-service-type
   (service-type
@@ -176,7 +175,7 @@ representation."
    (description "Load kernel modules.")
    (extensions
     (list (service-extension shepherd-root-service-type
-                             kernel-module-loader-shepherd-service)))
+                             (compose list kernel-module-loader-shepherd-service))))
    (compose concatenate)
    (extend append)
    (default-value '())))
-- 
2.26.2





Message sent to guix-patches@HIDDEN:


X-Loop: help-debbugs@HIDDEN
Subject: [bug#42193] [WIP 6/6] WIP services: Add kernel-module-configuration service.
Resent-From: Brice Waegeneire <brice@HIDDEN>
Original-Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
Resent-CC: guix-patches@HIDDEN
Resent-Date: Sat, 04 Jul 2020 18:55:04 +0000
Resent-Message-ID: <handler.42193.B.159388888720253 <at> debbugs.gnu.org>
Resent-Sender: help-debbugs@HIDDEN
X-GNU-PR-Message: followup 42193
X-GNU-PR-Package: guix-patches
X-GNU-PR-Keywords: 
To: 42193 <at> debbugs.gnu.org
X-Debbugs-Original-To: guix-patches@HIDDEN
Received: via spool by submit <at> debbugs.gnu.org id=B.159388888720253
          (code B ref -1); Sat, 04 Jul 2020 18:55:04 +0000
Received: (at submit) by debbugs.gnu.org; 4 Jul 2020 18:54:47 +0000
Received: from localhost ([127.0.0.1]:59635 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1jrnJH-0005Ga-5t
	for submit <at> debbugs.gnu.org; Sat, 04 Jul 2020 14:54:47 -0400
Received: from lists.gnu.org ([209.51.188.17]:45510)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <brice@HIDDEN>) id 1jrnJD-0005Fn-Jm
 for submit <at> debbugs.gnu.org; Sat, 04 Jul 2020 14:54:44 -0400
Received: from eggs.gnu.org ([2001:470:142:3::10]:43936)
 by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.90_1) (envelope-from <brice@HIDDEN>) id 1jrnJD-0006Tg-BI
 for guix-patches@HIDDEN; Sat, 04 Jul 2020 14:54:43 -0400
Received: from relay7-d.mail.gandi.net ([217.70.183.200]:46061)
 by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.90_1) (envelope-from <brice@HIDDEN>) id 1jrnJA-0006nj-Vn
 for guix-patches@HIDDEN; Sat, 04 Jul 2020 14:54:43 -0400
X-Originating-IP: 176.181.186.101
Received: from localhost (i15-les02-ntr-176-181-186-101.sfr.lns.abo.bbox.fr
 [176.181.186.101]) (Authenticated sender: brice@HIDDEN)
 by relay7-d.mail.gandi.net (Postfix) with ESMTPSA id 955E020004
 for <guix-patches@HIDDEN>; Sat,  4 Jul 2020 18:54:39 +0000 (UTC)
From: Brice Waegeneire <brice@HIDDEN>
Date: Sat,  4 Jul 2020 20:54:31 +0200
Message-Id: <20200704185431.13739-7-brice@HIDDEN>
X-Mailer: git-send-email 2.26.2
In-Reply-To: <20200704185234.12571-1-brice@HIDDEN>
References: <20200704185234.12571-1-brice@HIDDEN>
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit
Received-SPF: pass client-ip=217.70.183.200; envelope-from=brice@HIDDEN;
 helo=relay7-d.mail.gandi.net
X-detected-operating-system: by eggs.gnu.org: First seen = 2020/07/04 14:54:37
X-ACL-Warn: Detected OS   = Linux 3.11 and newer
X-Spam_score_int: -35
X-Spam_score: -3.6
X-Spam_bar: ---
X-Spam_report: (-3.6 / 5.0 requ) BAYES_00=-1.9, RCVD_IN_DNSWL_LOW=-0.7,
 RCVD_IN_MSPIKE_H2=-1, SPF_HELO_NONE=0.001,
 SPF_PASS=-0.001 autolearn=_AUTOLEARN
X-Spam_action: no action
X-Spam-Score: -1.6 (-)
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -2.6 (--)

---
 gnu/services/linux.scm      | 166 +++++++++++++++++++++++++++++++++++-
 gnu/tests/linux-modules.scm |  67 +++++++++------
 2 files changed, 208 insertions(+), 25 deletions(-)

diff --git a/gnu/services/linux.scm b/gnu/services/linux.scm
index 7ea30a1270..9773dd5072 100644
--- a/gnu/services/linux.scm
+++ b/gnu/services/linux.scm
@@ -45,7 +45,22 @@
 
             kernel-module-loader-service-type
 
-            modprobe-service-type))
+            modprobe-service-type
+
+            kernel-module
+            kernel-module?
+            kernel-module-name
+            kernel-module-package
+            kernel-module-aliases
+            kernel-module-install
+            kernel-module-remove
+            kernel-module-pre-dependencies
+            kernel-module-post-dependencies
+            kernel-module-blacklist?
+            kernel-module-load?
+            kernel-module-is-builtin?
+            kernel-module->kernel-arguments
+            kernel-module-configuration-service-type))
 
 
 ;;;
@@ -151,6 +166,9 @@ representation."
                  (rnrs io ports)
                  ,@%default-modules))
       (start
+       ;; TODO Verify that we are loading a loadable kernel and not a builtin
+       ;; one looking in
+       ;; /run/booted-system/kernel/lib/modules/5.4.39/modules.builtin
        #~(lambda _
            (cond
             ((null? '#$kernel-modules) #t)
@@ -227,3 +245,149 @@ files."
                              modprobe-environment)))
    (compose concatenate)
    (extend append)))
+
+
+;;;
+;;; Kernel module configuration.
+;;;
+
+;; NOTE Maybe have sperate records betwwen <kernel-builtin-module> and
+;; <kernel-lodable-module>
+(define-record-type* <kernel-module>
+  kernel-module make-kernel-module
+  kernel-module?
+  (name               kernel-module-name) ; string
+  ;; For out-of-tree modules
+  (package            kernel-module-package
+                      (default #f))     ; #f | <package>
+  ;; NOTE Maybe use an alist instead
+  (options            kernel-module-options
+                      (default '()))    ; list of strings
+  (aliases            kernel-module-aliases
+                      (default '()))    ; list of strings
+  (install            kernel-module-install
+                      (default #f))     ; #f | string
+  (remove             kernel-module-remove
+                      (default #f))     ; #f | string
+  (pre-dependencies   kernel-module-pre-dependencies
+                      (default '()))    ; list of strings
+  (post-dependencies  kernel-module-post-dependencies
+                      (default '()))    ; list of strings
+  (blacklist?         kernel-module-blacklist?
+                      (default #f)) ; boolean
+  ;; NOTE Only possible if it's not built-in
+  ;; TODO maybe trow an error when it's set to true on a built-in module
+  (load?              kernel-module-load?
+                      (default #f)))                ; boolean
+
+;; FIXME use 'modules.builtin' instead
+(define (kernel-module-is-builtin? module)
+  (if (kernel-module-package module) #f
+      #t))
+
+(define (kernel-module->kernel-arguments module)
+  "Return a list of kernel arguments for MODULE."
+  (match-record module <kernel-module>
+    (name options blacklist?)
+    (filter (lambda (s) (not (string-null? s)))
+            (list (if blacklist? (string-append name ".blacklist=yes") "")
+                  (if (null? options) ""
+                      (map (lambda (option)
+                             (string-append name "." option))
+                           options))))))
+
+(define (kernel-module->config module)
+  "Return a config string for MODULE."
+  (match-record module <kernel-module>
+    (name options aliases install remove pre-dependencies
+          post-dependencies blacklist?)
+    (string-concatenate
+     (list (if (null? options) ""
+               (format #f "options ~a~{ ~a~}\n" name options))
+           (if blacklist? (format #f "blacklist ~a\n" name)
+               "")
+           (if (null? aliases) ""
+               (map (lambda (alias)
+                      (format #f "alias ~a ~a\n" alias name))
+                    aliases))
+           (if install (format #f "install ~a ~a\n" name install)
+               "")
+           (if remove (format #f "remove ~a ~a\n" name remove)
+               "")
+           (if (null? pre-dependencies) ""
+               (map (lambda (dependency)
+                      (format #f "softdep ~a :pre ~a\n"
+                              name dependency))
+                    pre-dependencies))
+           (if (null? post-dependencies) ""
+               (map (lambda (dependency)
+                      (format #f "softdep ~a :post ~a\n"
+                              name dependency))
+                    post-dependencies))))))
+
+(define (string-underscorize s)
+  "Replace '-' characters by '_' in string S."
+  (string-map (lambda (c) (if (char=? c #\-) #\_ c)) s))
+
+(define (kernel-modules->config-files modules)
+  "Return a list of pairs of file name and gexp, to be used by 'file-union',
+from MODULES."
+  (define (kernel-module->filename-gexp module)
+    (let ((config (kernel-module->config module))
+          (name (kernel-module-name module)))
+      (if (string-null? config) #f
+          (list (string-append name ".conf")
+                (plain-file (string-append name ".conf") config)))))
+  (filter-map
+   (lambda (module)
+     (let ((module (kernel-module
+                    (inherit module)
+                    ;; XXX The kernel replace '-' by '_' in module name, we do
+                    ;; the same to make name collision visible, that would
+                    ;; otherwise be hidden.
+                    (name (string-underscorize (kernel-module-name module))))))
+       (if (kernel-module-is-builtin? module) #f
+           (kernel-module->filename-gexp module))))
+   modules))
+
+(define (kernel-modules->packages modules)
+  "Return a list of packages from MODULES."
+  (filter-map (lambda (module)
+                (kernel-module-package module))
+              modules))
+
+(define (kernel-modules-to-load modules)
+  "Return a list of loadable module names, from MODULES, to be loaded."
+  (filter-map (lambda (module)
+                (if (and (not (kernel-module-is-builtin? module))
+                         (kernel-module-load? module))
+                    (kernel-module-name module)
+                    #f))
+              modules))
+
+(define kernel-module-configuration-service-type
+  (service-type
+   (name 'kernel-module-configuration)
+   (description
+    "Configure kernel modules, in similar manner as @file{modprobe.d}.")
+   (default-value '())
+   (extensions
+    (list (service-extension modprobe-service-type
+                             kernel-modules->config-files)
+          (service-extension kernel-profile-service-type
+                             kernel-modules->packages)
+          (service-extension kernel-module-loader-service-type
+                             kernel-modules-to-load)))
+   (compose concatenate)
+   (extend append)))
+
+;; TODO Make a naked modprobe call use MODPROBE_OPTIONS environment or
+;; /proc/sys/kernel/modprobe
+
+;; TODO write a helper to load a module from guile using modprobe command from
+;; '/proc/sys/kernel/modprobe' or %modprobe-wrapper. See linux-module-builder
+;; maybe.
+
+;; NOTE Throw an error when kernel-module-name isn't unique?  It may already
+;; do it by itself already because 2 loadable module will try to create
+;; separeta config file with the same name.
diff --git a/gnu/tests/linux-modules.scm b/gnu/tests/linux-modules.scm
index 22e9a0c65c..296066e68f 100644
--- a/gnu/tests/linux-modules.scm
+++ b/gnu/tests/linux-modules.scm
@@ -32,6 +32,7 @@
   #:use-module (guix monads)
   #:use-module (guix store)
   #:use-module (guix utils)
+  #:use-module (srfi srfi-1)
   #:export (%test-loadable-kernel-modules-0
             %test-loadable-kernel-modules-1
             %test-loadable-kernel-modules-2))
@@ -66,19 +67,18 @@ that MODULES are actually loaded."
                        (member module modules string=?))
                      '#$modules))))))
 
-(define* (run-loadable-kernel-modules-test module-packages module-names)
-  "Run a test of an OS having MODULE-PACKAGES, and verify that MODULE-NAMES
-are loaded in memory."
+(define* (run-loadable-kernel-modules-test modules)
+  "Run a test of an OS having MODULES and verify that they are loaded in
+memory."
   (define os
     (marionette-operating-system
      (operating-system
-      (inherit (simple-operating-system))
-      (services (cons* (service kernel-module-loader-service-type module-names)
-                       (simple-service 'kernel-module-packages
-                                       kernel-profile-service-type
-                                       module-packages)
-                       (operating-system-user-services
-                        (simple-operating-system)))))
+       (inherit (simple-operating-system))
+       (services (cons* (service kernel-module-loader-service-type)
+                        (service kernel-module-configuration-service-type
+                                 modules)
+                        (operating-system-user-services
+                         (simple-operating-system)))))
      #:imported-modules '((guix combinators))))
   (define vm (virtual-machine os))
   (define (test script)
@@ -97,15 +97,20 @@ are loaded in memory."
              marionette))
           (test-end)
           (exit (= (test-runner-fail-count (test-runner-current)) 0)))))
-  (gexp->derivation "loadable-kernel-modules"
-                    (test (modules-loaded?-program os module-names))))
+  (let ((modules (filter-map (lambda (module)
+                               (if (kernel-module-load? module)
+                                   (kernel-module-name module)
+                                   #f))
+                      modules)))
+    (gexp->derivation "loadable-kernel-modules"
+                      (test (modules-loaded?-program os modules)))))
 
 (define %test-loadable-kernel-modules-0
   (system-test
    (name "loadable-kernel-modules-0")
    (description "Tests loadable kernel modules facility of <operating-system>
 with no extra modules.")
-   (value (run-loadable-kernel-modules-test '() '()))))
+   (value (run-loadable-kernel-modules-test '()))))
 
 (define %test-loadable-kernel-modules-1
   (system-test
@@ -113,8 +118,11 @@ with no extra modules.")
    (description "Tests loadable kernel modules facility of <operating-system>
 with one extra module.")
    (value (run-loadable-kernel-modules-test
-           (list ddcci-driver-linux)
-           '("ddcci")))))
+           (list (kernel-module
+                  (name "ddcci")
+                  (package ddcci-driver-linux)
+                  (options '("delay=606"))
+                  (load? #t)))))))
 
 (define %test-loadable-kernel-modules-2
   (system-test
@@ -122,12 +130,23 @@ with one extra module.")
    (description "Tests loadable kernel modules facility of <operating-system>
 with two extra modules.")
    (value (run-loadable-kernel-modules-test
-           (list acpi-call-linux-module
-                 (package
-                   (inherit ddcci-driver-linux)
-                   (arguments
-                    `(#:linux #f
-                      ,@(strip-keyword-arguments '(#:linux)
-                                                 (package-arguments
-                                                  ddcci-driver-linux))))))
-           '("acpi_call" "ddcci")))))
+           (list (kernel-module
+                  (name "ddcci")
+                  ;; XXX Verify that kernel modules are built with the correct
+                  ;; kernel
+                  (package (package
+                             (inherit ddcci-driver-linux)
+                             (arguments
+                              `(#:linux #f
+                                ,@(strip-keyword-arguments '(#:linux)
+                                                           (package-arguments
+                                                            ddcci-driver-linux))))))
+                  (load? #t))
+                 (kernel-module
+                  (name "acpi_call")
+                  (package acpi-call-linux-module)
+                  (load? #t))
+                 ;; TODO Test that a module isn't loaded
+                 (kernel-module
+                  (name "radeon")
+                  (blacklist? #t)))))))
-- 
2.26.2





Message sent to guix-patches@HIDDEN:


X-Loop: help-debbugs@HIDDEN
Subject: [bug#42193] [WIP 4/6] services: kernel-module-loader: Return a single 'shepherd-service'.
Resent-From: Danny Milosavljevic <dannym@HIDDEN>
Original-Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
Resent-CC: guix-patches@HIDDEN
Resent-Date: Mon, 06 Jul 2020 00:04:02 +0000
Resent-Message-ID: <handler.42193.B42193.15939938094895 <at> debbugs.gnu.org>
Resent-Sender: help-debbugs@HIDDEN
X-GNU-PR-Message: followup 42193
X-GNU-PR-Package: guix-patches
X-GNU-PR-Keywords: 
To: Brice Waegeneire <brice@HIDDEN>
Cc: 42193 <at> debbugs.gnu.org
Received: via spool by 42193-submit <at> debbugs.gnu.org id=B42193.15939938094895
          (code B ref 42193); Mon, 06 Jul 2020 00:04:02 +0000
Received: (at 42193) by debbugs.gnu.org; 6 Jul 2020 00:03:29 +0000
Received: from localhost ([127.0.0.1]:33134 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1jsEbY-0001Gt-TE
	for submit <at> debbugs.gnu.org; Sun, 05 Jul 2020 20:03:29 -0400
Received: from dd26836.kasserver.com ([85.13.145.193]:50126)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <dannym@HIDDEN>) id 1jsEbX-0001Gl-Gp
 for 42193 <at> debbugs.gnu.org; Sun, 05 Jul 2020 20:03:27 -0400
Received: from localhost (80-110-127-207.cgn.dynamic.surfer.at
 [80.110.127.207])
 by dd26836.kasserver.com (Postfix) with ESMTPSA id EE4093362B4A;
 Mon,  6 Jul 2020 02:03:25 +0200 (CEST)
Date: Mon, 6 Jul 2020 02:03:22 +0200
From: Danny Milosavljevic <dannym@HIDDEN>
Message-ID: <20200706020322.3577052e@HIDDEN>
In-Reply-To: <20200704185431.13739-5-brice@HIDDEN>
References: <20200704185234.12571-1-brice@HIDDEN>
 <20200704185431.13739-5-brice@HIDDEN>
X-Mailer: Claws Mail 3.17.5 (GTK+ 2.24.32; x86_64-unknown-linux-gnu)
MIME-Version: 1.0
Content-Type: multipart/signed; boundary="Sig_/NnP.NEHTrk6UkkxBI3wOkTG";
 protocol="application/pgp-signature"; micalg=pgp-sha512
X-Spam-Score: -0.7 (/)
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -1.7 (-)

--Sig_/NnP.NEHTrk6UkkxBI3wOkTG
Content-Type: text/plain; charset=US-ASCII
Content-Transfer-Encoding: quoted-printable

I mean technically we could do that, but almost none of the other
"-shepherd-service"s we have avoid returning a list.  Why single this one o=
ut?

Could we change all of them to not return a list?

--Sig_/NnP.NEHTrk6UkkxBI3wOkTG
Content-Type: application/pgp-signature
Content-Description: OpenPGP digital signature

-----BEGIN PGP SIGNATURE-----

iQEzBAEBCgAdFiEEds7GsXJ0tGXALbPZ5xo1VCwwuqUFAl8CakoACgkQ5xo1VCww
uqW+jwgAl9Ixjug+FpXcSp3poPCwoN+i82RM/twCpXmuqPLyvfe+sfJ61DJQg5nl
4gIFL5j2j17ZnTw/d1CGtwjEH9wXohgO1oOtJafD/0rSLUzXKNiOCRQz5bC5kfZU
Ze069EbPUNUA1P7DkPeOW3s6AQLspHP020ap1uR3krmDlHvLf8VrcbakTSfnefP0
xkUAXWFCwWSLZZXEHhoMtBJhJcaSRrU/77m3lA7VzzYk6KkeeVr3QinJLNaN1PW0
oLz/+jUyfgI36iQnXzs3tOB6blIQQXn9zE8wcE96y3DLFi1DGdejYpsKqFmSrXRZ
hTpfJLGFJrvR3YLNC0jH5iwTM+k6SA==
=Zltz
-----END PGP SIGNATURE-----

--Sig_/NnP.NEHTrk6UkkxBI3wOkTG--




Message sent to guix-patches@HIDDEN:


X-Loop: help-debbugs@HIDDEN
Subject: [bug#42193] [WIP 4/6] services: kernel-module-loader: Return a single 'shepherd-service'.
Resent-From: Brice Waegeneire <brice@HIDDEN>
Original-Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
Resent-CC: guix-patches@HIDDEN
Resent-Date: Mon, 06 Jul 2020 10:03:02 +0000
Resent-Message-ID: <handler.42193.B42193.159402973129690 <at> debbugs.gnu.org>
Resent-Sender: help-debbugs@HIDDEN
X-GNU-PR-Message: followup 42193
X-GNU-PR-Package: guix-patches
X-GNU-PR-Keywords: 
To: Danny Milosavljevic <dannym@HIDDEN>
Cc: 42193 <at> debbugs.gnu.org
Received: via spool by 42193-submit <at> debbugs.gnu.org id=B42193.159402973129690
          (code B ref 42193); Mon, 06 Jul 2020 10:03:02 +0000
Received: (at 42193) by debbugs.gnu.org; 6 Jul 2020 10:02:11 +0000
Received: from localhost ([127.0.0.1]:33646 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1jsNww-0007in-V1
	for submit <at> debbugs.gnu.org; Mon, 06 Jul 2020 06:02:11 -0400
Received: from relay3-d.mail.gandi.net ([217.70.183.195]:36703)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <brice@HIDDEN>) id 1jsNwt-0007iI-By
 for 42193 <at> debbugs.gnu.org; Mon, 06 Jul 2020 06:02:09 -0400
Received: from webmail.gandi.net (webmail19.sd4.0x35.net [10.200.201.19])
 (Authenticated sender: brice@HIDDEN)
 by relay3-d.mail.gandi.net (Postfix) with ESMTPA id 4473360015;
 Mon,  6 Jul 2020 10:01:59 +0000 (UTC)
MIME-Version: 1.0
Content-Type: text/plain; charset=US-ASCII;
 format=flowed
Content-Transfer-Encoding: 7bit
Date: Mon, 06 Jul 2020 10:01:59 +0000
From: Brice Waegeneire <brice@HIDDEN>
In-Reply-To: <20200706020322.3577052e@HIDDEN>
References: <20200704185234.12571-1-brice@HIDDEN>
 <20200704185431.13739-5-brice@HIDDEN>
 <20200706020322.3577052e@HIDDEN>
Message-ID: <fde539b184f76c2a8086f38fb77acb75@HIDDEN>
X-Sender: brice@HIDDEN
User-Agent: Roundcube Webmail/1.3.13
X-Spam-Score: -0.7 (/)
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -1.7 (-)

Hello Danny,

On 2020-07-06 00:03, Danny Milosavljevic wrote:
> I mean technically we could do that, but almost none of the other
> "-shepherd-service"s we have avoid returning a list.  Why single this 
> one out?

Because I wrote that module, forgetting to add a plural to
'kernel-module-loader-shepherd-service' and when reading the dnsmasq 
service code
I was made aware of it.  It's either that patch or a stupid typo one to 
go from
'kernel-module-loader-shepherd-service' to 
'kernel-module-loader-shepherd-serviceS'.

There are currently 14 other services that are using that pattern.

> Could we change all of them to not return a list?

Maybe, but I don't see the point of doing so as I expect that if the 
procedure's
name is plural and return a list there is no need to change it.

- Brice




Message sent to guix-patches@HIDDEN:


X-Loop: help-debbugs@HIDDEN
Subject: [bug#42193] [WIP 1/6] services: simulated-wifi: Use 'kernel-module-loader'.
Resent-From: Danny Milosavljevic <dannym@HIDDEN>
Original-Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
Resent-CC: guix-patches@HIDDEN
Resent-Date: Mon, 06 Jul 2020 11:09:02 +0000
Resent-Message-ID: <handler.42193.B42193.15940337223456 <at> debbugs.gnu.org>
Resent-Sender: help-debbugs@HIDDEN
X-GNU-PR-Message: followup 42193
X-GNU-PR-Package: guix-patches
X-GNU-PR-Keywords: 
To: Brice Waegeneire <brice@HIDDEN>
Cc: 42193 <at> debbugs.gnu.org
Received: via spool by 42193-submit <at> debbugs.gnu.org id=B42193.15940337223456
          (code B ref 42193); Mon, 06 Jul 2020 11:09:02 +0000
Received: (at 42193) by debbugs.gnu.org; 6 Jul 2020 11:08:42 +0000
Received: from localhost ([127.0.0.1]:33670 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1jsOzK-0000tg-M1
	for submit <at> debbugs.gnu.org; Mon, 06 Jul 2020 07:08:42 -0400
Received: from dd26836.kasserver.com ([85.13.145.193]:46090)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <dannym@HIDDEN>) id 1jsOzH-0000tW-IP
 for 42193 <at> debbugs.gnu.org; Mon, 06 Jul 2020 07:08:41 -0400
Received: from localhost (80-110-127-207.cgn.dynamic.surfer.at
 [80.110.127.207])
 by dd26836.kasserver.com (Postfix) with ESMTPSA id EF4BF33617B4;
 Mon,  6 Jul 2020 13:08:37 +0200 (CEST)
Date: Mon, 6 Jul 2020 13:08:35 +0200
From: Danny Milosavljevic <dannym@HIDDEN>
Message-ID: <20200706130835.1a69abf8@HIDDEN>
In-Reply-To: <20200704185431.13739-2-brice@HIDDEN>
References: <20200704185234.12571-1-brice@HIDDEN>
 <20200704185431.13739-2-brice@HIDDEN>
X-Mailer: Claws Mail 3.17.5 (GTK+ 2.24.32; x86_64-unknown-linux-gnu)
MIME-Version: 1.0
Content-Type: multipart/signed; boundary="Sig_/WaahCpz0=ixKijcUGqPPl=w";
 protocol="application/pgp-signature"; micalg=pgp-sha512
X-Spam-Score: -0.7 (/)
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -1.7 (-)

--Sig_/WaahCpz0=ixKijcUGqPPl=w
Content-Type: text/plain; charset=US-ASCII
Content-Transfer-Encoding: quoted-printable

Hi Brice,

this one LGTM and can go to master right away.

--Sig_/WaahCpz0=ixKijcUGqPPl=w
Content-Type: application/pgp-signature
Content-Description: OpenPGP digital signature

-----BEGIN PGP SIGNATURE-----

iQEzBAEBCgAdFiEEds7GsXJ0tGXALbPZ5xo1VCwwuqUFAl8DBjQACgkQ5xo1VCww
uqXVpAf+K6waXxErEQ0Vss3IyrBFGIIZrmJJqBd0bDuAHq4V3wCoMp78WhmL1ACK
tyUT8rdfGWvsSe8iLvUyiN9GGRPAJeBNRGx96ab5difuYc/Xr3v4PWgAhDTIAssV
QyezXzQ7S0fGscKSJoDvVd9umaJRMP5aSqDwj6XEq7SgID4rqk4NbEsbJPrg4Glt
YO/cTK/2CIa/FvT+0136Lpk7spHQIvnYrAFgYQ8NAf4pzNytvsPd3fZu8UNdj4ti
vPUVwqMB8uee9piGeAeE7+XAfr5F6y+jzuZV168UTuGYf4V+LlyXYOQ0ihJMkYBI
uRnL0+Uk8RkIVclCiVKvW7hBePuE3A==
=+O9/
-----END PGP SIGNATURE-----

--Sig_/WaahCpz0=ixKijcUGqPPl=w--




Message sent to guix-patches@HIDDEN:


X-Loop: help-debbugs@HIDDEN
Subject: [bug#42193] [WIP 1/6] services: simulated-wifi: Use 'kernel-module-loader'.
Resent-From: Brice Waegeneire <brice@HIDDEN>
Original-Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
Resent-CC: guix-patches@HIDDEN
Resent-Date: Mon, 06 Jul 2020 12:32:02 +0000
Resent-Message-ID: <handler.42193.B42193.159403870519293 <at> debbugs.gnu.org>
Resent-Sender: help-debbugs@HIDDEN
X-GNU-PR-Message: followup 42193
X-GNU-PR-Package: guix-patches
X-GNU-PR-Keywords: 
To: Danny Milosavljevic <dannym@HIDDEN>
Cc: 42193 <at> debbugs.gnu.org
Received: via spool by 42193-submit <at> debbugs.gnu.org id=B42193.159403870519293
          (code B ref 42193); Mon, 06 Jul 2020 12:32:02 +0000
Received: (at 42193) by debbugs.gnu.org; 6 Jul 2020 12:31:45 +0000
Received: from localhost ([127.0.0.1]:33734 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1jsQHg-000517-Qh
	for submit <at> debbugs.gnu.org; Mon, 06 Jul 2020 08:31:44 -0400
Received: from relay3-d.mail.gandi.net ([217.70.183.195]:55447)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <brice@HIDDEN>) id 1jsQHe-00050s-Be
 for 42193 <at> debbugs.gnu.org; Mon, 06 Jul 2020 08:31:43 -0400
Received: from webmail.gandi.net (webmail19.sd4.0x35.net [10.200.201.19])
 (Authenticated sender: brice@HIDDEN)
 by relay3-d.mail.gandi.net (Postfix) with ESMTPA id 9FFE660003;
 Mon,  6 Jul 2020 12:31:35 +0000 (UTC)
MIME-Version: 1.0
Content-Type: text/plain; charset=US-ASCII;
 format=flowed
Content-Transfer-Encoding: 7bit
Date: Mon, 06 Jul 2020 12:31:35 +0000
From: Brice Waegeneire <brice@HIDDEN>
In-Reply-To: <20200706130835.1a69abf8@HIDDEN>
References: <20200704185234.12571-1-brice@HIDDEN>
 <20200704185431.13739-2-brice@HIDDEN>
 <20200706130835.1a69abf8@HIDDEN>
Message-ID: <7b30af0c8e267a9c76fc7cbaf163836c@HIDDEN>
X-Sender: brice@HIDDEN
User-Agent: Roundcube Webmail/1.3.13
X-Spam-Score: -0.7 (/)
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -1.7 (-)

On 2020-07-06 11:08, Danny Milosavljevic wrote:
> Hi Brice,
> 
> this one LGTM and can go to master right away.

Pushed that commit as ef20acae83af8189df3225bdf59c5a0c1ae7da45 to 
master.




Message sent to guix-patches@HIDDEN:


X-Loop: help-debbugs@HIDDEN
Subject: [bug#42193] [WIP 2/6] services: Add 'kernel-profile-service-type'.
Resent-From: "pelzflorian (Florian Pelz)" <pelzflorian@HIDDEN>
Original-Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
Resent-CC: guix-patches@HIDDEN
Resent-Date: Wed, 08 Jul 2020 11:31:02 +0000
Resent-Message-ID: <handler.42193.B42193.159420780419318 <at> debbugs.gnu.org>
Resent-Sender: help-debbugs@HIDDEN
X-GNU-PR-Message: followup 42193
X-GNU-PR-Package: guix-patches
X-GNU-PR-Keywords: 
To: Brice Waegeneire <brice@HIDDEN>
Cc: 42193 <at> debbugs.gnu.org
Received: via spool by 42193-submit <at> debbugs.gnu.org id=B42193.159420780419318
          (code B ref 42193); Wed, 08 Jul 2020 11:31:02 +0000
Received: (at 42193) by debbugs.gnu.org; 8 Jul 2020 11:30:04 +0000
Received: from localhost ([127.0.0.1]:37569 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1jt8H5-000519-Ig
	for submit <at> debbugs.gnu.org; Wed, 08 Jul 2020 07:30:04 -0400
Received: from pelzflorian.de ([5.45.111.108]:58242 helo=mail.pelzflorian.de)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <pelzflorian@HIDDEN>) id 1jt8H1-0004yh-AB
 for 42193 <at> debbugs.gnu.org; Wed, 08 Jul 2020 07:30:02 -0400
Received: from pelzflorian.localdomain (unknown [5.45.111.108])
 by mail.pelzflorian.de (Postfix) with ESMTPSA id D2DAD36055C;
 Wed,  8 Jul 2020 13:29:57 +0200 (CEST)
DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=pelzflorian.de;
 s=mail; t=1594207797;
 bh=GBFDE6y29TS6YypBvSde9NOlbMZlEplsNEO4JCj4U7s=;
 h=Date:From:To:Cc:Subject:References:In-Reply-To;
 b=sqrTIfPipeqkPE8bHQdzn6b7OBUJjVgP9yan0UTLSzJMyn4oSj9/NQnVWTaepPHeD
 e7iyeX2HlBo/XjnOQTmugDmKSqlsXoUeqw+GODpBfYlvKOzNzANfMmgfIOV02kDPwy
 kvp8zRIki2H1HR4mXTh7L5YSj4rHdOFXSz4X01S0=
Date: Wed, 8 Jul 2020 13:29:47 +0200
From: "pelzflorian (Florian Pelz)" <pelzflorian@HIDDEN>
Message-ID: <20200708112947.i4iaayf45y5jxoti@HIDDEN>
References: <20200704185234.12571-1-brice@HIDDEN>
 <20200704185431.13739-3-brice@HIDDEN>
MIME-Version: 1.0
Content-Type: text/plain; charset=utf-8
Content-Disposition: inline
Content-Transfer-Encoding: 8bit
In-Reply-To: <20200704185431.13739-3-brice@HIDDEN>
X-Spam-Score: 0.5 (/)
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -0.5 (/)

Thank you for your work!

After I apply this kernel profile patch, I get an error:

florian@florianmacbook ~/git/guix [env]$ ./pre-inst-env guix system disk-image --file-system-type=iso9660        gnu/system/install.scm
substitute: Liste der Substitute von „https://ci.guix.gnu.org“ wird aktualisiert … 100.0%
The following derivations will be built:
   /gnu/store/l51h17zylvjmapvcpdmmqmvrylv8b2cb-iso9660-image.drv
   /gnu/store/mhdkqnh4iri5rk1ayqd3xlw04q86zj29-grub.cfg.drv
   /gnu/store/xvgn60irpzzdwvk30lqpsj2hh81h8jyh-system.drv
   /gnu/store/6y2r0ab5jcflbajd6843v9g1j0v9xrzj-gc-roots.drv
   /gnu/store/156m13243bcn2429swq8brp2qmfifi3b-system.drv
building /gnu/store/156m13243bcn2429swq8brp2qmfifi3b-system.drv...
|builder for `/gnu/store/156m13243bcn2429swq8brp2qmfifi3b-system.drv' failed with exit code 1
build of /gnu/store/156m13243bcn2429swq8brp2qmfifi3b-system.drv failed
View build log at '/var/log/guix/drvs/15/6m13243bcn2429swq8brp2qmfifi3b-system.drv.bz2'.
cannot build derivation `/gnu/store/6y2r0ab5jcflbajd6843v9g1j0v9xrzj-gc-roots.drv': 1 dependencies couldn't be built
cannot build derivation `/gnu/store/xvgn60irpzzdwvk30lqpsj2hh81h8jyh-system.drv': 1 dependencies couldn't be built
cannot build derivation `/gnu/store/l51h17zylvjmapvcpdmmqmvrylv8b2cb-iso9660-image.drv': 1 dependencies couldn't be built
guix system: error: build of `/gnu/store/l51h17zylvjmapvcpdmmqmvrylv8b2cb-iso9660-image.drv' failed
florian@florianmacbook ~/git/guix [env]$ bzcat /var/log/guix/drvs/15/6m13243bcn2429swq8brp2qmfifi3b-system.drv.bz2
Backtrace:
           1 (primitive-load "/gnu/store/59nx7bbflcqzavwsjj3wkq3lwfb?")
           0 (symlink "/gnu/store/86xgvarqwir47c16x6crx0jra5dgzr62-?" ?)

ERROR: In procedure symlink:
In procedure symlink: File exists


I have no idea where this comes from but I hope you can reproduce the error.

In general, I would be happy to use the kernel module configuration
service for replacing the uvesafb-service-type by something like

 (simple-service 'uvesafb-module
             kernel-module-configuration-service-type
             (list (kernel-module
                    (name "uvesafb")
                    (options
                     (list #~(string-append "v86d=" #$v86d "/sbin/v86d")
                           "mode_option=1024x768\n"))))))))

Even better would be if it were possible to detect the resolution to
use for uvesafb at runtime before the module is loaded.  Is it
possible to execute as root at runtime before modprobe a script like
testvbe.scm attached to the first message from
<https://issues.guix.gnu.org/40538#0> to compute the mode_option to
use?

Regards,
Florian




Message sent to guix-patches@HIDDEN:


X-Loop: help-debbugs@HIDDEN
Subject: [bug#42193] [WIP 2/6] services: Add 'kernel-profile-service-type'.
Resent-From: Brice Waegeneire <brice@HIDDEN>
Original-Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
Resent-CC: guix-patches@HIDDEN
Resent-Date: Wed, 08 Jul 2020 16:23:01 +0000
Resent-Message-ID: <handler.42193.B42193.159422533631061 <at> debbugs.gnu.org>
Resent-Sender: help-debbugs@HIDDEN
X-GNU-PR-Message: followup 42193
X-GNU-PR-Package: guix-patches
X-GNU-PR-Keywords: 
To: "pelzflorian (Florian Pelz)" <pelzflorian@HIDDEN>
Cc: 42193 <at> debbugs.gnu.org
Received: via spool by 42193-submit <at> debbugs.gnu.org id=B42193.159422533631061
          (code B ref 42193); Wed, 08 Jul 2020 16:23:01 +0000
Received: (at 42193) by debbugs.gnu.org; 8 Jul 2020 16:22:16 +0000
Received: from localhost ([127.0.0.1]:38969 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1jtCps-00084v-3Q
	for submit <at> debbugs.gnu.org; Wed, 08 Jul 2020 12:22:16 -0400
Received: from relay8-d.mail.gandi.net ([217.70.183.201]:43185)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <brice@HIDDEN>) id 1jtCpp-00084g-Mj
 for 42193 <at> debbugs.gnu.org; Wed, 08 Jul 2020 12:22:14 -0400
Received: from webmail.gandi.net (webmail19.sd4.0x35.net [10.200.201.19])
 (Authenticated sender: brice@HIDDEN)
 by relay8-d.mail.gandi.net (Postfix) with ESMTPA id 075B11BF20D;
 Wed,  8 Jul 2020 16:22:06 +0000 (UTC)
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8;
 format=flowed
Content-Transfer-Encoding: 8bit
Date: Wed, 08 Jul 2020 16:22:06 +0000
From: Brice Waegeneire <brice@HIDDEN>
In-Reply-To: <20200708112947.i4iaayf45y5jxoti@HIDDEN>
References: <20200704185234.12571-1-brice@HIDDEN>
 <20200704185431.13739-3-brice@HIDDEN>
 <20200708112947.i4iaayf45y5jxoti@HIDDEN>
Message-ID: <934d7c4429a5e64e12af5928ddf10b0d@HIDDEN>
X-Sender: brice@HIDDEN
User-Agent: Roundcube Webmail/1.3.13
X-Spam-Score: -0.2 (/)
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -1.2 (-)

On 2020-07-08 11:29, pelzflorian (Florian Pelz) wrote:
> Thank you for your work!

Note that it's not finished yet.

> After I apply this kernel profile patch, I get an error:
> 
> florian@florianmacbook ~/git/guix [env]$ ./pre-inst-env guix system
> disk-image --file-system-type=iso9660        gnu/system/install.scm
> substitute: Liste der Substitute von „https://ci.guix.gnu.org“ wird
> aktualisiert … 100.0%
> The following derivations will be built:
>    /gnu/store/l51h17zylvjmapvcpdmmqmvrylv8b2cb-iso9660-image.drv
>    /gnu/store/mhdkqnh4iri5rk1ayqd3xlw04q86zj29-grub.cfg.drv
>    /gnu/store/xvgn60irpzzdwvk30lqpsj2hh81h8jyh-system.drv
>    /gnu/store/6y2r0ab5jcflbajd6843v9g1j0v9xrzj-gc-roots.drv
>    /gnu/store/156m13243bcn2429swq8brp2qmfifi3b-system.drv
> building /gnu/store/156m13243bcn2429swq8brp2qmfifi3b-system.drv...
> |builder for `/gnu/store/156m13243bcn2429swq8brp2qmfifi3b-system.drv'
> failed with exit code 1
> build of /gnu/store/156m13243bcn2429swq8brp2qmfifi3b-system.drv failed
> View build log at
> '/var/log/guix/drvs/15/6m13243bcn2429swq8brp2qmfifi3b-system.drv.bz2'.
> cannot build derivation
> `/gnu/store/6y2r0ab5jcflbajd6843v9g1j0v9xrzj-gc-roots.drv': 1
> dependencies couldn't be built
> cannot build derivation
> `/gnu/store/xvgn60irpzzdwvk30lqpsj2hh81h8jyh-system.drv': 1
> dependencies couldn't be built
> cannot build derivation
> `/gnu/store/l51h17zylvjmapvcpdmmqmvrylv8b2cb-iso9660-image.drv': 1
> dependencies couldn't be built
> guix system: error: build of
> `/gnu/store/l51h17zylvjmapvcpdmmqmvrylv8b2cb-iso9660-image.drv' failed
> florian@florianmacbook ~/git/guix [env]$ bzcat
> /var/log/guix/drvs/15/6m13243bcn2429swq8brp2qmfifi3b-system.drv.bz2
> Backtrace:
>            1 (primitive-load "/gnu/store/59nx7bbflcqzavwsjj3wkq3lwfb?")
>            0 (symlink "/gnu/store/86xgvarqwir47c16x6crx0jra5dgzr62-?" 
> ?)
> 
> ERROR: In procedure symlink:
> In procedure symlink: File exists
> 
> 
> I have no idea where this comes from but I hope you can reproduce the 
> error.

Unfortunately I can't, it build successfully for me when applied on top 
of
6f3ede9ae2b2268181ebc0ca3764d865bd06bd63.  You probably just need to 
clean
your Guix repository and rebuild it from scratch

> In general, I would be happy to use the kernel module configuration
> service for replacing the uvesafb-service-type by something like
> 
>  (simple-service 'uvesafb-module
>              kernel-module-configuration-service-type
>              (list (kernel-module
>                     (name "uvesafb")
>                     (options
>                      (list #~(string-append "v86d=" #$v86d 
> "/sbin/v86d")
>                            "mode_option=1024x768\n"))))))))

I think it should work without gexp/ungexp and the "\n".

> Even better would be if it were possible to detect the resolution to
> use for uvesafb at runtime before the module is loaded.  Is it
> possible to execute as root at runtime before modprobe a script like
> testvbe.scm attached to the first message from
> <https://issues.guix.gnu.org/40538#0> to compute the mode_option to
> use?

AFAIU it's not possible because service extensions are generated at 
build time,
not run time so you can't extend KMCS with a value generated when your 
service
is executed. It is a limitation of the service extension paradigm.

A kind of dirty way to achieve what you want would be for KMCS' options 
field
to accept an arbitrary configuration path that will be symlinked to, 
like
“(options "/var/run/uvesafb/uvesafb.conf")”. That way from uvesafb 
service
you generate that modprobe configuration file at run time (before KMCS) 
and
so when KMCS run modprobe it's direcotry configuration contains a 
symlink
named "uvesafb.conf" which point to "/var/run/uvesafb/uvesafb.conf". But
it doesn't seems Guixy to me.

- Brice




Message sent to guix-patches@HIDDEN:


X-Loop: help-debbugs@HIDDEN
Subject: [bug#42193] [WIP 2/6] services: Add 'kernel-profile-service-type'.
Resent-From: "pelzflorian (Florian Pelz)" <pelzflorian@HIDDEN>
Original-Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
Resent-CC: guix-patches@HIDDEN
Resent-Date: Sat, 11 Jul 2020 17:31:02 +0000
Resent-Message-ID: <handler.42193.B42193.159448862616469 <at> debbugs.gnu.org>
Resent-Sender: help-debbugs@HIDDEN
X-GNU-PR-Message: followup 42193
X-GNU-PR-Package: guix-patches
X-GNU-PR-Keywords: 
To: Brice Waegeneire <brice@HIDDEN>
Cc: 42193 <at> debbugs.gnu.org
Received: via spool by 42193-submit <at> debbugs.gnu.org id=B42193.159448862616469
          (code B ref 42193); Sat, 11 Jul 2020 17:31:02 +0000
Received: (at 42193) by debbugs.gnu.org; 11 Jul 2020 17:30:26 +0000
Received: from localhost ([127.0.0.1]:44889 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1juJKU-0004HC-4U
	for submit <at> debbugs.gnu.org; Sat, 11 Jul 2020 13:30:26 -0400
Received: from pelzflorian.de ([5.45.111.108]:39800 helo=mail.pelzflorian.de)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <pelzflorian@HIDDEN>) id 1juJKN-000492-Vj
 for 42193 <at> debbugs.gnu.org; Sat, 11 Jul 2020 13:30:24 -0400
Received: from pelzflorian.localdomain (unknown [5.45.111.108])
 by mail.pelzflorian.de (Postfix) with ESMTPSA id E8FDD3602A4;
 Sat, 11 Jul 2020 19:30:17 +0200 (CEST)
DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=pelzflorian.de;
 s=mail; t=1594488618;
 bh=6XgjKi+XJfZ/iQDeeH3J8UCVLnwx98H29teo+5yTOwg=;
 h=Date:From:To:Cc:Subject:References:In-Reply-To;
 b=WtnAF7K2NQoXF73rqDBFlqSNwS07Fua64QHU5daeitucD8LzotJf1YXORaSVowrr0
 ilG5etHCR+rK5VTKunLcszhX/c3ZwYPouuXNAJ1YdaYw3t4dhJjSvCCyeUtdnAWRMz
 4pd10BQaq2+4GhiCWLZKusQtI9ZnCnlmKoxDuJys=
Date: Sat, 11 Jul 2020 19:30:08 +0200
From: "pelzflorian (Florian Pelz)" <pelzflorian@HIDDEN>
Message-ID: <20200711173008.3zgtlagkypbc4bw6@HIDDEN>
References: <20200704185234.12571-1-brice@HIDDEN>
 <20200704185431.13739-3-brice@HIDDEN>
 <20200708112947.i4iaayf45y5jxoti@HIDDEN>
 <934d7c4429a5e64e12af5928ddf10b0d@HIDDEN>
MIME-Version: 1.0
Content-Type: text/plain; charset=utf-8
Content-Disposition: inline
Content-Transfer-Encoding: quoted-printable
In-Reply-To: <934d7c4429a5e64e12af5928ddf10b0d@HIDDEN>
X-Spam-Score: 0.0 (/)
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -1.0 (-)

On Wed, Jul 08, 2020 at 04:22:06PM +0000, Brice Waegeneire wrote:
> > After I apply this kernel profile patch, I get an error:
> >=20
> > florian@florianmacbook ~/git/guix [env]$ ./pre-inst-env guix system
> > disk-image --file-system-type=3Diso9660        gnu/system/install.scm
> > [=E2=80=A6]
> > failed with exit code 1
> > [=E2=80=A6]
> > In procedure symlink: File exists
> >=20
> >=20
> > I have no idea where this comes from but I hope you can reproduce the
> > error.
>=20
> Unfortunately I can't, it build successfully for me when applied on top of
> 6f3ede9ae2b2268181ebc0ca3764d865bd06bd63.  You probably just need to clean
> your Guix repository and rebuild it from scratch

I still have the error after pulling current guix (commit f2dce740b2)
and applying your patch.

florian@florianmacbook ~/.config/guix/current/share/guile/site/3.0$ guix sy=
stem disk-image --file-system-type=3Diso9660 gnu/system/install.scm
[=E2=80=A6]
build of /gnu/store/v9jzdiykyz1rdb1an7jpsfhnnkvx21mq-system.drv failed
View build log at '/var/log/guix/drvs/v9/jzdiykyz1rdb1an7jpsfhnnkvx21mq-sys=
tem.drv.bz2'.

Indeed /gnu/store/v9jzdiykyz1rdb1an7jpsfhnnkvx21mq-system.drv contains

Derive([("out","/gnu/store/xzavg5awkmbcx556f3a0h329w5ninhyk-system","","")]=
,[("/gnu/store/28zlas3x4ry6q88fgq625ixh40igjws5-guile-3.0.2.drv",["out"]),(=
"/gnu/store/32yj3cnz8rjipd6lw27d08rb272rcmbp-boot.drv",["out"]),("/gnu/stor=
e/6iwq8qmqpf9sy84jvbbsd6lwwb05rvlf-etc.drv",["out"]),("/gnu/store/8rfp2v0vz=
8w72621qsr0mr21zgr5f062-profile.drv",["out"]),("/gnu/store/92sqsa639hl3ixy6=
ryys38xha7mgkyb0-profile.drv",["out"]),("/gnu/store/ca0g4jfdqx4fhsp67jr2ra1=
7sdwajczc-parameters.drv",["out"]),("/gnu/store/fi6hy331yp7pn03zhlxavdd4d9k=
v6l6i-raw-initrd.drv",["out"]),("/gnu/store/i3fx8c0k6yna92cf9h7r57amdjzii7l=
3-locale-multiple-versions.drv",["out"]),("/gnu/store/zcz3jhx84q3zmz37wddwl=
fk2w3rnn5fc-module-import-compiled.drv",["out"])],["/gnu/store/ah60schb9jlz=
x12jzi6v872q3j099afi-system-builder","/gnu/store/xv5ylv9hxvs1wraw375b5g9jwy=
57vs8p-module-import"],"x86_64-linux","/gnu/store/0m0vd873jp61lcm4xa3ljdgx3=
81qa782-guile-3.0.2/bin/guile",["--no-auto-compile","-L","/gnu/store/xv5ylv=
9hxvs1wraw375b5g9jwy57vs8p-module-import","-C","/gnu/store/08da6i38fzn9g36g=
yq443k03f84nk8rk-module-import-compiled","/gnu/store/ah60schb9jlzx12jzi6v87=
2q3j099afi-system-builder"],[("out","/gnu/store/xzavg5awkmbcx556f3a0h329w5n=
inhyk-system"),("preferLocalBuild","1")])

and /gnu/store/ah60schb9jlzx12jzi6v872q3j099afi-system-builder
contains (with indentation added by me):

(begin (use-modules (guix build utils))
       (mkdir ((@ (guile) getenv) "out"))
       (chdir ((@ (guile) getenv) "out"))
       (begin (stat "/gnu/store/x22lj7pv64cg58dlwsg1q1srqawjbahi-profile")
              (mkdir-p (dirname "kernel"))
              (symlink "/gnu/store/x22lj7pv64cg58dlwsg1q1srqawjbahi-profile=
" "kernel"))
       (begin (stat "/gnu/store/7wjapypmzz4n93rwrnrrqwalwg8hhh3h-parameters=
")
              (mkdir-p (dirname "parameters"))
              (symlink "/gnu/store/7wjapypmzz4n93rwrnrrqwalwg8hhh3h-paramet=
ers" "parameters"))
       (begin (stat "/gnu/store/j27l3k8zjg9gn9j04y90gsjrqsryjapw-raw-initrd=
/initrd.cpio.gz")
              (mkdir-p (dirname "initrd"))
              (symlink "/gnu/store/j27l3k8zjg9gn9j04y90gsjrqsryjapw-raw-ini=
trd/initrd.cpio.gz" "initrd"))
       (begin (stat "/gnu/store/bhnyk7bpzlzna28njkx21dd3940m1m4a-locale-mul=
tiple-versions")
              (mkdir-p (dirname "locale"))
              (symlink "/gnu/store/bhnyk7bpzlzna28njkx21dd3940m1m4a-locale-=
multiple-versions" "locale"))
       (begin (stat "/gnu/store/24irabcnv3pn2mpx4cjrggmlvn30k053-profile")
              (mkdir-p (dirname "profile"))
              (symlink "/gnu/store/24irabcnv3pn2mpx4cjrggmlvn30k053-profile=
" "profile"))
       (begin (stat "/gnu/store/z9jm8d8rrrpq19y1pmahpp73ja5ydw6h-etc")
              (mkdir-p (dirname "etc"))
              (symlink "/gnu/store/z9jm8d8rrrpq19y1pmahpp73ja5ydw6h-etc" "e=
tc"))
       (begin (stat "/gnu/store/w90vvv7mx8g17i6frd34yvmbfi0nhnl1-boot")
              (mkdir-p (dirname "boot"))
              (symlink "/gnu/store/w90vvv7mx8g17i6frd34yvmbfi0nhnl1-boot" "=
boot"))
       (begin (stat "/gnu/store/x22lj7pv64cg58dlwsg1q1srqawjbahi-profile")
              (mkdir-p (dirname "kernel"))
              (symlink "/gnu/store/x22lj7pv64cg58dlwsg1q1srqawjbahi-profile=
" "kernel")))


Without your patch I get a
/gnu/store/c74g6pazpx9z5c1jkfi4rn8h42lf36dy-system-builder with only
one "kernel":

(begin (use-modules (guix build utils))
       (mkdir ((@ (guile) getenv) "out"))
       (chdir ((@ (guile) getenv) "out"))
       (begin (stat "/gnu/store/x22lj7pv64cg58dlwsg1q1srqawjbahi-profile")
              (mkdir-p (dirname "kernel"))
              (symlink "/gnu/store/x22lj7pv64cg58dlwsg1q1srqawjbahi-profile=
" "kernel"))
       (begin (stat "/gnu/store/7wjapypmzz4n93rwrnrrqwalwg8hhh3h-parameters=
")
              (mkdir-p (dirname "parameters"))
              (symlink "/gnu/store/7wjapypmzz4n93rwrnrrqwalwg8hhh3h-paramet=
ers" "parameters"))
       (begin (stat "/gnu/store/j27l3k8zjg9gn9j04y90gsjrqsryjapw-raw-initrd=
/initrd.cpio.gz")
              (mkdir-p (dirname "initrd"))
              (symlink "/gnu/store/j27l3k8zjg9gn9j04y90gsjrqsryjapw-raw-ini=
trd/initrd.cpio.gz" "initrd"))
       (begin (stat "/gnu/store/bhnyk7bpzlzna28njkx21dd3940m1m4a-locale-mul=
tiple-versions")
              (mkdir-p (dirname "locale"))
              (symlink "/gnu/store/bhnyk7bpzlzna28njkx21dd3940m1m4a-locale-=
multiple-versions" "locale"))
       (begin (stat "/gnu/store/24irabcnv3pn2mpx4cjrggmlvn30k053-profile")
              (mkdir-p (dirname "profile"))
              (symlink "/gnu/store/24irabcnv3pn2mpx4cjrggmlvn30k053-profile=
" "profile"))
       (begin (stat "/gnu/store/z9jm8d8rrrpq19y1pmahpp73ja5ydw6h-etc")
              (mkdir-p (dirname "etc"))
              (symlink "/gnu/store/z9jm8d8rrrpq19y1pmahpp73ja5ydw6h-etc" "e=
tc"))
       (begin (stat "/gnu/store/w90vvv7mx8g17i6frd34yvmbfi0nhnl1-boot")
              (mkdir-p (dirname "boot"))
              (symlink "/gnu/store/w90vvv7mx8g17i6frd34yvmbfi0nhnl1-boot" "=
boot")))

The diff is only the three lines at the bottom

(begin (stat "/gnu/store/x22lj7pv64cg58dlwsg1q1srqawjbahi-profile")
       (mkdir-p (dirname "kernel"))
       (symlink "/gnu/store/x22lj7pv64cg58dlwsg1q1srqawjbahi-profile" "kern=
el")))

Regards,
Florian





Last modified: Sat, 11 Jul 2020 17:30:01 UTC

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