GNU logs - #55231, boring messages


Message sent to guix-patches@HIDDEN:


X-Loop: help-debbugs@HIDDEN
Subject: [bug#55231] [PATCH v1] initrd: Allow extra search paths with =?UTF-8?Q?=E2=80=98initrd-extra-module-paths=E2=80=99?=
Resent-From: Brian Cully <bjc@HIDDEN>
Original-Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
Resent-CC: guix-patches@HIDDEN
Resent-Date: Mon, 02 May 2022 19:55:02 +0000
Resent-Message-ID: <handler.55231.B.165152125227834 <at> debbugs.gnu.org>
Resent-Sender: help-debbugs@HIDDEN
X-GNU-PR-Message: report 55231
X-GNU-PR-Package: guix-patches
X-GNU-PR-Keywords: patch
To: 55231 <at> debbugs.gnu.org
X-Debbugs-Original-To: guix-patches@HIDDEN
Received: via spool by submit <at> debbugs.gnu.org id=B.165152125227834
          (code B ref -1); Mon, 02 May 2022 19:55:02 +0000
Received: (at submit) by debbugs.gnu.org; 2 May 2022 19:54:12 +0000
Received: from localhost ([127.0.0.1]:38041 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1nlc7W-0007Eo-QW
	for submit <at> debbugs.gnu.org; Mon, 02 May 2022 15:54:11 -0400
Received: from lists.gnu.org ([209.51.188.17]:53716)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <bjc@HIDDEN>) id 1nlc7V-0007EY-Hr
 for submit <at> debbugs.gnu.org; Mon, 02 May 2022 15:54:10 -0400
Received: from eggs.gnu.org ([2001:470:142:3::10]:51000)
 by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.90_1) (envelope-from <bjc@HIDDEN>) id 1nlc7V-0003im-7Q
 for guix-patches@HIDDEN; Mon, 02 May 2022 15:54:09 -0400
Received: from coleridge.kublai.com ([166.84.7.167]:53283 helo=mail.spork.org)
 by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.90_1) (envelope-from <bjc@HIDDEN>) id 1nlc7T-0004gU-3g
 for guix-patches@HIDDEN; Mon, 02 May 2022 15:54:08 -0400
Received: from ditto (unknown [IPv6:2001:470:1f07:1b9:8650:a942:ec5e:856b])
 by mail.spork.org (Postfix) with ESMTPSA id AAD7D5717
 for <guix-patches@HIDDEN>; Mon,  2 May 2022 15:53:15 -0400 (EDT)
DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=spork.org; s=dkim;
 t=1651521195; bh=u+B+QyVD+9RTOMbyzoXzK6TU4GFt79n3l1oU6PKQJI4=;
 h=From:To:Subject:Date;
 b=iAiqhE7p1+86cqE/QfFtAmUv/a0C43yTldM18CZz6yFy6+QnFTKlhlySCpUdMcPh3
 AqKxzxQWZnl/b02PFZY7Q39Hg6tVgzgFJjXf1RXB9QOOqAEa/UtK+LYmJloxdK/OGY
 xr64CNKYwjX22yoXj6ArB5EaJJJvnRHc3gb96uWo=
User-agent: mu4e 1.6.10; emacs 28.1
From: Brian Cully <bjc@HIDDEN>
Date: Mon, 2 May 2022 15:11:30 -0400
Message-ID: <87wnf3pv87.fsf@HIDDEN>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8; charset=utf-8
Content-Transfer-Encoding: quoted-printable
Received-SPF: pass client-ip=166.84.7.167; envelope-from=bjc@HIDDEN;
 helo=mail.spork.org
X-Spam_score_int: -20
X-Spam_score: -2.1
X-Spam_bar: --
X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1,
 DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, SPF_HELO_NONE=0.001,
 SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no
X-Spam_action: no action
X-Spam-Score: -1.3 (-)
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.3 (--)

This patch allows copying of out-of-tree kernel modules to the Linux
initrd.

For out-of-tree modules to found, an extra slot has been added to
=E2=80=98operating-system=E2=80=99: =E2=80=98initrd-extra-module-paths=E2=
=80=99, which contains a list
containing items of either FILE-LIKE or (FILE-LIKE OUTPUT) which will be
searched for modules in addition to the standard Linux module path. The
required modules can then be added to =E2=80=98initrd-modules=E2=80=99 as n=
ormal and all paths
will be searched for it, including for any modules depended on.

* gnu/build/linux-modules.scm (find-module-file): change DIRECTORY argument=
 to
DIRECTORIES. Now takes a list of directories to search, rather than a single
one.
* gnu/system.scm <operating-system>: Add INITRD-EXTRA-MODULE-PATHS
field and accessor. Takes a list of file-like objects.
* gnu/system/linux-initrd.scm (flat-linux-module-directory): change LINUX
argument to PACKAGES. Now contains a list of file-likes to search for modul=
es.
(raw-initrd): Add LINUX-EXTRA-MODULE-PATHS keyword argument. Pass it
to (flat-linux-extra-module-paths) along with the selected LINUX package.
(base-initrd): Add LINUX-EXTRA-MODULE-PATHS keyword argument. Pass it
to (raw-initrd).
---
 gnu/build/linux-modules.scm | 19 ++++++++------
 gnu/system.scm              |  5 ++++
 gnu/system/linux-initrd.scm | 52 +++++++++++++++++++++++++------------
 3 files changed, 51 insertions(+), 25 deletions(-)

diff --git a/gnu/build/linux-modules.scm b/gnu/build/linux-modules.scm
index 053720574b..97b7e429ea 100644
--- a/gnu/build/linux-modules.scm
+++ b/gnu/build/linux-modules.scm
@@ -225,8 +225,8 @@ (define (file-name->module-name file)
 '.ko[.gz|.xz]' and normalizing it."
   (normalize-module-name (strip-extension (basename file))))
=20
-(define (find-module-file directory module)
-  "Lookup module NAME under DIRECTORY, and return its absolute file name.
+(define (find-module-file directories module)
+  "Lookup module NAME under DIRECTORIES, and return its absolute file name.
 NAME can be a file name with or without '.ko', or it can be a module name.
 Raise an error if it could not be found.
=20
@@ -247,16 +247,19 @@ (define names
                            (else chr)))
                        module))))
=20
-  (match (find-files directory
-                     (lambda (file stat)
-                       (member (strip-extension
-                                (basename file)) names)))
+  (match (append-map (lambda (directory)
+                       (find-files directory
+                                   (lambda (file _stat)
+                                     (member (strip-extension
+                                              (basename file))
+                                             names))))
+                       directories)
     ((file)
      file)
     (()
-     (error "kernel module not found" module directory))
+     (error "kernel module not found" module directories))
     ((_ ...)
-     (error "several modules by that name" module directory))))
+     (error "several modules by that name" module directories))))
=20
 (define* (recursive-module-dependencies files
                                         #:key (lookup-module dot-ko))
diff --git a/gnu/system.scm b/gnu/system.scm
index c3810cbeeb..15ac30c933 100644
--- a/gnu/system.scm
+++ b/gnu/system.scm
@@ -103,6 +103,7 @@ (define-module (gnu system)
             operating-system-label
             operating-system-default-label
             operating-system-initrd-modules
+            operating-system-initrd-extra-module-paths
             operating-system-initrd
             operating-system-users
             operating-system-groups
@@ -232,6 +233,8 @@ (define-record-type* <operating-system> operating-system
   (initrd-modules operating-system-initrd-modules ; list of strings
                   (thunked)                       ; it's system-dependent
                   (default %base-initrd-modules))
+  (initrd-extra-module-paths operating-system-initrd-extra-module-paths ; =
list of file-likes
+                             (default '()))
=20
   (firmware operating-system-firmware             ; list of packages
             (default %base-firmware))
@@ -1307,6 +1310,8 @@ (define make-initrd
                #:linux (operating-system-kernel os)
                #:linux-modules
                (operating-system-initrd-modules os)
+               #:linux-extra-module-paths
+               (operating-system-initrd-extra-module-paths os)
                #:mapped-devices mapped-devices
                #:keyboard-layout (operating-system-keyboard-layout os)))
=20
diff --git a/gnu/system/linux-initrd.scm b/gnu/system/linux-initrd.scm
index 4c4c78e444..50a182d7d5 100644
--- a/gnu/system/linux-initrd.scm
+++ b/gnu/system/linux-initrd.scm
@@ -119,13 +119,23 @@ (define builder
                               `(#:references-graphs (("closure" ,init))))
                "/initrd.cpio.gz"))
=20
-(define (flat-linux-module-directory linux modules)
+(define (flat-linux-module-directory packages modules)
   "Return a flat directory containing the Linux kernel modules listed in
-MODULES and taken from LINUX."
+MODULES and taken from PACKAGES."
   (define imported-modules
     (source-module-closure '((gnu build linux-modules)
                              (guix build utils))))
=20
+  (define (package+out->input package out)
+    (gexp-input package out))
+
+  (define package-inputs
+    (map (lambda (p)
+           (match p
+             ((p o) (package+out->input p o))
+             (p     (package+out->input p "out"))))
+         packages))
+
   (define build-exp
     (with-imported-modules imported-modules
       (with-extensions (list guile-zlib)
@@ -135,11 +145,12 @@ (define build-exp
                          (srfi srfi-1)
                          (srfi srfi-26))
=20
-            (define module-dir
-              (string-append #$linux "/lib/modules"))
+            (define module-dirs
+              (map (cut string-append <> "/lib/modules")
+                   '#$package-inputs))
=20
             (define modules
-              (let* ((lookup  (cut find-module-file module-dir <>))
+              (let* ((lookup  (cut find-module-file module-dirs <>))
                      (modules (map lookup '#$modules)))
                 (append modules
                         (recursive-module-dependencies
@@ -172,20 +183,23 @@ (define* (raw-initrd file-systems
                       #:key
                       (linux linux-libre)
                       (linux-modules '())
+                      (linux-extra-module-paths '())
                       (mapped-devices '())
                       (keyboard-layout #f)
                       (helper-packages '())
                       qemu-networking?
                       volatile-root?
                       (on-error 'debug))
-  "Return as a file-like object a raw initrd, with kernel
-modules taken from LINUX.  FILE-SYSTEMS is a list of file-systems to be
-mounted by the initrd, possibly in addition to the root file system specif=
ied
-on the kernel command line via 'root'.  LINUX-MODULES is a list of kernel
-modules to be loaded at boot time. MAPPED-DEVICES is a list of device
-mappings to realize before FILE-SYSTEMS are mounted.
-HELPER-PACKAGES is a list of packages to be copied in the initrd. It may i=
nclude
-e2fsck/static or other packages needed by the initrd to check root partiti=
on.
+  "Return as a file-like object a raw initrd, with kernel modules taken fr=
om
+LINUX.  FILE-SYSTEMS is a list of file-systems to be mounted by the initrd,
+possibly in addition to the root file system specified on the kernel comma=
nd
+line via 'root'.  LINUX-MODULES is a list of kernel modules to be loaded at
+boot time. LINUX-EXTRA-MODULE-PATHS is a list of file-like objects which w=
ill
+be searched for modules in addition to the linux kernel. MAPPED-DEVICES is=
 a
+list of device mappings to realize before FILE-SYSTEMS are mounted.
+HELPER-PACKAGES is a list of packages to be copied in the initrd. It may
+include e2fsck/static or other packages needed by the initrd to check root
+partition.
=20
 When true, KEYBOARD-LAYOUT is a <keyboard-layout> record denoting the desi=
red
 console keyboard layout.  This is done before MAPPED-DEVICES are set up and
@@ -221,7 +235,8 @@ (define file-system-scan-commands
           #~())))
=20
   (define kodir
-    (flat-linux-module-directory linux linux-modules))
+    (flat-linux-module-directory (cons linux linux-extra-module-paths)
+                                 linux-modules))
=20
   (expression->initrd
    (with-imported-modules (source-module-closure
@@ -366,6 +381,7 @@ (define* (base-initrd file-systems
                       #:key
                       (linux linux-libre)
                       (linux-modules '())
+                      (linux-extra-module-paths '())
                       (mapped-devices '())
                       (keyboard-layout #f)
                       qemu-networking?
@@ -386,9 +402,10 @@ (define* (base-initrd file-systems
 QEMU-NETWORKING? and VOLATILE-ROOT? behaves as in raw-initrd.
=20
 The initrd is automatically populated with all the kernel modules necessary
-for FILE-SYSTEMS and for the given options.  Additional kernel
-modules can be listed in LINUX-MODULES.  They will be added to the initrd,=
 and
-loaded at boot time in the order in which they appear."
+for FILE-SYSTEMS and for the given options.  Additional kernel modules can=
 be
+listed in LINUX-MODULES.  Additional search paths for modules can be liste=
d in
+LINUX-EXTRA-MODULE-PATHS.  They will be added to the initrd, and loaded at
+boot time in the order in which they appear."
   (define linux-modules*
     ;; Modules added to the initrd and loaded from the initrd.
     `(,@linux-modules
@@ -408,6 +425,7 @@ (define helper-packages
   (raw-initrd file-systems
               #:linux linux
               #:linux-modules linux-modules*
+              #:linux-extra-module-paths linux-extra-module-paths
               #:mapped-devices mapped-devices
               #:helper-packages helper-packages
               #:keyboard-layout keyboard-layout

base-commit: 0a64b629ae8512790d532158a72a4a25698e8157
prerequisite-patch-id: 213ce2b9743f11d45836fe0794f117f3bb84063d
--=20
2.35.1




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: Brian Cully <bjc@HIDDEN>
Subject: bug#55231: Acknowledgement ([PATCH v1] initrd: Allow extra search
 paths with =?UTF-8?Q?=E2=80=98initrd-extra-module-paths=E2=80=99?=)
Message-ID: <handler.55231.B.165152125227834.ack <at> debbugs.gnu.org>
References: <87wnf3pv87.fsf@HIDDEN>
X-Gnu-PR-Message: ack 55231
X-Gnu-PR-Package: guix-patches
X-Gnu-PR-Keywords: patch
Reply-To: 55231 <at> debbugs.gnu.org
Date: Mon, 02 May 2022 19:55: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 55231 <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
55231: https://debbugs.gnu.org/cgi/bugreport.cgi?bug=3D55231
GNU Bug Tracking System
Contact help-debbugs@HIDDEN with problems


Message sent to guix-patches@HIDDEN:


X-Loop: help-debbugs@HIDDEN
Subject: [bug#55231] [PATCH v1] initrd: Allow extra search paths with =?UTF-8?Q?=E2=80=98initrd-extra-module-paths=E2=80=99?=
Resent-From: Maxime Devos <maximedevos@HIDDEN>
Original-Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
Resent-CC: guix-patches@HIDDEN
Resent-Date: Mon, 02 May 2022 22:04:02 +0000
Resent-Message-ID: <handler.55231.B55231.16515290375155 <at> debbugs.gnu.org>
Resent-Sender: help-debbugs@HIDDEN
X-GNU-PR-Message: followup 55231
X-GNU-PR-Package: guix-patches
X-GNU-PR-Keywords: patch
To: Brian Cully <bjc@HIDDEN>, 55231 <at> debbugs.gnu.org
Received: via spool by 55231-submit <at> debbugs.gnu.org id=B55231.16515290375155
          (code B ref 55231); Mon, 02 May 2022 22:04:02 +0000
Received: (at 55231) by debbugs.gnu.org; 2 May 2022 22:03:57 +0000
Received: from localhost ([127.0.0.1]:38240 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1nle97-0001L5-Jq
	for submit <at> debbugs.gnu.org; Mon, 02 May 2022 18:03:57 -0400
Received: from laurent.telenet-ops.be ([195.130.137.89]:50054)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <maximedevos@HIDDEN>) id 1nle95-0001Kv-5C
 for 55231 <at> debbugs.gnu.org; Mon, 02 May 2022 18:03:56 -0400
Received: from ptr-bvsjgyhxw7psv60dyze.18120a2.ip6.access.telenet.be
 ([IPv6:2a02:1811:8c09:9d00:3c5f:2eff:feb0:ba5a])
 by laurent.telenet-ops.be with bizsmtp
 id Ry3t270024UW6Th01y3tna; Tue, 03 May 2022 00:03:53 +0200
Message-ID: <c87a1c647289c0f0fb60773e2fd50916861b4d8b.camel@HIDDEN>
From: Maxime Devos <maximedevos@HIDDEN>
Date: Tue, 03 May 2022 00:03:42 +0200
In-Reply-To: <87wnf3pv87.fsf@HIDDEN>
References: <87wnf3pv87.fsf@HIDDEN>
Content-Type: multipart/signed; micalg="pgp-sha512";
 protocol="application/pgp-signature"; boundary="=-5cTRqjaDdOITOGA8BtZm"
User-Agent: Evolution 3.38.3-1 
MIME-Version: 1.0
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=telenet.be; s=r22;
 t=1651529033; bh=XZzrAxdED9UE0kZqDG7/zrZguBSgAhh08TfHgfjeJ18=;
 h=Subject:From:To:Date:In-Reply-To:References;
 b=a1IMb0s5GIMCk2aJpsuGVMzA0jzezfT3Wd8wTZLFLrtz6h5kdGSb0EYqZoEGCfcxx
 54YSgQrBwLjX8CbOq7J4zSOgRbevxyDbbKSy+rC45UCNJsQytrp/F9L2bKue7Yetef
 sBioKm3tFmgcm4gThpP/paG9owZOkSFKgVMKknKv0rS0B8NZ5gJLV861aPtM3s1Rzd
 yZtSDh8L0n7OQSvBHEKpIffORqakDBO+l/jzy3L1nIMcufTkuGccEf39i5QudrmZe8
 5NGOAqsm3mbAT1RUjDV3MKu9N2dW/F6AMoJZUIo9k5QK3Bd9yVGq9k5/6ilws2z/YX
 Lg611BNeUBfYg==
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 (-)


--=-5cTRqjaDdOITOGA8BtZm
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable

Brian Cully via Guix-patches via schreef op ma 02-05-2022 om 15:11 [-
0400]:
> This patch allows copying of out-of-tree kernel modules to the Linux
> initrd.

This needs some information in the manual -- when does the field need
to be set?  For what kernel modules?  Is this required by v4l2loopback-
linux-module and librem-ec-acpi-linux-module?  Things like that.
As-is, this functionality is hard to discover.

Greetings,
Maxime.


--=-5cTRqjaDdOITOGA8BtZm
Content-Type: application/pgp-signature; name="signature.asc"
Content-Description: This is a digitally signed message part
Content-Transfer-Encoding: 7bit

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

iI0EABYKADUWIQTB8z7iDFKP233XAR9J4+4iGRcl7gUCYnBVPhccbWF4aW1lZGV2
b3NAdGVsZW5ldC5iZQAKCRBJ4+4iGRcl7hICAP9CDCAYffBUwkoR9lfzmRg/llBf
MbwZUM4GSZzfcnSn5QEAyofUp0BgfQaywlQmN6VYwaebfeGIVq7RjHqV4Dn2EAk=
=fPl7
-----END PGP SIGNATURE-----

--=-5cTRqjaDdOITOGA8BtZm--





Message sent to guix-patches@HIDDEN:


X-Loop: help-debbugs@HIDDEN
Subject: [bug#55231] [PATCH v1] initrd: Allow extra search paths with =?UTF-8?Q?=E2=80=98initrd-extra-module-paths=E2=80=99?=
Resent-From: Brian Cully <bjc@HIDDEN>
Original-Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
Resent-CC: guix-patches@HIDDEN
Resent-Date: Mon, 02 May 2022 22:56:02 +0000
Resent-Message-ID: <handler.55231.B55231.16515321209880 <at> debbugs.gnu.org>
Resent-Sender: help-debbugs@HIDDEN
X-GNU-PR-Message: followup 55231
X-GNU-PR-Package: guix-patches
X-GNU-PR-Keywords: patch
To: Maxime Devos <maximedevos@HIDDEN>
Cc: 55231 <at> debbugs.gnu.org
Received: via spool by 55231-submit <at> debbugs.gnu.org id=B55231.16515321209880
          (code B ref 55231); Mon, 02 May 2022 22:56:02 +0000
Received: (at 55231) by debbugs.gnu.org; 2 May 2022 22:55:20 +0000
Received: from localhost ([127.0.0.1]:38263 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1nlewq-0002ZI-0d
	for submit <at> debbugs.gnu.org; Mon, 02 May 2022 18:55:20 -0400
Received: from coleridge.kublai.com ([166.84.7.167]:57300 helo=mail.spork.org)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <bjc@HIDDEN>) id 1nlewo-0002ZA-5i
 for 55231 <at> debbugs.gnu.org; Mon, 02 May 2022 18:55:18 -0400
Received: from ditto (unknown [IPv6:2001:470:1f07:1b9:8650:a942:ec5e:856b])
 by mail.spork.org (Postfix) with ESMTPSA id BCCE755FF;
 Mon,  2 May 2022 18:55:07 -0400 (EDT)
DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=spork.org; s=dkim;
 t=1651532117; bh=NO9Rci0bsXvPsmtn24mKPzumpNi0MfZAYg/H9ioZ7hQ=;
 h=References:From:To:Cc:Subject:Date:In-reply-to;
 b=MlfUQYH7c3Of4W9f651wQaFR3xpo2bmYvqYpkXcevQcv7BM3/cmTHklp7VZBUWgJo
 7bt/L/9iMuiMn/tN4Jkn2BUvNYArIvagqjYOp9p2TDPbDe4Edd0iBZoQPxYgV08+OB
 NkwZOMRWImo0FwDStO0RXqvqhQgGuN2YpY4zhpxg=
References: <87wnf3pv87.fsf@HIDDEN>
 <c87a1c647289c0f0fb60773e2fd50916861b4d8b.camel@HIDDEN>
User-agent: mu4e 1.6.10; emacs 28.1
From: Brian Cully <bjc@HIDDEN>
Date: Mon, 02 May 2022 18:53:31 -0400
In-reply-to: <c87a1c647289c0f0fb60773e2fd50916861b4d8b.camel@HIDDEN>
Message-ID: <87sfprpmt3.fsf@HIDDEN>
MIME-Version: 1.0
Content-Type: text/plain; charset=utf-8; format=flowed
Content-Transfer-Encoding: quoted-printable
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 (-)


Maxime Devos <maximedevos@HIDDEN> writes:

> This needs some information in the manual -- when does the field=20
> need
> to be set?  For what kernel modules?  Is this required by=20
> v4l2loopback-
> linux-module and librem-ec-acpi-linux-module?  Things like that.
> As-is, this functionality is hard to discover.

I knew I missed something. How=E2=80=99s this look?

---
 doc/guix.texi | 42 ++++++++++++++++++++++++++++++++++--------
 1 file changed, 34 insertions(+), 8 deletions(-)

diff --git a/doc/guix.texi b/doc/guix.texi
index 5399584cb0..1ee2c1b4a3 100644
--- a/doc/guix.texi
+++ b/doc/guix.texi
@@ -15173,6 +15173,16 @@ Window System.
 The list of Linux kernel modules that need to be available in the
 initial RAM disk.  @xref{Initial RAM Disk}.
=20
+@item @code{initrd-extra-module-paths} (default: @code{'()})
+@cindex initrd
+@cindex initial RAM disk
+A list of paths outside of the Linux kernel tree to search for=20
Linux
+kernel modules.
+
+The items in this may be either file-like objects (usually=20
packages), or
+a list where the first element is a package and the second is an
+output--e.g. @code{(list (list zfs "module"))}.
+
 @item @code{initrd} (default: @code{base-initrd})
 A procedure that returns an initial RAM disk for the Linux
 kernel.  This field is provided to support low-level=20
 customization and
@@ -35516,6 +35526,19 @@ file system, you would write:
   (initrd-modules (cons "megaraid_sas" %base-initrd-modules)))
 @end lisp
=20
+If a module listed in @code{initrd-modules} is not included in=20
the
+Linux-libre kernel, then the location to it must be added to the
+@code{initrd-extra-module-paths} list.  For example, if your root=20
file
+system exists on a ZFS pool, then your configuration might look=20
like the
+following:
+
+@lisp
+(operating-system
+  ;; @dots{}
+  (initrd-modules (cons "zfs" %base-initrd-modules))
+  (initrd-extra-module-paths (list (list zfs "module"))))
+@end lisp
+
 @defvr {Scheme Variable} %base-initrd-modules
 This is the list of kernel modules included in the initrd by=20
 default.
 @end defvr
@@ -35629,13 +35652,15 @@ here is how to use it and customize it=20
further.
 @cindex initrd
 @cindex initial RAM disk
 @deffn {Scheme Procedure} raw-initrd @var{file-systems} @
-       [#:linux-modules '()] [#:mapped-devices '()] @
-       [#:keyboard-layout #f] @
+       [#:linux-modules '()] [#:linux-extra-module-paths '()] @
+       [#:mapped-devices '()] [#:keyboard-layout #f] @
        [#:helper-packages '()] [#:qemu-networking? #f]=20
        [#:volatile-root? #f]
 Return a derivation that builds a raw initrd.  @var{file-systems}=20
 is
 a list of file systems to be mounted by the initrd, possibly in=20
 addition to
 the root file system specified on the kernel command line via=20
 @option{root}.
 @var{linux-modules} is a list of kernel modules to be loaded at=20
 boot time.
+@var{linux-extra-module-paths} is a list of file-like objects to=20
be searched
+for kernel modules.
 @var{mapped-devices} is a list of device mappings to realize=20
 before
 @var{file-systems} are mounted (@pxref{Mapped Devices}).
 @var{helper-packages} is a list of packages to be copied in the=20
 initrd.
@@ -35660,12 +35685,13 @@ to it are lost.
 @deffn {Scheme Procedure} base-initrd @var{file-systems} @
        [#:mapped-devices '()] [#:keyboard-layout #f] @
        [#:qemu-networking? #f] [#:volatile-root? #f] @
-       [#:linux-modules '()]
-Return as a file-like object a generic initrd, with kernel
-modules taken from @var{linux}.  @var{file-systems} is a list of=20
 file-systems to be
-mounted by the initrd, possibly in addition to the root file=20
 system specified
-on the kernel command line via @option{root}.=20
 @var{mapped-devices} is a list of device
-mappings to realize before @var{file-systems} are mounted.
+       [#:linux-modules '()] [#:linux-extra-module-paths '()]
+Return as a file-like object a generic initrd, with kernel=20
modules taken
+from @var{linux} and @var{linux-extra-module-paths}.=20
@var{file-systems}
+is a list of file-systems to be mounted by the initrd, possibly=20
in
+addition to the root file system specified on the kernel command=20
line
+via @option{root}.  @var{mapped-devices} is a list of device=20
mappings to
+realize before @var{file-systems} are mounted.
=20
 When true, @var{keyboard-layout} is a @code{<keyboard-layout>}=20
 record denoting
 the desired console keyboard layout.  This is done before=20
 @var{mapped-devices}
--=20
2.35.1




Message sent to guix-patches@HIDDEN:


X-Loop: help-debbugs@HIDDEN
Subject: [bug#55231] [PATCH v1] initrd: Allow extra search paths with =?UTF-8?Q?=E2=80=98initrd-extra-module-paths=E2=80=99?=
References: <87wnf3pv87.fsf@HIDDEN>
In-Reply-To: <87wnf3pv87.fsf@HIDDEN>
Resent-From: Kaelyn <kaelyn.alexi@HIDDEN>
Original-Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
Resent-CC: guix-patches@HIDDEN
Resent-Date: Fri, 13 May 2022 19:47:01 +0000
Resent-Message-ID: <handler.55231.B55231.165247118028474 <at> debbugs.gnu.org>
Resent-Sender: help-debbugs@HIDDEN
X-GNU-PR-Message: followup 55231
X-GNU-PR-Package: guix-patches
X-GNU-PR-Keywords: patch
To: "55231 <at> debbugs.gnu.org" <55231 <at> debbugs.gnu.org>
Reply-To: Kaelyn <kaelyn.alexi@HIDDEN>
Received: via spool by 55231-submit <at> debbugs.gnu.org id=B55231.165247118028474
          (code B ref 55231); Fri, 13 May 2022 19:47:01 +0000
Received: (at 55231) by debbugs.gnu.org; 13 May 2022 19:46:20 +0000
Received: from localhost ([127.0.0.1]:45080 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1npbEy-0007PC-6L
	for submit <at> debbugs.gnu.org; Fri, 13 May 2022 15:46:20 -0400
Received: from mail-40138.protonmail.ch ([185.70.40.138]:13975)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <kaelyn.alexi@HIDDEN>) id 1npbEw-0007Oy-2H
 for 55231 <at> debbugs.gnu.org; Fri, 13 May 2022 15:46:18 -0400
Date: Fri, 13 May 2022 19:46:02 +0000
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=protonmail.com;
 s=protonmail2; t=1652471170; x=1652730370;
 bh=8jQUkjaGsOdNjWHjXT41h4SNsXREShc41EWYMNFdmwk=;
 h=Date:To:From:Reply-To:Subject:Message-ID:Feedback-ID:From:To:Cc:
 Date:Subject:Reply-To:Feedback-ID:Message-ID;
 b=gDAlUBEqqAS8lwHmrVqdIJgbFt+aZBvyEcAZShoEP5ODhZB41RFoj4gcEwLKe5Eei
 TWUybaRMNMJxdxCcN+CM9M170cx3B1rzHUw/K/dGeJNdFue9J3IoLiVAWrKEO9RCmW
 MzgEpL3Puhp7H9dHJ2VNmCO3EHYIrhwYqLxKe2+Ocjd8IJpMO9mvcTjRf3W3LzKmii
 lbr7ISfMFLmWKPmJlpRBCtoPbncnClKA5yVIOV2Eqzn1gE6tSijSx5ZlS/NNO8MwKW
 6gOuSi9NfAA+asSQdwGYy6RxSoyjzFzMeDSr/Co7PS7K6HqqETpt6VLd/jNRBOG3RW
 m1WXJWKwCJUJA==
From: Kaelyn <kaelyn.alexi@HIDDEN>
Message-ID: <j3O4Vb5dVlLA_P-LaSEH-2wB7aPJM3Zlupj1seuNjR34OijQwAiM9ZECRx309TmNwIejOzHv_W5lkUkeQC8MqGTbK3kqjcZa3fCx440oWcw=@protonmail.com>
Feedback-ID: 34709329:user:proton
MIME-Version: 1.0
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: quoted-printable
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 (-)

I've read through the original patch and the doc patch, and based on my own=
 tinkering with guix initrd generation, the patches look good to me. I'm al=
so happy to see the functionality being added, and already have plans for u=
sing it with zfs (to further the goal of an encrypted multi-disk zfs root).

Cheers,
Kaelyn




Message sent to guix-patches@HIDDEN:


X-Loop: help-debbugs@HIDDEN
Subject: [bug#55231] [PATCH v1] initrd: Allow extra search paths with =?UTF-8?Q?=E2=80=98initrd-extra-module-paths=E2=80=99?=
References: <87wnf3pv87.fsf@HIDDEN>
In-Reply-To: <87wnf3pv87.fsf@HIDDEN>
Resent-From: Maxime Devos <maximedevos@HIDDEN>
Original-Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
Resent-CC: guix-patches@HIDDEN
Resent-Date: Fri, 13 May 2022 20:26:01 +0000
Resent-Message-ID: <handler.55231.B55231.16524735479232 <at> debbugs.gnu.org>
Resent-Sender: help-debbugs@HIDDEN
X-GNU-PR-Message: followup 55231
X-GNU-PR-Package: guix-patches
X-GNU-PR-Keywords: patch
To: 55231 <at> debbugs.gnu.org
Received: via spool by 55231-submit <at> debbugs.gnu.org id=B55231.16524735479232
          (code B ref 55231); Fri, 13 May 2022 20:26:01 +0000
Received: (at 55231) by debbugs.gnu.org; 13 May 2022 20:25:47 +0000
Received: from localhost ([127.0.0.1]:45127 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1npbr9-0002Op-2w
	for submit <at> debbugs.gnu.org; Fri, 13 May 2022 16:25:47 -0400
Received: from andre.telenet-ops.be ([195.130.132.53]:39038)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <maximedevos@HIDDEN>) id 1npbr6-0002Oe-OV
 for 55231 <at> debbugs.gnu.org; Fri, 13 May 2022 16:25:45 -0400
Received: from ptr-bvsjgyhxw7psv60dyze.18120a2.ip6.access.telenet.be
 ([IPv6:2a02:1811:8c09:9d00:3c5f:2eff:feb0:ba5a])
 by andre.telenet-ops.be with bizsmtp
 id WLRi2700H4UW6Th01LRiFD; Fri, 13 May 2022 22:25:43 +0200
Message-ID: <f31190b82fc43348535ee873bcc29a9ff501a6f7.camel@HIDDEN>
From: Maxime Devos <maximedevos@HIDDEN>
Date: Fri, 13 May 2022 22:25:38 +0200
Content-Type: multipart/signed; micalg="pgp-sha512";
 protocol="application/pgp-signature"; boundary="=-GE9Q+CrVfXqiuTqWmUXp"
User-Agent: Evolution 3.38.3-1 
MIME-Version: 1.0
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=telenet.be; s=r22;
 t=1652473543; bh=hsBHtNehVIG+3lJ5bPGWfrmjAPN+XZaxpGoU3jwebG0=;
 h=Subject:From:To:Date;
 b=j7pUgPEWWCmJ53yNdsnLLB6KQVS7Dj7lScGON0ayiLmC1hYu7pqdphO4ttK1n1ODa
 s2QRk2+55xN533vnPe5Ct8YA+o9kB5b3AjhdDOPRJ7CYCuMTf6XudUywsl2hIlS4q7
 Ffgia5bvR0U1sMdiKqX+7ILtCg515ea14xm3Q9FZLeHPjNuMilNao2m85zgDpBvB2C
 GBiAP+WBXb2uCCGBdU2OdQ1htVqS6e0hPZM/aIRksBIalN3koalsN3YQiwXVKmj16N
 mFXaz1N1/NOp+PDKVvA+A84+ywUXT/vH2etZ/FicMrcx63cZGE59wlFnb5kwYUdBgi
 Zk96ONbIttYEA==
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 (-)


--=-GE9Q+CrVfXqiuTqWmUXp
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable



(for whatever reason, looks like this didn't end up in my inbox)
> +@item @code{initrd-extra-module-paths} (default: @code{'()})
> [...]
> The items in this may be either file-like objects (usually=20
> packages), or
> +a list where the first element is a package and the second is an
> +output--e.g. @code{(list (list zfs "module"))}.


As-is, I don't think this is a good example, because
'expression->initrd' does not set #:substitutable? #false,
the 'zfs' package has the comment (*)

     `(;; The ZFS kernel module should not be downloaded since the
license
       ;; terms don't allow for distributing it, only building it
locally.
       #:substitutable? #f [...])

and IIUC, the code inside expression->initrd copies the kernel module
into
the new store item, so it looks like this accidentally suggest people
to
commit copyvios, and copyvios are currently against the law.

Greetings,
Maxime.

(*) Though I don't understand that comment: Guix is a distribution, so
by definition
it's distributing zfs -- unless it's only talking about the binaries
and not the
source code ...


--=-GE9Q+CrVfXqiuTqWmUXp
Content-Type: application/pgp-signature; name="signature.asc"
Content-Description: This is a digitally signed message part
Content-Transfer-Encoding: 7bit

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

iI0EABYKADUWIQTB8z7iDFKP233XAR9J4+4iGRcl7gUCYn6+whccbWF4aW1lZGV2
b3NAdGVsZW5ldC5iZQAKCRBJ4+4iGRcl7tLWAP43VVfdGmeFc9n0cZfORPFbnUiG
b2Lnn8OyvxuhJtatbQEAlkKAnfaCenTjzuTbHXXUmzswBC/4ZzWpl4AtlxOWSQ8=
=lAgN
-----END PGP SIGNATURE-----

--=-GE9Q+CrVfXqiuTqWmUXp--





Message sent to guix-patches@HIDDEN:


X-Loop: help-debbugs@HIDDEN
Subject: [bug#55231] [PATCH v2] initrd: Allow extra search paths with =?UTF-8?Q?=E2=80=98initrd-extra-module-paths=E2=80=99?=
References: <87wnf3pv87.fsf@HIDDEN>
In-Reply-To: <87wnf3pv87.fsf@HIDDEN>
Resent-From: Brian Cully <bjc@HIDDEN>
Original-Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
Resent-CC: guix-patches@HIDDEN
Resent-Date: Sat, 21 May 2022 19:14:02 +0000
Resent-Message-ID: <handler.55231.B55231.165316039710553 <at> debbugs.gnu.org>
Resent-Sender: help-debbugs@HIDDEN
X-GNU-PR-Message: followup 55231
X-GNU-PR-Package: guix-patches
X-GNU-PR-Keywords: patch
To: 55231 <at> debbugs.gnu.org
Cc: Brian Cully <bjc@HIDDEN>
Received: via spool by 55231-submit <at> debbugs.gnu.org id=B55231.165316039710553
          (code B ref 55231); Sat, 21 May 2022 19:14:02 +0000
Received: (at 55231) by debbugs.gnu.org; 21 May 2022 19:13:17 +0000
Received: from localhost ([127.0.0.1]:42976 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1nsUXM-0002k8-DT
	for submit <at> debbugs.gnu.org; Sat, 21 May 2022 15:13:17 -0400
Received: from coleridge.kublai.com ([166.84.7.167]:57942 helo=mail.spork.org)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <bjc@HIDDEN>) id 1nsUXK-0002k0-7W
 for 55231 <at> debbugs.gnu.org; Sat, 21 May 2022 15:13:15 -0400
Received: from guix.jhoto.kublai.com (unknown
 [IPv6:2001:470:1f07:1b9:c714:ed8b:7cf4:a700])
 by mail.spork.org (Postfix) with ESMTPSA id 0CBD470CA;
 Sat, 21 May 2022 15:13:14 -0400 (EDT)
DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=spork.org; s=dkim;
 t=1653160394; bh=lye+eu/C0xitMixOX5/Vcr/gOROF3AtimFdB3XpxwBQ=;
 h=From:To:Cc:Subject:Date;
 b=EQaIDMHaHNHCBgRat23MBgGBIUWTE3pOmwJOaaGN34YKQSUaIPVao54MejZrw9M2h
 +AwtIcKg2zg6Ka4PwXcMR0ZHrhlG3VzIGPMknElfI4CXq6anA8uqvQsnR73PIhSJGS
 y22pe8MOaSjEvywbBmnMva96qVnwAJLD+uKA7etM=
From: Brian Cully <bjc@HIDDEN>
Date: Sat, 21 May 2022 15:12:45 -0400
Message-Id: <2053c4ab42dfe2719cfc377934ac2fb9bcb500a9.1653160364.git.bjc@HIDDEN>
X-Mailer: git-send-email 2.36.1
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
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 (-)

From: Brian Cully <bjc@HIDDEN>

This patch allows copying of out-of-tree kernel modules to the Linux
initrd.

For out-of-tree modules to found, an extra slot has been added to
‘operating-system’: ‘initrd-extra-module-paths’, which contains a list
containing items of either FILE-LIKE or (FILE-LIKE OUTPUT) which will be
searched for modules in addition to the standard Linux module path. The
required modules can then be added to ‘initrd-modules’ as normal and all paths
will be searched for it, including for any modules depended on.

* doc: Update documentation for ‘initrd-extra-module-paths’.
* gnu/build/linux-modules.scm (find-module-file): change DIRECTORY argument to
DIRECTORIES. Now takes a list of directories to search, rather than a single
one.
* gnu/system.scm <operating-system>: Add INITRD-EXTRA-MODULE-PATHS
field and accessor. Takes a list of file-like objects.
* gnu/system/linux-initrd.scm (flat-linux-module-directory): change LINUX
argument to PACKAGES. Now contains a list of file-likes to search for modules.
(raw-initrd): Add LINUX-EXTRA-MODULE-PATHS keyword argument. Pass it
to (flat-linux-extra-module-paths) along with the selected LINUX package.
(base-initrd): Add LINUX-EXTRA-MODULE-PATHS keyword argument. Pass it
to (raw-initrd).
---
This version includes both the previous patch and the documentation.

 doc/guix.texi               | 42 ++++++++++++++++++++++++------
 gnu/build/linux-modules.scm | 19 ++++++++------
 gnu/system.scm              |  5 ++++
 gnu/system/linux-initrd.scm | 52 +++++++++++++++++++++++++------------
 4 files changed, 85 insertions(+), 33 deletions(-)

diff --git a/doc/guix.texi b/doc/guix.texi
index faa35060ef..9fd45ea209 100644
--- a/doc/guix.texi
+++ b/doc/guix.texi
@@ -15490,6 +15490,16 @@ operating-system Reference
 The list of Linux kernel modules that need to be available in the
 initial RAM disk.  @xref{Initial RAM Disk}.
 
+@item @code{initrd-extra-module-paths} (default: @code{'()})
+@cindex initrd
+@cindex initial RAM disk
+A list of paths outside of the Linux kernel tree to search for Linux
+kernel modules.
+
+The items in this may be either file-like objects (usually packages), or
+a list where the first element is a package and the second is an
+output--e.g. @code{(list (list zfs "module"))}.
+
 @item @code{initrd} (default: @code{base-initrd})
 A procedure that returns an initial RAM disk for the Linux
 kernel.  This field is provided to support low-level customization and
@@ -35816,6 +35826,19 @@ Initial RAM Disk
   (initrd-modules (cons "megaraid_sas" %base-initrd-modules)))
 @end lisp
 
+If a module listed in @code{initrd-modules} is not included in the
+Linux-libre kernel, then the location to it must be added to the
+@code{initrd-extra-module-paths} list.  For example, if your root file
+system exists on a ZFS pool, then your configuration might look like the
+following:
+
+@lisp
+(operating-system
+  ;; @dots{}
+  (initrd-modules (cons "zfs" %base-initrd-modules))
+  (initrd-extra-module-paths (list (list zfs "module"))))
+@end lisp
+
 @defvr {Scheme Variable} %base-initrd-modules
 This is the list of kernel modules included in the initrd by default.
 @end defvr
@@ -35929,13 +35952,15 @@ Initial RAM Disk
 @cindex initrd
 @cindex initial RAM disk
 @deffn {Scheme Procedure} raw-initrd @var{file-systems} @
-       [#:linux-modules '()] [#:mapped-devices '()] @
-       [#:keyboard-layout #f] @
+       [#:linux-modules '()] [#:linux-extra-module-paths '()] @
+       [#:mapped-devices '()] [#:keyboard-layout #f] @
        [#:helper-packages '()] [#:qemu-networking? #f] [#:volatile-root? #f]
 Return a derivation that builds a raw initrd.  @var{file-systems} is
 a list of file systems to be mounted by the initrd, possibly in addition to
 the root file system specified on the kernel command line via @option{root}.
 @var{linux-modules} is a list of kernel modules to be loaded at boot time.
+@var{linux-extra-module-paths} is a list of file-like objects to be searched
+for kernel modules.
 @var{mapped-devices} is a list of device mappings to realize before
 @var{file-systems} are mounted (@pxref{Mapped Devices}).
 @var{helper-packages} is a list of packages to be copied in the initrd.
@@ -35960,12 +35985,13 @@ Initial RAM Disk
 @deffn {Scheme Procedure} base-initrd @var{file-systems} @
        [#:mapped-devices '()] [#:keyboard-layout #f] @
        [#:qemu-networking? #f] [#:volatile-root? #f] @
-       [#:linux-modules '()]
-Return as a file-like object a generic initrd, with kernel
-modules taken from @var{linux}.  @var{file-systems} is a list of file-systems to be
-mounted by the initrd, possibly in addition to the root file system specified
-on the kernel command line via @option{root}.  @var{mapped-devices} is a list of device
-mappings to realize before @var{file-systems} are mounted.
+       [#:linux-modules '()] [#:linux-extra-module-paths '()]
+Return as a file-like object a generic initrd, with kernel modules taken
+from @var{linux} and @var{linux-extra-module-paths}.  @var{file-systems}
+is a list of file-systems to be mounted by the initrd, possibly in
+addition to the root file system specified on the kernel command line
+via @option{root}.  @var{mapped-devices} is a list of device mappings to
+realize before @var{file-systems} are mounted.
 
 When true, @var{keyboard-layout} is a @code{<keyboard-layout>} record denoting
 the desired console keyboard layout.  This is done before @var{mapped-devices}
diff --git a/gnu/build/linux-modules.scm b/gnu/build/linux-modules.scm
index 053720574b..97b7e429ea 100644
--- a/gnu/build/linux-modules.scm
+++ b/gnu/build/linux-modules.scm
@@ -225,8 +225,8 @@ (define (file-name->module-name file)
 '.ko[.gz|.xz]' and normalizing it."
   (normalize-module-name (strip-extension (basename file))))
 
-(define (find-module-file directory module)
-  "Lookup module NAME under DIRECTORY, and return its absolute file name.
+(define (find-module-file directories module)
+  "Lookup module NAME under DIRECTORIES, and return its absolute file name.
 NAME can be a file name with or without '.ko', or it can be a module name.
 Raise an error if it could not be found.
 
@@ -247,16 +247,19 @@ (define (find-module-file directory module)
                            (else chr)))
                        module))))
 
-  (match (find-files directory
-                     (lambda (file stat)
-                       (member (strip-extension
-                                (basename file)) names)))
+  (match (append-map (lambda (directory)
+                       (find-files directory
+                                   (lambda (file _stat)
+                                     (member (strip-extension
+                                              (basename file))
+                                             names))))
+                       directories)
     ((file)
      file)
     (()
-     (error "kernel module not found" module directory))
+     (error "kernel module not found" module directories))
     ((_ ...)
-     (error "several modules by that name" module directory))))
+     (error "several modules by that name" module directories))))
 
 (define* (recursive-module-dependencies files
                                         #:key (lookup-module dot-ko))
diff --git a/gnu/system.scm b/gnu/system.scm
index ba3a1865d7..6c712e5cea 100644
--- a/gnu/system.scm
+++ b/gnu/system.scm
@@ -107,6 +107,7 @@ (define-module (gnu system)
             operating-system-label
             operating-system-default-label
             operating-system-initrd-modules
+            operating-system-initrd-extra-module-paths
             operating-system-initrd
             operating-system-users
             operating-system-groups
@@ -236,6 +237,8 @@ (define-record-type* <operating-system> operating-system
   (initrd-modules operating-system-initrd-modules ; list of strings
                   (thunked)                       ; it's system-dependent
                   (default %base-initrd-modules))
+  (initrd-extra-module-paths operating-system-initrd-extra-module-paths ; list of file-likes
+                             (default '()))
 
   (firmware operating-system-firmware             ; list of packages
             (default %base-firmware))
@@ -1312,6 +1315,8 @@ (define (operating-system-initrd-file os)
                #:linux (operating-system-kernel os)
                #:linux-modules
                (operating-system-initrd-modules os)
+               #:linux-extra-module-paths
+               (operating-system-initrd-extra-module-paths os)
                #:mapped-devices mapped-devices
                #:keyboard-layout (operating-system-keyboard-layout os)))
 
diff --git a/gnu/system/linux-initrd.scm b/gnu/system/linux-initrd.scm
index 4c4c78e444..50a182d7d5 100644
--- a/gnu/system/linux-initrd.scm
+++ b/gnu/system/linux-initrd.scm
@@ -119,13 +119,23 @@ (define* (expression->initrd exp
                               `(#:references-graphs (("closure" ,init))))
                "/initrd.cpio.gz"))
 
-(define (flat-linux-module-directory linux modules)
+(define (flat-linux-module-directory packages modules)
   "Return a flat directory containing the Linux kernel modules listed in
-MODULES and taken from LINUX."
+MODULES and taken from PACKAGES."
   (define imported-modules
     (source-module-closure '((gnu build linux-modules)
                              (guix build utils))))
 
+  (define (package+out->input package out)
+    (gexp-input package out))
+
+  (define package-inputs
+    (map (lambda (p)
+           (match p
+             ((p o) (package+out->input p o))
+             (p     (package+out->input p "out"))))
+         packages))
+
   (define build-exp
     (with-imported-modules imported-modules
       (with-extensions (list guile-zlib)
@@ -135,11 +145,12 @@ (define (flat-linux-module-directory linux modules)
                          (srfi srfi-1)
                          (srfi srfi-26))
 
-            (define module-dir
-              (string-append #$linux "/lib/modules"))
+            (define module-dirs
+              (map (cut string-append <> "/lib/modules")
+                   '#$package-inputs))
 
             (define modules
-              (let* ((lookup  (cut find-module-file module-dir <>))
+              (let* ((lookup  (cut find-module-file module-dirs <>))
                      (modules (map lookup '#$modules)))
                 (append modules
                         (recursive-module-dependencies
@@ -172,20 +183,23 @@ (define* (raw-initrd file-systems
                       #:key
                       (linux linux-libre)
                       (linux-modules '())
+                      (linux-extra-module-paths '())
                       (mapped-devices '())
                       (keyboard-layout #f)
                       (helper-packages '())
                       qemu-networking?
                       volatile-root?
                       (on-error 'debug))
-  "Return as a file-like object a raw initrd, with kernel
-modules taken from LINUX.  FILE-SYSTEMS is a list of file-systems to be
-mounted by the initrd, possibly in addition to the root file system specified
-on the kernel command line via 'root'.  LINUX-MODULES is a list of kernel
-modules to be loaded at boot time. MAPPED-DEVICES is a list of device
-mappings to realize before FILE-SYSTEMS are mounted.
-HELPER-PACKAGES is a list of packages to be copied in the initrd. It may include
-e2fsck/static or other packages needed by the initrd to check root partition.
+  "Return as a file-like object a raw initrd, with kernel modules taken from
+LINUX.  FILE-SYSTEMS is a list of file-systems to be mounted by the initrd,
+possibly in addition to the root file system specified on the kernel command
+line via 'root'.  LINUX-MODULES is a list of kernel modules to be loaded at
+boot time. LINUX-EXTRA-MODULE-PATHS is a list of file-like objects which will
+be searched for modules in addition to the linux kernel. MAPPED-DEVICES is a
+list of device mappings to realize before FILE-SYSTEMS are mounted.
+HELPER-PACKAGES is a list of packages to be copied in the initrd. It may
+include e2fsck/static or other packages needed by the initrd to check root
+partition.
 
 When true, KEYBOARD-LAYOUT is a <keyboard-layout> record denoting the desired
 console keyboard layout.  This is done before MAPPED-DEVICES are set up and
@@ -221,7 +235,8 @@ (define* (raw-initrd file-systems
           #~())))
 
   (define kodir
-    (flat-linux-module-directory linux linux-modules))
+    (flat-linux-module-directory (cons linux linux-extra-module-paths)
+                                 linux-modules))
 
   (expression->initrd
    (with-imported-modules (source-module-closure
@@ -366,6 +381,7 @@ (define* (base-initrd file-systems
                       #:key
                       (linux linux-libre)
                       (linux-modules '())
+                      (linux-extra-module-paths '())
                       (mapped-devices '())
                       (keyboard-layout #f)
                       qemu-networking?
@@ -386,9 +402,10 @@ (define* (base-initrd file-systems
 QEMU-NETWORKING? and VOLATILE-ROOT? behaves as in raw-initrd.
 
 The initrd is automatically populated with all the kernel modules necessary
-for FILE-SYSTEMS and for the given options.  Additional kernel
-modules can be listed in LINUX-MODULES.  They will be added to the initrd, and
-loaded at boot time in the order in which they appear."
+for FILE-SYSTEMS and for the given options.  Additional kernel modules can be
+listed in LINUX-MODULES.  Additional search paths for modules can be listed in
+LINUX-EXTRA-MODULE-PATHS.  They will be added to the initrd, and loaded at
+boot time in the order in which they appear."
   (define linux-modules*
     ;; Modules added to the initrd and loaded from the initrd.
     `(,@linux-modules
@@ -408,6 +425,7 @@ (define* (base-initrd file-systems
   (raw-initrd file-systems
               #:linux linux
               #:linux-modules linux-modules*
+              #:linux-extra-module-paths linux-extra-module-paths
               #:mapped-devices mapped-devices
               #:helper-packages helper-packages
               #:keyboard-layout keyboard-layout
-- 
2.36.1





Message sent to guix-patches@HIDDEN:


X-Loop: help-debbugs@HIDDEN
Subject: [bug#55231] [PATCH v1] initrd: Allow extra search paths with =?UTF-8?Q?=E2=80=98initrd-extra-module-paths=E2=80=99?=
References: <87wnf3pv87.fsf@HIDDEN>
In-Reply-To: <87wnf3pv87.fsf@HIDDEN>
Resent-From: Kaelyn <kaelyn.alexi@HIDDEN>
Original-Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
Resent-CC: guix-patches@HIDDEN
Resent-Date: Mon, 30 May 2022 20:15:02 +0000
Resent-Message-ID: <handler.55231.B55231.16539416799874 <at> debbugs.gnu.org>
Resent-Sender: help-debbugs@HIDDEN
X-GNU-PR-Message: followup 55231
X-GNU-PR-Package: guix-patches
X-GNU-PR-Keywords: patch
To: "55231 <at> debbugs.gnu.org" <55231 <at> debbugs.gnu.org>
Reply-To: Kaelyn <kaelyn.alexi@HIDDEN>
Received: via spool by 55231-submit <at> debbugs.gnu.org id=B55231.16539416799874
          (code B ref 55231); Mon, 30 May 2022 20:15:02 +0000
Received: (at 55231) by debbugs.gnu.org; 30 May 2022 20:14:39 +0000
Received: from localhost ([127.0.0.1]:46124 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1nvlmh-0002ZB-HY
	for submit <at> debbugs.gnu.org; Mon, 30 May 2022 16:14:39 -0400
Received: from mail-40141.protonmail.ch ([185.70.40.141]:45113)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <kaelyn.alexi@HIDDEN>) id 1nvlmf-0002Yr-Tn
 for 55231 <at> debbugs.gnu.org; Mon, 30 May 2022 16:14:38 -0400
Date: Mon, 30 May 2022 20:14:25 +0000
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=protonmail.com;
 s=protonmail3; t=1653941671; x=1654200871;
 bh=aHw3z51Hdr5WGrcZvkbvt6obAreacnR1kTHFADH/zxU=;
 h=Date:To:From:Reply-To:Subject:Message-ID:Feedback-ID:From:To:Cc:
 Date:Subject:Reply-To:Feedback-ID:Message-ID;
 b=F/2YaxipkyVXrALuLwSZi/x0lLeSXt/QhB7ZnIhW7HV/67l0ppnQyobEBVlll/ZJW
 X6W8p1gRWfUsDDCysYBy8YIEfw7UGVDp/rPrEeyh/jePaN07gv+SwlJCMqsevNhdsz
 bAFmBexxv5yGQPVHtalv0g3Z/rQjdm9i9NklplwrSxBEPb1BH1m0CemJ7LLMT9ANZZ
 0JZx9g6zlZyJ28tc1fOWGZ7HIaCyulrwHvcOZrojomhSGgz9rm+jukts7VHS15JmMG
 AhciaBnMPljUHD3LZEBnVZ3/tzJ8VNLD2U+a03op/Q19uJXzXWXyzvtZw0Y29UTWE1
 RfXNSbvaq4j3g==
From: Kaelyn <kaelyn.alexi@HIDDEN>
Message-ID: <5RCll7W7NfLNRPRFsqgPxB3zS1_6W-9QJbOmXc5RW3E8oZ4Pm_JTzO0SZXsMkZtC811Rw5G0ISt75vP_YKll5MGU7_Krm3Y6IWoXYL9xR3A=@protonmail.com>
Feedback-ID: 34709329:user:proton
MIME-Version: 1.0
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: quoted-printable
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 (-)


As the earlier patch discussion seemed to have focused on ZFS licensing iss=
ues that are largely orothogonal to the functionality being added, I'd like=
 to again voice my support for the proposed patch. While ZFS is indeed a ba=
d example due to open questions about module licensing and redistribution, =
it isn't the only out-of-tree module currently packaged in Guix which could=
 be used with the extra initrd support (not counting future packages or ext=
ernal channels). Within the guix repo, the packages using the `linux-module=
-build-system` aside from zfs are:
- acpi-call-linux-module
- bbswitch-module
- ddcci-driver-linux
- rtl8812au-aircrack-ng-linux-module
- rtl8821ce-linux-module
- ttyebus-linux-module
- v4l2loopback-linux-module
- vhba-module
- wiregard-linux-compat

Of those nine, at least four look to be for specific hardware, and I can co=
me up with theoretical use cases for why someone might want those or wirega=
rd-linux-compat (though the cases are definitely contrived straw-men that m=
ay or may not be implementable in practice or actually useful in an initrd =
context, such as network booting with an older kernel and the root filesyst=
em can only be accessed over a wireguard connection).

Cheers,
Kaelyn




Message sent to guix-patches@HIDDEN:


X-Loop: help-debbugs@HIDDEN
Subject: [bug#55231] [PATCH v1] initrd: Allow extra search paths with =?UTF-8?Q?=E2=80=98initrd-extra-module-paths=E2=80=99?=
Resent-From: Ludovic =?UTF-8?Q?Court=C3=A8s?= <ludo@HIDDEN>
Original-Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
Resent-CC: guix-patches@HIDDEN
Resent-Date: Wed, 01 Jun 2022 15:56:01 +0000
Resent-Message-ID: <handler.55231.B55231.165409890515597 <at> debbugs.gnu.org>
Resent-Sender: help-debbugs@HIDDEN
X-GNU-PR-Message: followup 55231
X-GNU-PR-Package: guix-patches
X-GNU-PR-Keywords: patch
To: Brian Cully <bjc@HIDDEN>
Cc: 55231 <at> debbugs.gnu.org, Brian Cully <bjc@HIDDEN>
Received: via spool by 55231-submit <at> debbugs.gnu.org id=B55231.165409890515597
          (code B ref 55231); Wed, 01 Jun 2022 15:56:01 +0000
Received: (at 55231) by debbugs.gnu.org; 1 Jun 2022 15:55:05 +0000
Received: from localhost ([127.0.0.1]:51684 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1nwQgb-00043U-4U
	for submit <at> debbugs.gnu.org; Wed, 01 Jun 2022 11:55:05 -0400
Received: from eggs.gnu.org ([209.51.188.92]:57780)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <ludo@HIDDEN>) id 1nwQgZ-00042s-B2
 for 55231 <at> debbugs.gnu.org; Wed, 01 Jun 2022 11:55:03 -0400
Received: from fencepost.gnu.org ([2001:470:142:3::e]:37564)
 by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.90_1) (envelope-from <ludo@HIDDEN>)
 id 1nwQgS-0001Sn-IP; Wed, 01 Jun 2022 11:54:56 -0400
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org;
 s=fencepost-gnu-org; h=MIME-Version:In-Reply-To:Date:References:Subject:To:
 From; bh=4FgHx67M7wzGDu2tGyxd76n6DPVnCywDO6cw7VtaKwc=; b=qCy0LOoq+kOwoyNjjE+b
 Frfvzgl9Pch3nR1sScXcRQaBGNTe34ciTLHidCYq2RCJb4L4KZl23JuUchdB+HOEvpdYLic3qIhdX
 pD3rW67NRm79xfxZp7bNzKknLmor8mq9xzNcC1LYy6qF5fTbTb7BGqSVIJpRg//jlW9H/qEkAic3f
 0dk8grnQbeN8ofHfP9nJqCeAJzugniC4MT5VIzOxhyoVK/eb+gC+QRGNeI5sPvanVl4QJ4dmtzf/W
 cQ4CVOXCmPE2YI/nIakyzGsofMSDTza0q1vnwY8AKAP51iw4O628Be8CW4/jWnie8rIupNnUV500a
 Akr6qLHqQd9Pyg==;
Received: from [2a01:e0a:1d:7270:af76:b9b:ca24:c465] (port=53194 helo=ribbon)
 by fencepost.gnu.org with esmtpsa
 (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1)
 (envelope-from <ludo@HIDDEN>)
 id 1nwQgS-0007fD-3i; Wed, 01 Jun 2022 11:54:56 -0400
From: Ludovic =?UTF-8?Q?Court=C3=A8s?= <ludo@HIDDEN>
References: <87wnf3pv87.fsf@HIDDEN>
 <2053c4ab42dfe2719cfc377934ac2fb9bcb500a9.1653160364.git.bjc@HIDDEN>
Date: Wed, 01 Jun 2022 17:54:54 +0200
In-Reply-To: <2053c4ab42dfe2719cfc377934ac2fb9bcb500a9.1653160364.git.bjc@HIDDEN>
 (Brian Cully's message of "Sat, 21 May 2022 15:12:45 -0400")
Message-ID: <87ilpkwf8x.fsf_-_@HIDDEN>
User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.1 (gnu/linux)
MIME-Version: 1.0
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: quoted-printable
X-Spam-Score: -2.3 (--)
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: -3.3 (---)

Hello Brian,

Brian Cully <bjc@HIDDEN> skribis:

> From: Brian Cully <bjc@HIDDEN>
>
> This patch allows copying of out-of-tree kernel modules to the Linux
> initrd.
>
> For out-of-tree modules to found, an extra slot has been added to
> =E2=80=98operating-system=E2=80=99: =E2=80=98initrd-extra-module-paths=E2=
=80=99, which contains a list
> containing items of either FILE-LIKE or (FILE-LIKE OUTPUT) which will be
> searched for modules in addition to the standard Linux module path. The
> required modules can then be added to =E2=80=98initrd-modules=E2=80=99 as=
 normal and all paths
> will be searched for it, including for any modules depended on.
>
> * doc: Update documentation for =E2=80=98initrd-extra-module-paths=E2=80=
=99.
> * gnu/build/linux-modules.scm (find-module-file): change DIRECTORY argume=
nt to
> DIRECTORIES. Now takes a list of directories to search, rather than a sin=
gle
> one.
> * gnu/system.scm <operating-system>: Add INITRD-EXTRA-MODULE-PATHS
> field and accessor. Takes a list of file-like objects.
> * gnu/system/linux-initrd.scm (flat-linux-module-directory): change LINUX
> argument to PACKAGES. Now contains a list of file-likes to search for mod=
ules.
> (raw-initrd): Add LINUX-EXTRA-MODULE-PATHS keyword argument. Pass it
> to (flat-linux-extra-module-paths) along with the selected LINUX package.
> (base-initrd): Add LINUX-EXTRA-MODULE-PATHS keyword argument. Pass it
> to (raw-initrd).

Nice, it looks like a welcome addition.

> +If a module listed in @code{initrd-modules} is not included in the
> +Linux-libre kernel, then the location to it must be added to the
> +@code{initrd-extra-module-paths} list.  For example, if your root file
> +system exists on a ZFS pool, then your configuration might look like the
> +following:
> +
> +@lisp
> +(operating-system
> +  ;; @dots{}
> +  (initrd-modules (cons "zfs" %base-initrd-modules))
> +  (initrd-extra-module-paths (list (list zfs "module"))))
> +@end lisp

I wonder if we could reuse the =E2=80=98kernel-loadable-modules=E2=80=99 fi=
eld for this
purpose instead of introducing a new field.  We=E2=80=99d need to pass it t=
o the
initrd procedures and have them search in there in addition to the
kernel package, pretty much like this patch already does actually.

WDYT?

Nitpick: the GNU convention is to use =E2=80=9Cpath=E2=80=9D to denote =E2=
=80=9Csearch paths=E2=80=9D,
and other =E2=80=9Cfile=E2=80=9D, =E2=80=9Cfile name=E2=80=9D, or similar. =
 In this case, that=E2=80=99d be
=E2=80=9Ckernel module=E2=80=9D or =E2=80=9CLinux module=E2=80=9D.

Thank you!

Ludo=E2=80=99.




Message sent to guix-patches@HIDDEN:


X-Loop: help-debbugs@HIDDEN
Subject: [bug#55231] [PATCH v1] initrd: Allow extra search paths with =?UTF-8?Q?=E2=80=98initrd-extra-module-paths=E2=80=99?=
Resent-From: Brian Cully <bjc@HIDDEN>
Original-Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
Resent-CC: guix-patches@HIDDEN
Resent-Date: Thu, 02 Jun 2022 21:02:02 +0000
Resent-Message-ID: <handler.55231.B55231.165420370820713 <at> debbugs.gnu.org>
Resent-Sender: help-debbugs@HIDDEN
X-GNU-PR-Message: followup 55231
X-GNU-PR-Package: guix-patches
X-GNU-PR-Keywords: patch
To: Ludovic =?UTF-8?Q?Court=C3=A8s?= <ludo@HIDDEN>
Cc: 55231 <at> debbugs.gnu.org, Brian Cully <bjc@HIDDEN>
Received: via spool by 55231-submit <at> debbugs.gnu.org id=B55231.165420370820713
          (code B ref 55231); Thu, 02 Jun 2022 21:02:02 +0000
Received: (at 55231) by debbugs.gnu.org; 2 Jun 2022 21:01:48 +0000
Received: from localhost ([127.0.0.1]:54694 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1nwrwx-0005O1-OA
	for submit <at> debbugs.gnu.org; Thu, 02 Jun 2022 17:01:47 -0400
Received: from coleridge.kublai.com ([166.84.7.167]:53889 helo=mail.spork.org)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <bjc@HIDDEN>) id 1nwrww-0005Nt-6F
 for 55231 <at> debbugs.gnu.org; Thu, 02 Jun 2022 17:01:46 -0400
Received: from ditto (ool-18b8e9e7.dyn.optonline.net [24.184.233.231])
 by mail.spork.org (Postfix) with ESMTPSA id B6F9F8A3D;
 Thu,  2 Jun 2022 17:01:45 -0400 (EDT)
DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=spork.org; s=dkim;
 t=1654203705; bh=G8bKO2ASmDtPbUgOW5zLtjWZqrpAcqYfsJe89vmDIKw=;
 h=References:From:To:Cc:Subject:Date:In-reply-to;
 b=E0/mJKF6Omgj5wsi7IpIU9g9bsnmprvxOpFVQebbVN0j6WYfQgkcsP3jJN+NJYWWn
 Jz1ocImneBgb5jqDf6Aqh4PV6YWHSpJhtCFYl4o795DwOg+DUOqlLhZ/8YiDMWzF8u
 uSLHjTtkahE6H0Eq23fmK9mlMZe6VXrcTAlcPWB0=
References: <87wnf3pv87.fsf@HIDDEN>
 <2053c4ab42dfe2719cfc377934ac2fb9bcb500a9.1653160364.git.bjc@HIDDEN>
 <87ilpkwf8x.fsf_-_@HIDDEN>
User-agent: mu4e 1.6.10; emacs 28.1
From: Brian Cully <bjc@HIDDEN>
Date: Thu, 02 Jun 2022 16:40:36 -0400
In-reply-to: <87ilpkwf8x.fsf_-_@HIDDEN>
Message-ID: <87a6aug4p2.fsf@HIDDEN>
MIME-Version: 1.0
Content-Type: text/plain; charset=utf-8; format=flowed
Content-Transfer-Encoding: quoted-printable
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 (-)


Ludovic Court=C3=A8s <ludo@HIDDEN> writes:

> I wonder if we could reuse the =E2=80=98kernel-loadable-modules=E2=80=99 =
field=20
> for this
> purpose instead of introducing a new field.  We=E2=80=99d need to pass=20
> it to the
> initrd procedures and have them search in there in addition to=20
> the
> kernel package, pretty much like this patch already does=20
> actually.

This sounds like it could be made to work as you suggest. My=20
feeling is that the two contexts are slightly different, though,=20
as the Linux modules are a superset of the initrd modules, so I=E2=80=99d=20
prefer not to mix them as it might be confusing to people who are=20
used to other Linux distros where the initrd modules are called=20
out separately. I admit I=E2=80=99m probably being silly here, and don=E2=
=80=99t=20
have any serious objection in principle.

> Nitpick: the GNU convention is to use =E2=80=9Cpath=E2=80=9D to denote =
=E2=80=9Csearch=20
> paths=E2=80=9D,
> and other =E2=80=9Cfile=E2=80=9D, =E2=80=9Cfile name=E2=80=9D, or similar=
.  In this case, that=E2=80=99d=20
> be
> =E2=80=9Ckernel module=E2=80=9D or =E2=80=9CLinux module=E2=80=9D.

I struggled with this a fair amount, actually. What these=20
file-likes actually represent is an element of a search path, even=20
if they come in the odd form of a file-like object, which is why I=20
used =E2=80=98path=E2=80=99. =E2=80=98file=E2=80=99 seems wrong, as it impl=
ies (to me) that it=E2=80=99s=20
the =E2=80=98initrd-extra-module-files=E2=80=99 option itself that would in=
clude=20
the module, rather than the =E2=80=98initrd-modules=E2=80=99 option.

Of course, all this goes away if we just reuse=20
=E2=80=98kernel-loadable-modules=E2=80=99 as an additional input, rather th=
an=20
adding another option, so that=E2=80=99s a distinct mark in favor of doing=
=20
that.

When I get some time (hopefully soon!) I=E2=80=99ll try to thread=20
=E2=80=98kernel-loadable-modules=E2=80=99 through instead and see how far I=
 can=20
get with that approach. Do you think the documentation for it will=20
need to be updated to specify that it=E2=80=99s also used as a search path=
=20
for initrd building? Or maybe the better option is to update the=20
documentation for =E2=80=98initrd-modules=E2=80=99 to say that it uses=20
=E2=80=98kernel-loadable-modules=E2=80=99 as input?

-bjc




Message sent to guix-patches@HIDDEN:


X-Loop: help-debbugs@HIDDEN
Subject: [bug#55231] [PATCH v1] initrd: Allow extra search paths with =?UTF-8?Q?=E2=80=98initrd-extra-module-paths=E2=80=99?=
References: <87wnf3pv87.fsf@HIDDEN>
In-Reply-To: <87wnf3pv87.fsf@HIDDEN>
Resent-From: Kaelyn <kaelyn.alexi@HIDDEN>
Original-Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
Resent-CC: guix-patches@HIDDEN
Resent-Date: Thu, 02 Jun 2022 21:25:01 +0000
Resent-Message-ID: <handler.55231.B55231.165420505322974 <at> debbugs.gnu.org>
Resent-Sender: help-debbugs@HIDDEN
X-GNU-PR-Message: followup 55231
X-GNU-PR-Package: guix-patches
X-GNU-PR-Keywords: patch
To: "55231 <at> debbugs.gnu.org" <55231 <at> debbugs.gnu.org>
Reply-To: Kaelyn <kaelyn.alexi@HIDDEN>
Received: via spool by 55231-submit <at> debbugs.gnu.org id=B55231.165420505322974
          (code B ref 55231); Thu, 02 Jun 2022 21:25:01 +0000
Received: (at 55231) by debbugs.gnu.org; 2 Jun 2022 21:24:13 +0000
Received: from localhost ([127.0.0.1]:54716 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1nwsIf-0005yU-Jf
	for submit <at> debbugs.gnu.org; Thu, 02 Jun 2022 17:24:13 -0400
Received: from mail-4319.protonmail.ch ([185.70.43.19]:21105)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <kaelyn.alexi@HIDDEN>) id 1nwsIc-0005yD-Qs
 for 55231 <at> debbugs.gnu.org; Thu, 02 Jun 2022 17:24:13 -0400
Date: Thu, 02 Jun 2022 21:23:56 +0000
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=protonmail.com;
 s=protonmail3; t=1654205044; x=1654464244;
 bh=g3CE23lz0ZLNTm1gf8g8ldokSQK9Vy/Gt6dvJVn/zmI=;
 h=Date:To:From:Reply-To:Subject:Message-ID:Feedback-ID:From:To:Cc:
 Date:Subject:Reply-To:Feedback-ID:Message-ID;
 b=FJhof82YeBm6bICyY4q+SafPHRnAgy+8Z7CBSU4GAuI82EfEGAbZMYdYRXZrRIJfp
 AalKGSFQ7lRrujTQwazanEAluZ9951nWs+V8QtqYO9KV1G2LFWiYFvsHt/GGEtsLz4
 vfFp3EMgOSOgy500UbHkpgO2P5NbjyUceT2EyBuAnuiR5FnZnbDp8oHiDcuZBwdQ8A
 E13U1ZIWIZb0pdC4DtYF+7teF9TFXkllQN9+4ZDB4YN+1nsgB3hXedMy69WTAIOW/k
 BA66YL1iNGjE323x2qYYxKsI7dy+wkB5BuNe9gFIBurtxOi3RnJ9vo+dw2tgipPcTW
 0DwWLF+WeyEaQ==
From: Kaelyn <kaelyn.alexi@HIDDEN>
Message-ID: <jMhPvkR0keO7tVdAcEW2mIuI_3iopqkDVl73kagJHUdr7sa5CdxbqMwQ2j2CqDQymRUDaSXCPO_8CIv0qSDhOyD37Nc5rsnRyrNUBrVgQM4=@protonmail.com>
Feedback-ID: 34709329:user:proton
MIME-Version: 1.0
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: quoted-printable
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 (-)

Hi,

My $0.02 on 'initrd-extra-module-paths' vs 'kernel-loadable-modules': if th=
e initrd code is smart enough to not include the entire packages and only i=
ncludes the requested modules from the packages (which I think is already t=
rue based on behavior observed some time ago), then not having to duplicate=
 the list would be preferable.

I found this issue in the tracker after being surprised that the initrd bui=
lder ignored 'kernel-loadable-modules' with 'initrd-modules' only working f=
or modules that are included in the primary linux kernel package. That surp=
rise over the incompatibility between 'initrd-modules' and 'kernel-loadable=
-modules' is also why I've been relatively vocal about the patch. ;)

Cheers,
Kaelyn




Message sent to guix-patches@HIDDEN:


X-Loop: help-debbugs@HIDDEN
Subject: [bug#55231] [PATCH v1] initrd: Allow extra search paths with =?UTF-8?Q?=E2=80=98initrd-extra-module-paths=E2=80=99?=
Resent-From: Ludovic =?UTF-8?Q?Court=C3=A8s?= <ludo@HIDDEN>
Original-Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
Resent-CC: guix-patches@HIDDEN
Resent-Date: Fri, 03 Jun 2022 07:28:02 +0000
Resent-Message-ID: <handler.55231.B55231.165424125923851 <at> debbugs.gnu.org>
Resent-Sender: help-debbugs@HIDDEN
X-GNU-PR-Message: followup 55231
X-GNU-PR-Package: guix-patches
X-GNU-PR-Keywords: patch
To: Brian Cully <bjc@HIDDEN>
Cc: 55231 <at> debbugs.gnu.org, Brian Cully <bjc@HIDDEN>
Received: via spool by 55231-submit <at> debbugs.gnu.org id=B55231.165424125923851
          (code B ref 55231); Fri, 03 Jun 2022 07:28:02 +0000
Received: (at 55231) by debbugs.gnu.org; 3 Jun 2022 07:27:39 +0000
Received: from localhost ([127.0.0.1]:55156 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1nx1ic-0006Cd-OJ
	for submit <at> debbugs.gnu.org; Fri, 03 Jun 2022 03:27:39 -0400
Received: from eggs.gnu.org ([209.51.188.92]:54902)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <ludo@HIDDEN>) id 1nx1iY-0006CO-Fh
 for 55231 <at> debbugs.gnu.org; Fri, 03 Jun 2022 03:27:37 -0400
Received: from fencepost.gnu.org ([2001:470:142:3::e]:49002)
 by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.90_1) (envelope-from <ludo@HIDDEN>)
 id 1nx1iS-0002uN-62; Fri, 03 Jun 2022 03:27:28 -0400
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org;
 s=fencepost-gnu-org; h=MIME-Version:In-Reply-To:Date:References:Subject:To:
 From; bh=5GVo50Y8XZz3ZFdJF0muJvvyOJ+9nPClm1VG8Dn+77k=; b=pxjStEcGZSAbdQgJT8ut
 F/JNonKiQrencOseKfOJioWkaj5rK5zgaWJJLFs62GqxnWJLgSFFk9YjofaePOdc3Nz4VdRik15sB
 yGo2ZTQ55+cQwnxBE/4uHyQKfGa5vv1FQhzaHPGrAF+Ho+q6ObxRgbCGOPXhVdS6FbH9Uvyx5VSQc
 WgS9PbDkGOr3+h5ZjHbAfeFgFP39KxPwKqWrMAo7adENULVTJeP1nCByxlJecrG5CVc70qkG5efQH
 jHqAjte1XgLfMoj8fB/gA7tV3v2wZLx99+c6Jlb6xQlARA+2Dd3igMgNsWMRhBLz62gjNe5lJvF4+
 6mCrsQ35fhj8BA==;
Received: from [193.50.110.183] (port=50992 helo=ribbon)
 by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.90_1) (envelope-from <ludo@HIDDEN>)
 id 1nx1iH-0006vL-VI; Fri, 03 Jun 2022 03:27:23 -0400
From: Ludovic =?UTF-8?Q?Court=C3=A8s?= <ludo@HIDDEN>
References: <87wnf3pv87.fsf@HIDDEN>
 <2053c4ab42dfe2719cfc377934ac2fb9bcb500a9.1653160364.git.bjc@HIDDEN>
 <87ilpkwf8x.fsf_-_@HIDDEN> <87a6aug4p2.fsf@HIDDEN>
X-URL: http://www.fdn.fr/~lcourtes/
X-Revolutionary-Date: Quintidi 15 Prairial an 230 de la =?UTF-8?Q?R=C3=A9volution,?= jour de la Caille
X-PGP-Key-ID: 0x090B11993D9AEBB5
X-PGP-Key: http://www.fdn.fr/~lcourtes/ludovic.asc
X-PGP-Fingerprint: 3CE4 6455 8A84 FDC6 9DB4  0CFB 090B 1199 3D9A EBB5
X-OS: x86_64-pc-linux-gnu
Date: Fri, 03 Jun 2022 09:27:14 +0200
In-Reply-To: <87a6aug4p2.fsf@HIDDEN> (Brian Cully's message of
 "Thu, 02 Jun 2022 16:40:36 -0400")
Message-ID: <87fskmky0d.fsf@HIDDEN>
User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.1 (gnu/linux)
MIME-Version: 1.0
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: quoted-printable
X-Spam-Score: -2.3 (--)
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: -3.3 (---)

Hi,

Brian Cully <bjc@HIDDEN> skribis:

> Ludovic Court=C3=A8s <ludo@HIDDEN> writes:
>
>> I wonder if we could reuse the =E2=80=98kernel-loadable-modules=E2=80=99=
 field for
>> this
>> purpose instead of introducing a new field.  We=E2=80=99d need to pass i=
t to
>> the
>> initrd procedures and have them search in there in addition to the
>> kernel package, pretty much like this patch already does actually.
>
> This sounds like it could be made to work as you suggest. My feeling
> is that the two contexts are slightly different, though, as the Linux
> modules are a superset of the initrd modules,

Right.  Here, we want the initrd machinery to search for modules in any
place where they can be found, which is either =E2=80=98kernel=E2=80=99 or
=E2=80=98kernel-loadable-modules=E2=80=99.

One could define =E2=80=98initrd-extra-module-paths=E2=80=99 to be differen=
t from
=E2=80=98kernel-loadable-modules=E2=80=99, for example if you can be sure t=
he module
will be loaded from the initrd and not after, but in general both are
likely to have the same value, no?

>> Nitpick: the GNU convention is to use =E2=80=9Cpath=E2=80=9D to denote =
=E2=80=9Csearch
>> paths=E2=80=9D,
>> and other =E2=80=9Cfile=E2=80=9D, =E2=80=9Cfile name=E2=80=9D, or simila=
r.  In this case, that=E2=80=99d be
>> =E2=80=9Ckernel module=E2=80=9D or =E2=80=9CLinux module=E2=80=9D.
>
> I struggled with this a fair amount, actually. What these file-likes
> actually represent is an element of a search path, even if they come
> in the odd form of a file-like object, which is why I used
> =E2=80=98path=E2=80=99. =E2=80=98file=E2=80=99 seems wrong, as it implies=
 (to me) that it=E2=80=99s the
> =E2=80=98initrd-extra-module-files=E2=80=99 option itself that would incl=
ude the
> module, rather than the =E2=80=98initrd-modules=E2=80=99 option.

Hmm right, you have a point!  :-)

> When I get some time (hopefully soon!) I=E2=80=99ll try to thread
> =E2=80=98kernel-loadable-modules=E2=80=99 through instead and see how far=
 I can get
> with that approach. Do you think the documentation for it will need to
> be updated to specify that it=E2=80=99s also used as a search path for in=
itrd
> building? Or maybe the better option is to update the documentation
> for =E2=80=98initrd-modules=E2=80=99 to say that it uses =E2=80=98kernel-=
loadable-modules=E2=80=99 as
> input?

I think you should update the documentation in the commit that changes
things, so that the patch is self-contained.

It may be enough to state in the documentation of the =E2=80=98initrd-modul=
es=E2=80=99
field that its value is a list of module names that are searched for in
=E2=80=98kernel=E2=80=99 and =E2=80=98kernel-loadable-modules=E2=80=99.

WDYT?

Thanks,
Ludo=E2=80=99.




Message sent to guix-patches@HIDDEN:


X-Loop: help-debbugs@HIDDEN
Subject: [bug#55231] [PATCH v2 1/2] Allows copying of out-of-tree modules to the Linux initrd.
References: <87wnf3pv87.fsf@HIDDEN>
In-Reply-To: <87wnf3pv87.fsf@HIDDEN>
Resent-From: Brian Cully <bjc@HIDDEN>
Original-Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
Resent-CC: guix-patches@HIDDEN
Resent-Date: Fri, 17 Jun 2022 01:55:02 +0000
Resent-Message-ID: <handler.55231.B55231.165543087219655 <at> debbugs.gnu.org>
Resent-Sender: help-debbugs@HIDDEN
X-GNU-PR-Message: followup 55231
X-GNU-PR-Package: guix-patches
X-GNU-PR-Keywords: patch
To: 55231 <at> debbugs.gnu.org
Cc: Brian Cully <bjc@HIDDEN>
Received: via spool by 55231-submit <at> debbugs.gnu.org id=B55231.165543087219655
          (code B ref 55231); Fri, 17 Jun 2022 01:55:02 +0000
Received: (at 55231) by debbugs.gnu.org; 17 Jun 2022 01:54:32 +0000
Received: from localhost ([127.0.0.1]:43413 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1o21Bv-00056x-MQ
	for submit <at> debbugs.gnu.org; Thu, 16 Jun 2022 21:54:32 -0400
Received: from coleridge.kublai.com ([166.84.7.167]:61636 helo=mail.spork.org)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <bjc@HIDDEN>) id 1o21Bt-00056o-E6
 for 55231 <at> debbugs.gnu.org; Thu, 16 Jun 2022 21:54:30 -0400
Received: from psyduck.jhoto.kublai.com (ool-18b8e9e7.dyn.optonline.net
 [24.184.233.231])
 by mail.spork.org (Postfix) with ESMTPSA id D30182ED5;
 Thu, 16 Jun 2022 21:54:28 -0400 (EDT)
DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=spork.org; s=dkim;
 t=1655430868; bh=bAGDRFoQXaijSpIrQ2E9pmzYBZAM01wSer3hcq0o/dU=;
 h=From:To:Cc:Subject:Date;
 b=oP8YnXBFILby+6wwOxtQhnW3mc5I/ERWxkt430P10UoHLzJhrTe2iE7gGD7/0CI8J
 nzDLCfF9p4wjZaq/pl/6gZDLXy9WeRlU1mNAnEO0gloHLkkWzYQi9w22Omon6jDAJ3
 rRIUovAqV73x1fKmtKd9VtS91AXDIfxHI8wOOaFA=
From: Brian Cully <bjc@HIDDEN>
Date: Thu, 16 Jun 2022 21:51:59 -0400
Message-Id: <88d91cf303fd82c3667149ee8a647527f44bf571.1655430718.git.bjc@HIDDEN>
X-Mailer: git-send-email 2.36.1
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
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 (-)

With this patch, modules for ‘initrd-modules’ will not only be searched for in
the in-tree Linux modules, but also any additional modules specified in
‘kernel-loadable-modules’.

* gnu/build/linux-modules.scm (find-module-file): change DIRECTORY argument to
DIRECTORIES. Now takes a list of directories to search, rather than a single
one.
* gnu/system/linux-initrd.scm (flat-linux-module-directory): change LINUX
argument to PACKAGES. Now contains a list of file-likes to search for modules.
(raw-initrd): Add LINUX-EXTRA-MODULE-PATHS keyword argument. Pass it
to (flat-linux-extra-module-paths) along with the selected LINUX package.
(base-initrd): Add LINUX-EXTRA-MODULE-PATHS keyword argument. Pass it
to (raw-initrd).
* gnu/system.scm (operating-system-initrd-file): pass in operating system
definition's kernel-loadable-modules into (make-initrd) as
LINUX-EXTRA-MODULE-PATHS.
---

I've removed the new operating-system slot in preference to re-using
kernel-loadable-modules, as discussed.

I did leave the old argument names for the lower level routines in place,
as I feel that they more accurately represent how the data are being
used.

I've also pulled out the documentation. Once this patch set is beaten
into acceptability, the documentation can be adjusted if that's deemed
necessary.

 gnu/build/linux-modules.scm | 19 ++++++++------
 gnu/system.scm              |  2 ++
 gnu/system/linux-initrd.scm | 52 +++++++++++++++++++++++++------------
 3 files changed, 48 insertions(+), 25 deletions(-)

diff --git a/gnu/build/linux-modules.scm b/gnu/build/linux-modules.scm
index 053720574b..97b7e429ea 100644
--- a/gnu/build/linux-modules.scm
+++ b/gnu/build/linux-modules.scm
@@ -225,8 +225,8 @@ (define (file-name->module-name file)
 '.ko[.gz|.xz]' and normalizing it."
   (normalize-module-name (strip-extension (basename file))))
 
-(define (find-module-file directory module)
-  "Lookup module NAME under DIRECTORY, and return its absolute file name.
+(define (find-module-file directories module)
+  "Lookup module NAME under DIRECTORIES, and return its absolute file name.
 NAME can be a file name with or without '.ko', or it can be a module name.
 Raise an error if it could not be found.
 
@@ -247,16 +247,19 @@ (define (find-module-file directory module)
                            (else chr)))
                        module))))
 
-  (match (find-files directory
-                     (lambda (file stat)
-                       (member (strip-extension
-                                (basename file)) names)))
+  (match (append-map (lambda (directory)
+                       (find-files directory
+                                   (lambda (file _stat)
+                                     (member (strip-extension
+                                              (basename file))
+                                             names))))
+                       directories)
     ((file)
      file)
     (()
-     (error "kernel module not found" module directory))
+     (error "kernel module not found" module directories))
     ((_ ...)
-     (error "several modules by that name" module directory))))
+     (error "several modules by that name" module directories))))
 
 (define* (recursive-module-dependencies files
                                         #:key (lookup-module dot-ko))
diff --git a/gnu/system.scm b/gnu/system.scm
index ba1b7b5152..6f52377c8d 100644
--- a/gnu/system.scm
+++ b/gnu/system.scm
@@ -1313,6 +1313,8 @@ (define (operating-system-initrd-file os)
                #:linux (operating-system-kernel os)
                #:linux-modules
                (operating-system-initrd-modules os)
+               #:linux-extra-module-paths
+               (operating-system-kernel-loadable-modules os)
                #:mapped-devices mapped-devices
                #:keyboard-layout (operating-system-keyboard-layout os)))
 
diff --git a/gnu/system/linux-initrd.scm b/gnu/system/linux-initrd.scm
index 4c4c78e444..50a182d7d5 100644
--- a/gnu/system/linux-initrd.scm
+++ b/gnu/system/linux-initrd.scm
@@ -119,13 +119,23 @@ (define* (expression->initrd exp
                               `(#:references-graphs (("closure" ,init))))
                "/initrd.cpio.gz"))
 
-(define (flat-linux-module-directory linux modules)
+(define (flat-linux-module-directory packages modules)
   "Return a flat directory containing the Linux kernel modules listed in
-MODULES and taken from LINUX."
+MODULES and taken from PACKAGES."
   (define imported-modules
     (source-module-closure '((gnu build linux-modules)
                              (guix build utils))))
 
+  (define (package+out->input package out)
+    (gexp-input package out))
+
+  (define package-inputs
+    (map (lambda (p)
+           (match p
+             ((p o) (package+out->input p o))
+             (p     (package+out->input p "out"))))
+         packages))
+
   (define build-exp
     (with-imported-modules imported-modules
       (with-extensions (list guile-zlib)
@@ -135,11 +145,12 @@ (define (flat-linux-module-directory linux modules)
                          (srfi srfi-1)
                          (srfi srfi-26))
 
-            (define module-dir
-              (string-append #$linux "/lib/modules"))
+            (define module-dirs
+              (map (cut string-append <> "/lib/modules")
+                   '#$package-inputs))
 
             (define modules
-              (let* ((lookup  (cut find-module-file module-dir <>))
+              (let* ((lookup  (cut find-module-file module-dirs <>))
                      (modules (map lookup '#$modules)))
                 (append modules
                         (recursive-module-dependencies
@@ -172,20 +183,23 @@ (define* (raw-initrd file-systems
                       #:key
                       (linux linux-libre)
                       (linux-modules '())
+                      (linux-extra-module-paths '())
                       (mapped-devices '())
                       (keyboard-layout #f)
                       (helper-packages '())
                       qemu-networking?
                       volatile-root?
                       (on-error 'debug))
-  "Return as a file-like object a raw initrd, with kernel
-modules taken from LINUX.  FILE-SYSTEMS is a list of file-systems to be
-mounted by the initrd, possibly in addition to the root file system specified
-on the kernel command line via 'root'.  LINUX-MODULES is a list of kernel
-modules to be loaded at boot time. MAPPED-DEVICES is a list of device
-mappings to realize before FILE-SYSTEMS are mounted.
-HELPER-PACKAGES is a list of packages to be copied in the initrd. It may include
-e2fsck/static or other packages needed by the initrd to check root partition.
+  "Return as a file-like object a raw initrd, with kernel modules taken from
+LINUX.  FILE-SYSTEMS is a list of file-systems to be mounted by the initrd,
+possibly in addition to the root file system specified on the kernel command
+line via 'root'.  LINUX-MODULES is a list of kernel modules to be loaded at
+boot time. LINUX-EXTRA-MODULE-PATHS is a list of file-like objects which will
+be searched for modules in addition to the linux kernel. MAPPED-DEVICES is a
+list of device mappings to realize before FILE-SYSTEMS are mounted.
+HELPER-PACKAGES is a list of packages to be copied in the initrd. It may
+include e2fsck/static or other packages needed by the initrd to check root
+partition.
 
 When true, KEYBOARD-LAYOUT is a <keyboard-layout> record denoting the desired
 console keyboard layout.  This is done before MAPPED-DEVICES are set up and
@@ -221,7 +235,8 @@ (define* (raw-initrd file-systems
           #~())))
 
   (define kodir
-    (flat-linux-module-directory linux linux-modules))
+    (flat-linux-module-directory (cons linux linux-extra-module-paths)
+                                 linux-modules))
 
   (expression->initrd
    (with-imported-modules (source-module-closure
@@ -366,6 +381,7 @@ (define* (base-initrd file-systems
                       #:key
                       (linux linux-libre)
                       (linux-modules '())
+                      (linux-extra-module-paths '())
                       (mapped-devices '())
                       (keyboard-layout #f)
                       qemu-networking?
@@ -386,9 +402,10 @@ (define* (base-initrd file-systems
 QEMU-NETWORKING? and VOLATILE-ROOT? behaves as in raw-initrd.
 
 The initrd is automatically populated with all the kernel modules necessary
-for FILE-SYSTEMS and for the given options.  Additional kernel
-modules can be listed in LINUX-MODULES.  They will be added to the initrd, and
-loaded at boot time in the order in which they appear."
+for FILE-SYSTEMS and for the given options.  Additional kernel modules can be
+listed in LINUX-MODULES.  Additional search paths for modules can be listed in
+LINUX-EXTRA-MODULE-PATHS.  They will be added to the initrd, and loaded at
+boot time in the order in which they appear."
   (define linux-modules*
     ;; Modules added to the initrd and loaded from the initrd.
     `(,@linux-modules
@@ -408,6 +425,7 @@ (define* (base-initrd file-systems
   (raw-initrd file-systems
               #:linux linux
               #:linux-modules linux-modules*
+              #:linux-extra-module-paths linux-extra-module-paths
               #:mapped-devices mapped-devices
               #:helper-packages helper-packages
               #:keyboard-layout keyboard-layout
-- 
2.36.1





Message sent to guix-patches@HIDDEN:


X-Loop: help-debbugs@HIDDEN
Subject: [bug#55231] [PATCH v1] initrd: Allow extra search paths with =?UTF-8?Q?=E2=80=98initrd-extra-module-paths=E2=80=99?=
Resent-From: Ludovic =?UTF-8?Q?Court=C3=A8s?= <ludo@HIDDEN>
Original-Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
Resent-CC: guix-patches@HIDDEN
Resent-Date: Fri, 17 Jun 2022 20:35:03 +0000
Resent-Message-ID: <handler.55231.B55231.16554981021151 <at> debbugs.gnu.org>
Resent-Sender: help-debbugs@HIDDEN
X-GNU-PR-Message: followup 55231
X-GNU-PR-Package: guix-patches
X-GNU-PR-Keywords: patch
To: Brian Cully <bjc@HIDDEN>
Cc: 55231 <at> debbugs.gnu.org
Received: via spool by 55231-submit <at> debbugs.gnu.org id=B55231.16554981021151
          (code B ref 55231); Fri, 17 Jun 2022 20:35:03 +0000
Received: (at 55231) by debbugs.gnu.org; 17 Jun 2022 20:35:02 +0000
Received: from localhost ([127.0.0.1]:47054 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1o2IgH-0000IU-G4
	for submit <at> debbugs.gnu.org; Fri, 17 Jun 2022 16:35:01 -0400
Received: from eggs.gnu.org ([209.51.188.92]:48356)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <ludo@HIDDEN>) id 1o2IgF-0000IF-DB
 for 55231 <at> debbugs.gnu.org; Fri, 17 Jun 2022 16:35:00 -0400
Received: from fencepost.gnu.org ([2001:470:142:3::e]:44356)
 by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.90_1) (envelope-from <ludo@HIDDEN>)
 id 1o2Ig9-0002K2-TY; Fri, 17 Jun 2022 16:34:53 -0400
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org;
 s=fencepost-gnu-org; h=MIME-Version:In-Reply-To:Date:References:Subject:To:
 From; bh=NJz4haW/cg2WS6PGmNGmiyZmt3u+4ucvnFUqTqPj5y8=; b=VNtUGY0WoT8ELPaoDi8G
 OlaGJDIGcPcf6aADcg52uYmeyR5iK7W5Vz/O2sjlm6CaiduPu/+ZUgxJ9ywyIWXdPsHvtCRvVHfT8
 spEDW7Uai6OmpAv+/D9JNBMsTkxconDnig39MbqONfdSwPdcSDysHLetZ8YNZhJIuZ3lCeGEd3rxV
 dbm+IQH00j1tSxQ8mN2aDpNIeqkW2z2RmU7+yzaYUczolaprk+B2/exBhpPkEA3Svo/a33rjvn2VD
 wzK2g+dx9brsZW0+7f7Nd4lJxTzbTkOGSLLVfTLL/IiWiotLAAVLAkH4SDPzTwyD2g6IMm7Qx3Zg/
 aUV3yIFXqR/yzA==;
Received: from 91-160-117-201.subs.proxad.net ([91.160.117.201]:60076
 helo=ribbon)
 by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.90_1) (envelope-from <ludo@HIDDEN>)
 id 1o2Ig9-0006Iv-GB; Fri, 17 Jun 2022 16:34:53 -0400
From: Ludovic =?UTF-8?Q?Court=C3=A8s?= <ludo@HIDDEN>
References: <87wnf3pv87.fsf@HIDDEN>
 <88d91cf303fd82c3667149ee8a647527f44bf571.1655430718.git.bjc@HIDDEN>
Date: Fri, 17 Jun 2022 22:34:51 +0200
In-Reply-To: <88d91cf303fd82c3667149ee8a647527f44bf571.1655430718.git.bjc@HIDDEN>
 (Brian Cully's message of "Thu, 16 Jun 2022 21:51:59 -0400")
Message-ID: <878rpvdo5w.fsf_-_@HIDDEN>
User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.1 (gnu/linux)
MIME-Version: 1.0
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: quoted-printable
X-Spam-Score: -2.3 (--)
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: -3.3 (---)

Hi Brian,

Brian Cully <bjc@HIDDEN> skribis:

> With this patch, modules for =E2=80=98initrd-modules=E2=80=99 will not on=
ly be searched for in
> the in-tree Linux modules, but also any additional modules specified in
> =E2=80=98kernel-loadable-modules=E2=80=99.
>
> * gnu/build/linux-modules.scm (find-module-file): change DIRECTORY argume=
nt to
> DIRECTORIES. Now takes a list of directories to search, rather than a sin=
gle
> one.
> * gnu/system/linux-initrd.scm (flat-linux-module-directory): change LINUX
> argument to PACKAGES. Now contains a list of file-likes to search for mod=
ules.
> (raw-initrd): Add LINUX-EXTRA-MODULE-PATHS keyword argument. Pass it
> to (flat-linux-extra-module-paths) along with the selected LINUX package.
> (base-initrd): Add LINUX-EXTRA-MODULE-PATHS keyword argument. Pass it
> to (raw-initrd).
> * gnu/system.scm (operating-system-initrd-file): pass in operating system
> definition's kernel-loadable-modules into (make-initrd) as
> LINUX-EXTRA-MODULE-PATHS.
> ---
>
> I've removed the new operating-system slot in preference to re-using
> kernel-loadable-modules, as discussed.
>
> I did leave the old argument names for the lower level routines in place,
> as I feel that they more accurately represent how the data are being
> used.
>
> I've also pulled out the documentation. Once this patch set is beaten
> into acceptability, the documentation can be adjusted if that's deemed
> necessary.

Alright!

It looks great to me.  I have two cosmetic comments:

> +  (define (package+out->input package out)
> +    (gexp-input package out))

I think you can remove this definition and use =E2=80=98gexp-input=E2=80=99=
 directly.

> @@ -172,20 +183,23 @@ (define* (raw-initrd file-systems
>                        #:key
>                        (linux linux-libre)
>                        (linux-modules '())
> +                      (linux-extra-module-paths '())

Nitpick: I=E2=80=99d call it #:linux-extra-module-path (singular, as in =E2=
=80=9Csearch
path=E2=80=9D) or simply #:linux-extra-module-directories.

If you could introduce a couple of lines in doc/guix.texi to explain
where modules are searched for, that=E2=80=99d be perfect.

Thanks for taking the time to prepare this revision!

Ludo=E2=80=99.




Message sent to guix-patches@HIDDEN:


X-Loop: help-debbugs@HIDDEN
Subject: [bug#55231] [PATCH v3 1/2] Allows copying of out-of-tree modules to the Linux initrd.
References: <87wnf3pv87.fsf@HIDDEN>
In-Reply-To: <87wnf3pv87.fsf@HIDDEN>
Resent-From: Brian Cully <bjc@HIDDEN>
Original-Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
Resent-CC: guix-patches@HIDDEN
Resent-Date: Sat, 18 Jun 2022 19:14:02 +0000
Resent-Message-ID: <handler.55231.B55231.16555796003228 <at> debbugs.gnu.org>
Resent-Sender: help-debbugs@HIDDEN
X-GNU-PR-Message: followup 55231
X-GNU-PR-Package: guix-patches
X-GNU-PR-Keywords: patch
To: 55231 <at> debbugs.gnu.org
Cc: Brian Cully <bjc@HIDDEN>
Received: via spool by 55231-submit <at> debbugs.gnu.org id=B55231.16555796003228
          (code B ref 55231); Sat, 18 Jun 2022 19:14:02 +0000
Received: (at 55231) by debbugs.gnu.org; 18 Jun 2022 19:13:20 +0000
Received: from localhost ([127.0.0.1]:50035 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1o2dsl-0000pt-JC
	for submit <at> debbugs.gnu.org; Sat, 18 Jun 2022 15:13:20 -0400
Received: from coleridge.kublai.com ([166.84.7.167]:64925 helo=mail.spork.org)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <bjc@HIDDEN>) id 1o2dsf-0000pi-Ou
 for 55231 <at> debbugs.gnu.org; Sat, 18 Jun 2022 15:13:17 -0400
Received: from psyduck.jhoto.kublai.com (ool-18b8e9e7.dyn.optonline.net
 [24.184.233.231])
 by mail.spork.org (Postfix) with ESMTPSA id 1926633AE;
 Sat, 18 Jun 2022 15:13:10 -0400 (EDT)
DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=spork.org; s=dkim;
 t=1655579593; bh=F1VZwcsd7B/Nola2WyyesUnE8/NzZ9xsRP626NcddsA=;
 h=From:To:Cc:Subject:Date;
 b=mB+v1oDq34ayn7lI1Rqw92Qx+qX98Ajm+R46/xUFDKAHtLZoEfi5KEzfo0Byh43JR
 sLQWjd+x51zBpjbcFthXl9d8Adpn4KveDeZrHznptMywXkgLczu1mUaY7LyKtMbVYm
 Qpdj7TF4qyuX6YGqe/AVGHJ6rZIiuBpu4dYOxGJY=
From: Brian Cully <bjc@HIDDEN>
Date: Sat, 18 Jun 2022 15:11:17 -0400
Message-Id: <10a6842d1a6bde797d82d6b8107660bedce8b956.1655579477.git.bjc@HIDDEN>
X-Mailer: git-send-email 2.36.1
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
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 (-)

With this patch, modules for ‘initrd-modules’ will not only be searched for in
the in-tree Linux modules, but also any additional modules specified in
‘kernel-loadable-modules’.

* gnu/build/linux-modules.scm (find-module-file): change DIRECTORY argument to
DIRECTORIES. Now takes a list of directories to search, rather than a single
one.
* gnu/system/linux-initrd.scm (flat-linux-module-directory): change LINUX
argument to PACKAGES. Now contains a list of file-likes to search for modules.
(raw-initrd): Add LINUX-EXTRA-MODULE-DIRECTORIES keyword argument. Pass it
to (flat-linux-module-directory) along with the selected LINUX package.
(base-initrd): Add LINUX-EXTRA-MODULE-DIRECTORIES keyword argument. Pass it
to (raw-initrd).
* gnu/system.scm (operating-system-initrd-file): pass in operating system
definition's kernel-loadable-modules into (make-initrd) as
LINUX-EXTRA-MODULE-DIRECTORIES.
---

This version removes the redundant (package+out->input) procedure, and
renames ‘linux-extra-module-paths’ to ‘linux-extra-module-directories’.

 gnu/build/linux-modules.scm | 19 ++++++++------
 gnu/system.scm              |  2 ++
 gnu/system/linux-initrd.scm | 49 ++++++++++++++++++++++++-------------
 3 files changed, 45 insertions(+), 25 deletions(-)

diff --git a/gnu/build/linux-modules.scm b/gnu/build/linux-modules.scm
index 053720574b..97b7e429ea 100644
--- a/gnu/build/linux-modules.scm
+++ b/gnu/build/linux-modules.scm
@@ -225,8 +225,8 @@ (define (file-name->module-name file)
 '.ko[.gz|.xz]' and normalizing it."
   (normalize-module-name (strip-extension (basename file))))
 
-(define (find-module-file directory module)
-  "Lookup module NAME under DIRECTORY, and return its absolute file name.
+(define (find-module-file directories module)
+  "Lookup module NAME under DIRECTORIES, and return its absolute file name.
 NAME can be a file name with or without '.ko', or it can be a module name.
 Raise an error if it could not be found.
 
@@ -247,16 +247,19 @@ (define (find-module-file directory module)
                            (else chr)))
                        module))))
 
-  (match (find-files directory
-                     (lambda (file stat)
-                       (member (strip-extension
-                                (basename file)) names)))
+  (match (append-map (lambda (directory)
+                       (find-files directory
+                                   (lambda (file _stat)
+                                     (member (strip-extension
+                                              (basename file))
+                                             names))))
+                       directories)
     ((file)
      file)
     (()
-     (error "kernel module not found" module directory))
+     (error "kernel module not found" module directories))
     ((_ ...)
-     (error "several modules by that name" module directory))))
+     (error "several modules by that name" module directories))))
 
 (define* (recursive-module-dependencies files
                                         #:key (lookup-module dot-ko))
diff --git a/gnu/system.scm b/gnu/system.scm
index ba1b7b5152..2439560671 100644
--- a/gnu/system.scm
+++ b/gnu/system.scm
@@ -1313,6 +1313,8 @@ (define (operating-system-initrd-file os)
                #:linux (operating-system-kernel os)
                #:linux-modules
                (operating-system-initrd-modules os)
+               #:linux-extra-module-directories
+               (operating-system-kernel-loadable-modules os)
                #:mapped-devices mapped-devices
                #:keyboard-layout (operating-system-keyboard-layout os)))
 
diff --git a/gnu/system/linux-initrd.scm b/gnu/system/linux-initrd.scm
index 4c4c78e444..f6e8f75efa 100644
--- a/gnu/system/linux-initrd.scm
+++ b/gnu/system/linux-initrd.scm
@@ -119,13 +119,20 @@ (define* (expression->initrd exp
                               `(#:references-graphs (("closure" ,init))))
                "/initrd.cpio.gz"))
 
-(define (flat-linux-module-directory linux modules)
+(define (flat-linux-module-directory packages modules)
   "Return a flat directory containing the Linux kernel modules listed in
-MODULES and taken from LINUX."
+MODULES and taken from PACKAGES."
   (define imported-modules
     (source-module-closure '((gnu build linux-modules)
                              (guix build utils))))
 
+  (define package-inputs
+    (map (lambda (p)
+           (match p
+             ((p o) (gexp-input p o))
+             (p     (gexp-input p "out"))))
+         packages))
+
   (define build-exp
     (with-imported-modules imported-modules
       (with-extensions (list guile-zlib)
@@ -135,11 +142,12 @@ (define (flat-linux-module-directory linux modules)
                          (srfi srfi-1)
                          (srfi srfi-26))
 
-            (define module-dir
-              (string-append #$linux "/lib/modules"))
+            (define module-dirs
+              (map (cut string-append <> "/lib/modules")
+                   '#$package-inputs))
 
             (define modules
-              (let* ((lookup  (cut find-module-file module-dir <>))
+              (let* ((lookup  (cut find-module-file module-dirs <>))
                      (modules (map lookup '#$modules)))
                 (append modules
                         (recursive-module-dependencies
@@ -172,20 +180,23 @@ (define* (raw-initrd file-systems
                       #:key
                       (linux linux-libre)
                       (linux-modules '())
+                      (linux-extra-module-directories '())
                       (mapped-devices '())
                       (keyboard-layout #f)
                       (helper-packages '())
                       qemu-networking?
                       volatile-root?
                       (on-error 'debug))
-  "Return as a file-like object a raw initrd, with kernel
-modules taken from LINUX.  FILE-SYSTEMS is a list of file-systems to be
-mounted by the initrd, possibly in addition to the root file system specified
-on the kernel command line via 'root'.  LINUX-MODULES is a list of kernel
-modules to be loaded at boot time. MAPPED-DEVICES is a list of device
-mappings to realize before FILE-SYSTEMS are mounted.
-HELPER-PACKAGES is a list of packages to be copied in the initrd. It may include
-e2fsck/static or other packages needed by the initrd to check root partition.
+  "Return as a file-like object a raw initrd, with kernel modules taken from
+LINUX.  FILE-SYSTEMS is a list of file-systems to be mounted by the initrd,
+possibly in addition to the root file system specified on the kernel command
+line via 'root'.  LINUX-MODULES is a list of kernel modules to be loaded at
+boot time. LINUX-EXTRA-MODULE-DIRECTORIES is a list of file-like objects which
+will be searched for modules in addition to the linux kernel. MAPPED-DEVICES
+is a list of device mappings to realize before FILE-SYSTEMS are mounted.
+HELPER-PACKAGES is a list of packages to be copied in the initrd. It may
+include e2fsck/static or other packages needed by the initrd to check root
+partition.
 
 When true, KEYBOARD-LAYOUT is a <keyboard-layout> record denoting the desired
 console keyboard layout.  This is done before MAPPED-DEVICES are set up and
@@ -221,7 +232,8 @@ (define* (raw-initrd file-systems
           #~())))
 
   (define kodir
-    (flat-linux-module-directory linux linux-modules))
+    (flat-linux-module-directory (cons linux linux-extra-module-directories)
+                                 linux-modules))
 
   (expression->initrd
    (with-imported-modules (source-module-closure
@@ -366,6 +378,7 @@ (define* (base-initrd file-systems
                       #:key
                       (linux linux-libre)
                       (linux-modules '())
+                      (linux-extra-module-directories '())
                       (mapped-devices '())
                       (keyboard-layout #f)
                       qemu-networking?
@@ -386,9 +399,10 @@ (define* (base-initrd file-systems
 QEMU-NETWORKING? and VOLATILE-ROOT? behaves as in raw-initrd.
 
 The initrd is automatically populated with all the kernel modules necessary
-for FILE-SYSTEMS and for the given options.  Additional kernel
-modules can be listed in LINUX-MODULES.  They will be added to the initrd, and
-loaded at boot time in the order in which they appear."
+for FILE-SYSTEMS and for the given options.  Additional kernel modules can be
+listed in LINUX-MODULES.  Additional directories for modules can be listed in
+LINUX-EXTRA-MODULE-DIRECTORIES.  They will be added to the initrd, and loaded
+at boot time in the order in which they appear."
   (define linux-modules*
     ;; Modules added to the initrd and loaded from the initrd.
     `(,@linux-modules
@@ -408,6 +422,7 @@ (define* (base-initrd file-systems
   (raw-initrd file-systems
               #:linux linux
               #:linux-modules linux-modules*
+              #:linux-extra-module-directories linux-extra-module-directories
               #:mapped-devices mapped-devices
               #:helper-packages helper-packages
               #:keyboard-layout keyboard-layout
-- 
2.36.1





Message sent to guix-patches@HIDDEN:


X-Loop: help-debbugs@HIDDEN
Subject: [bug#55231] [PATCH v3 2/2] doc: =?UTF-8?Q?=E2=80=98initrd-modules=E2=80=99?= will search =?UTF-8?Q?=E2=80=98kernel-loadable-modules=E2=80=99.?=
Resent-From: Brian Cully <bjc@HIDDEN>
Original-Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
Resent-CC: guix-patches@HIDDEN
Resent-Date: Sat, 18 Jun 2022 19:14:02 +0000
Resent-Message-ID: <handler.55231.B55231.16555796023237 <at> debbugs.gnu.org>
Resent-Sender: help-debbugs@HIDDEN
X-GNU-PR-Message: followup 55231
X-GNU-PR-Package: guix-patches
X-GNU-PR-Keywords: patch
To: 55231 <at> debbugs.gnu.org
Cc: Brian Cully <bjc@HIDDEN>
Received: via spool by 55231-submit <at> debbugs.gnu.org id=B55231.16555796023237
          (code B ref 55231); Sat, 18 Jun 2022 19:14:02 +0000
Received: (at 55231) by debbugs.gnu.org; 18 Jun 2022 19:13:22 +0000
Received: from localhost ([127.0.0.1]:50038 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1o2dso-0000q9-91
	for submit <at> debbugs.gnu.org; Sat, 18 Jun 2022 15:13:22 -0400
Received: from coleridge.kublai.com ([166.84.7.167]:61435 helo=mail.spork.org)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <bjc@HIDDEN>) id 1o2dsl-0000pu-Lr
 for 55231 <at> debbugs.gnu.org; Sat, 18 Jun 2022 15:13:19 -0400
Received: from psyduck.jhoto.kublai.com (ool-18b8e9e7.dyn.optonline.net
 [24.184.233.231])
 by mail.spork.org (Postfix) with ESMTPSA id 7FE673262;
 Sat, 18 Jun 2022 15:13:19 -0400 (EDT)
DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=spork.org; s=dkim;
 t=1655579599; bh=8Hj0+6AubqJc/k/UlmV9m/THDcoZ/oLyzmsaF1PAe8U=;
 h=From:To:Cc:Subject:Date:In-Reply-To:References;
 b=Jfye6PufZCK0phSgQjFpzTxoLjyNRtUtKRUwDj4Pklac924Pe6g0f4gjrbgGe+0gT
 v4oUt9rZMGj/WelXc8hXsOjaOGcQmSxOqu5nIhWbdwIoE66ia9DjZUHELivdIZWWmy
 viJbOjcysqODBBaM2g/YJ9lrepkKltfylPS4L96A=
From: Brian Cully <bjc@HIDDEN>
Date: Sat, 18 Jun 2022 15:11:18 -0400
Message-Id: <65cf1060a7ce60b1b91a25f809af6264abdcfa59.1655579477.git.bjc@HIDDEN>
X-Mailer: git-send-email 2.36.1
In-Reply-To: <10a6842d1a6bde797d82d6b8107660bedce8b956.1655579477.git.bjc@HIDDEN>
References: <10a6842d1a6bde797d82d6b8107660bedce8b956.1655579477.git.bjc@HIDDEN>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
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 (-)

---
 doc/guix.texi | 13 +++++++++++++
 1 file changed, 13 insertions(+)

diff --git a/doc/guix.texi b/doc/guix.texi
index eda0956260..d97909695f 100644
--- a/doc/guix.texi
+++ b/doc/guix.texi
@@ -36461,6 +36461,19 @@ Initial RAM Disk
   (initrd-modules (cons "megaraid_sas" %base-initrd-modules)))
 @end lisp
 
+If a module listed in @code{initrd-modules} is not included in the
+Linux-libre kernel, then the location to it must be added to the
+@code{kernel-loadable-modules} list.  For example, if your root file
+system exists on a ZFS pool, then your configuration might look like the
+following:
+
+@lisp
+(operating-system
+  ;; @dots{}
+  (initrd-modules (cons "zfs" %base-initrd-modules))
+  (kernel-loadable-modules (list (list zfs "module"))))
+@end lisp
+
 @defvr {Scheme Variable} %base-initrd-modules
 This is the list of kernel modules included in the initrd by default.
 @end defvr
-- 
2.36.1





Message sent to guix-patches@HIDDEN:


X-Loop: help-debbugs@HIDDEN
Subject: [bug#55231] [PATCH v3 2/2] doc: =?UTF-8?Q?=E2=80=98initrd-modules=E2=80=99?= will search =?UTF-8?Q?=E2=80=98kernel-loadable-modules=E2=80=99.?=
Resent-From: Maxime Devos <maximedevos@HIDDEN>
Original-Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
Resent-CC: guix-patches@HIDDEN
Resent-Date: Sat, 18 Jun 2022 20:36:02 +0000
Resent-Message-ID: <handler.55231.B55231.165558450211595 <at> debbugs.gnu.org>
Resent-Sender: help-debbugs@HIDDEN
X-GNU-PR-Message: followup 55231
X-GNU-PR-Package: guix-patches
X-GNU-PR-Keywords: patch
To: Brian Cully <bjc@HIDDEN>, 55231 <at> debbugs.gnu.org
Received: via spool by 55231-submit <at> debbugs.gnu.org id=B55231.165558450211595
          (code B ref 55231); Sat, 18 Jun 2022 20:36:02 +0000
Received: (at 55231) by debbugs.gnu.org; 18 Jun 2022 20:35:02 +0000
Received: from localhost ([127.0.0.1]:50242 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1o2f9p-00030u-Ik
	for submit <at> debbugs.gnu.org; Sat, 18 Jun 2022 16:35:01 -0400
Received: from baptiste.telenet-ops.be ([195.130.132.51]:39246)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <maximedevos@HIDDEN>) id 1o2f9n-00030e-SN
 for 55231 <at> debbugs.gnu.org; Sat, 18 Jun 2022 16:35:00 -0400
Received: from [172.20.10.9] ([188.188.170.162])
 by baptiste.telenet-ops.be with bizsmtp
 id kkax270033Waito01kaxHo; Sat, 18 Jun 2022 22:34:58 +0200
Message-ID: <d9e2175bb610845bc2ab662eaff69d439e03f1a1.camel@HIDDEN>
From: Maxime Devos <maximedevos@HIDDEN>
Date: Sat, 18 Jun 2022 22:34:53 +0200
In-Reply-To: <65cf1060a7ce60b1b91a25f809af6264abdcfa59.1655579477.git.bjc@HIDDEN>
References: <10a6842d1a6bde797d82d6b8107660bedce8b956.1655579477.git.bjc@HIDDEN>
 <65cf1060a7ce60b1b91a25f809af6264abdcfa59.1655579477.git.bjc@HIDDEN>
Content-Type: multipart/signed; micalg="pgp-sha512";
 protocol="application/pgp-signature"; boundary="=-uycy88wZ6DjEhcOLR/tY"
User-Agent: Evolution 3.38.3-1 
MIME-Version: 1.0
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=telenet.be; s=r22;
 t=1655584498; bh=OBa65uVvyM4XmpomOsIhPqd+3DKGGtqLcbfTdJ/d2b4=;
 h=Subject:From:To:Date:In-Reply-To:References;
 b=lH8Li3Hwfcy1t52mVuQ9JrvV08dayt3mdAlR4Kc7GdCvBG54+zEN08I2pwHUhAiFj
 6SCV4HfCsSxXPeU5DJlXWCSQfrTzWxUVLp4VjQSCoCS0RnP4EeynQDKYzPPAqdVcT0
 PCjPoFsFde9se9DtbTa27wYBNKeGyxadNBGihC8YDMc2qPRA3jBu/qLWt9edU/2SOh
 DrCvFlGZpXA/Srm5wNG2TU+z8AYKH3jjGyDvg1H8jbmvRJT/RJxvfopAhaL/YMfAiN
 5a2zptAjKhYQOO9RBDV3+mwY0sNn2OxG2zqKkNpIlMAX+mMc0h2KUkjq73b/fTns24
 kA81Smx+Z6FIQ==
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 (-)


--=-uycy88wZ6DjEhcOLR/tY
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable

Brian Cully via Guix-patches via schreef op za 18-06-2022 om 15:11 [-
0400]:
> +If a module listed in @code{initrd-modules} is not included in the
> +Linux-libre kernel, then the location to it must be added to the
> +@code{kernel-loadable-modules} list.=C2=A0 For example, if your root fil=
e
> +system exists on a ZFS pool, then your configuration might look like the
> +following:
> +
> +@lisp
> +(operating-system
> +=C2=A0 ;; @dots{}
> +=C2=A0 (initrd-modules (cons "zfs" %base-initrd-modules))
> +=C2=A0 (kernel-loadable-modules (list (list zfs "module"))))
> +@end lisp

As written previously, this is not a good example, because:

> As-is, I don't think this is a good example, because
> 'expression->initrd' does not set #:substitutable? #false,
> the 'zfs' package has the comment (*)
>=20
>      `(;; The ZFS kernel module should not be downloaded since the
> license
>        ;; terms don't allow for distributing it, only building it
> locally.
>        #:substitutable? #f [...])
>=20
> and IIUC, the code inside expression->initrd copies the kernel module
> into the new store item, so it looks like this accidentally suggest
> people to commit copyvios, and copyvios are currently against the
> law.

and because the defense for not considering the ZFS license to be a
problem consists of the ZFS module not being distributed in binary
form, whereas this suggestion would in some situations cause it to be
distributed in binary form.

Greetings,
Maxime.

--=-uycy88wZ6DjEhcOLR/tY
Content-Type: application/pgp-signature; name="signature.asc"
Content-Description: This is a digitally signed message part
Content-Transfer-Encoding: 7bit

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

iI0EABYKADUWIQTB8z7iDFKP233XAR9J4+4iGRcl7gUCYq427RccbWF4aW1lZGV2
b3NAdGVsZW5ldC5iZQAKCRBJ4+4iGRcl7vuRAP93e+IazsNTgVuVDhMRelp9dHd9
9osZoFuZBA8dInijdAEAscxvbiaqTecbAuzG+bVfZ7Vf5XaiqqzlGlCl7lHS7wM=
=gS+J
-----END PGP SIGNATURE-----

--=-uycy88wZ6DjEhcOLR/tY--





Message sent to guix-patches@HIDDEN:


X-Loop: help-debbugs@HIDDEN
Subject: [bug#55231] [PATCH v3 2/2] doc: =?UTF-8?Q?=E2=80=98initrd-modules=E2=80=99?= will search =?UTF-8?Q?=E2=80=98kernel-loadable-modules=E2=80=99.?=
Resent-From: Brian Cully <bjc@HIDDEN>
Original-Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
Resent-CC: guix-patches@HIDDEN
Resent-Date: Sat, 18 Jun 2022 20:51:02 +0000
Resent-Message-ID: <handler.55231.B55231.165558544613114 <at> debbugs.gnu.org>
Resent-Sender: help-debbugs@HIDDEN
X-GNU-PR-Message: followup 55231
X-GNU-PR-Package: guix-patches
X-GNU-PR-Keywords: patch
To: Maxime Devos <maximedevos@HIDDEN>
Cc: 55231 <at> debbugs.gnu.org
Received: via spool by 55231-submit <at> debbugs.gnu.org id=B55231.165558544613114
          (code B ref 55231); Sat, 18 Jun 2022 20:51:02 +0000
Received: (at 55231) by debbugs.gnu.org; 18 Jun 2022 20:50:46 +0000
Received: from localhost ([127.0.0.1]:50258 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1o2fP4-0003PR-Eh
	for submit <at> debbugs.gnu.org; Sat, 18 Jun 2022 16:50:46 -0400
Received: from coleridge.kublai.com ([166.84.7.167]:51070 helo=mail.spork.org)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <bjc@HIDDEN>) id 1o2fOz-0003PH-Nk
 for 55231 <at> debbugs.gnu.org; Sat, 18 Jun 2022 16:50:45 -0400
Received: from ditto (ool-18b8e9e7.dyn.optonline.net [24.184.233.231])
 by mail.spork.org (Postfix) with ESMTPSA id 62D813333;
 Sat, 18 Jun 2022 16:50:37 -0400 (EDT)
DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=spork.org; s=dkim;
 t=1655585441; bh=QNFsAh5QHIeCLkfGNwF9sFpnzlK/S7ojeFOxSDValR8=;
 h=References:From:To:Cc:Subject:Date:In-reply-to;
 b=tExRmNp+bxHCnXbzK++2rnIYg9+nczqmS4s7OoA3AEn83GFwDIcqWHiqFObFujoCx
 Xn4Yb22yK3ns/511Nl9BEspwtLCkcNbzmf2tszBV1/RwOvqwXICbgU7fMpfmrWmAq8
 Ggb8jBEOZRBcy7jxs+/NK6S+xbsYva8wQlREidaM=
References: <10a6842d1a6bde797d82d6b8107660bedce8b956.1655579477.git.bjc@HIDDEN>
 <65cf1060a7ce60b1b91a25f809af6264abdcfa59.1655579477.git.bjc@HIDDEN>
 <d9e2175bb610845bc2ab662eaff69d439e03f1a1.camel@HIDDEN>
User-agent: mu4e 1.6.11; emacs 28.1
From: Brian Cully <bjc@HIDDEN>
Date: Sat, 18 Jun 2022 16:43:33 -0400
In-reply-to: <d9e2175bb610845bc2ab662eaff69d439e03f1a1.camel@HIDDEN>
Message-ID: <87czf566hu.fsf@HIDDEN>
MIME-Version: 1.0
Content-Type: text/plain; charset=utf-8; format=flowed
Content-Transfer-Encoding: quoted-printable
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 (-)


> and because the defense for not considering the ZFS license to=20
> be a
> problem consists of the ZFS module not being distributed in=20
> binary
> form, whereas this suggestion would in some situations cause it=20
> to be
> distributed in binary form.

If you have another example, I'll put it in instead. I used this=20
one, because I know this one works, and that's all.

That said, I'm not sure how this would cause the module to be=20
distributed as a binary. In order for it to be added to the=20
initrd, it will still need to built using the DKMS mechanism, and=20
thus compiled on (or at least for) the target Guix installation.

If the complaint is that one could generate a USB stick, or some=20
such, with ZFS in the initrd, then yes, that's possible. But=20
that's also possible by using the existing=20
=E2=80=98kernel-loadable-modules=E2=80=99 mechanism to generate an image wi=
th=20
=E2=80=98guix system image=E2=80=99 and distributing that. I don't think it=
's our=20
job to try and prevent such things, since, even if desirable, it's=20
not really feasible.

If the complaint is merely that it's in the documentation, then=20
ok, I'll change it to whatever module you want.

-bjc




Message sent to guix-patches@HIDDEN:


X-Loop: help-debbugs@HIDDEN
Subject: [bug#55231] [PATCH v3 2/2] doc: =?UTF-8?Q?=E2=80=98initrd-modules=E2=80=99?= will search =?UTF-8?Q?=E2=80=98kernel-loadable-modules=E2=80=99.?=
Resent-From: Maxime Devos <maximedevos@HIDDEN>
Original-Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
Resent-CC: guix-patches@HIDDEN
Resent-Date: Sat, 18 Jun 2022 22:36:01 +0000
Resent-Message-ID: <handler.55231.B55231.165559172922720 <at> debbugs.gnu.org>
Resent-Sender: help-debbugs@HIDDEN
X-GNU-PR-Message: followup 55231
X-GNU-PR-Package: guix-patches
X-GNU-PR-Keywords: patch
To: Brian Cully <bjc@HIDDEN>
Cc: 55231 <at> debbugs.gnu.org
Received: via spool by 55231-submit <at> debbugs.gnu.org id=B55231.165559172922720
          (code B ref 55231); Sat, 18 Jun 2022 22:36:01 +0000
Received: (at 55231) by debbugs.gnu.org; 18 Jun 2022 22:35:29 +0000
Received: from localhost ([127.0.0.1]:50335 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1o2h2P-0005uO-Jn
	for submit <at> debbugs.gnu.org; Sat, 18 Jun 2022 18:35:29 -0400
Received: from andre.telenet-ops.be ([195.130.132.53]:50802)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <maximedevos@HIDDEN>) id 1o2h2M-0005uC-Nj
 for 55231 <at> debbugs.gnu.org; Sat, 18 Jun 2022 18:35:28 -0400
Received: from [172.20.10.9] ([188.188.170.162])
 by andre.telenet-ops.be with bizsmtp
 id kmbP2700b3Waito01mbQtC; Sun, 19 Jun 2022 00:35:25 +0200
Message-ID: <45da2e782470b7bc69fd3014a8c9ced154a58e49.camel@HIDDEN>
From: Maxime Devos <maximedevos@HIDDEN>
Date: Sun, 19 Jun 2022 00:34:45 +0200
In-Reply-To: <87czf566hu.fsf@HIDDEN>
References: <10a6842d1a6bde797d82d6b8107660bedce8b956.1655579477.git.bjc@HIDDEN>
 <65cf1060a7ce60b1b91a25f809af6264abdcfa59.1655579477.git.bjc@HIDDEN>
 <d9e2175bb610845bc2ab662eaff69d439e03f1a1.camel@HIDDEN>
 <87czf566hu.fsf@HIDDEN>
Content-Type: multipart/signed; micalg="pgp-sha512";
 protocol="application/pgp-signature"; boundary="=-613Xt+bKSKaDnRq4HQyE"
User-Agent: Evolution 3.38.3-1 
MIME-Version: 1.0
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=telenet.be; s=r22;
 t=1655591725; bh=g9XHJgoIBmuCo5DSp2k7QV0JCUjgIlATtnclPGbfowQ=;
 h=Subject:From:To:Cc:Date:In-Reply-To:References;
 b=jaQZmhZeaGNYGnZ4wHis9w40kMA/j15Z6lxNO3vhyJHQHVZ50Dg86L2m/41ulJ/5L
 shaLy9D93DeKuvVG5AsWXYQ/y4YcFLUQu8zG9ktoy+di8IGug3iokkmU8kwjMIhEl8
 Z4oghgFv1vyB7gtH2ZtmbFPmeLCxoz2NMRZMMytFKMKVrCMm7slYKEuu44GlkkHpbW
 aWnWbupww+asqttdAsDHHXWqzZn1kpqD90cYhKYdD+Ta9BIlyp+yUsOMtlQjr4FhkL
 Rl5UPDWqSCBi1oO6wHGBcKffYBAB7VBa3W6CnYs7D/e78OVzSXyBAMkiIDI8ArEWhS
 PCvXVRvkbdjrw==
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 (-)


--=-613Xt+bKSKaDnRq4HQyE
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable

Brian Cully schreef op za 18-06-2022 om 16:43 [-0400]:
> That said, I'm not sure how this would cause the module to be=20
> distributed as a binary.  [...]

Because #:substitutable? isn't set appropriately in dependents,
substitute servers exist,=C2=A0ZFS can be used on substitute servers and
someone using the substitute server might have a sufficiently similar
system configuration to do substitution of a store item containing a
copy of the ZFS binary.

Greetings,
Maxime.

--=-613Xt+bKSKaDnRq4HQyE
Content-Type: application/pgp-signature; name="signature.asc"
Content-Description: This is a digitally signed message part
Content-Transfer-Encoding: 7bit

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

iI0EABYKADUWIQTB8z7iDFKP233XAR9J4+4iGRcl7gUCYq5TBRccbWF4aW1lZGV2
b3NAdGVsZW5ldC5iZQAKCRBJ4+4iGRcl7hp7AQCihs5fFUXl54bTaZgaSYFETXaw
UNZbSrcVKTEp4xPvpAD/T1Xx/Un/AzQKpEh3zZvofBsPncHBsb9ASaA6PfhkNAw=
=POZ3
-----END PGP SIGNATURE-----

--=-613Xt+bKSKaDnRq4HQyE--





Message sent to guix-patches@HIDDEN:


X-Loop: help-debbugs@HIDDEN
Subject: [bug#55231] [PATCH v3 2/2] doc: =?UTF-8?Q?=E2=80=98initrd-modules=E2=80=99?= will search =?UTF-8?Q?=E2=80=98kernel-loadable-modules=E2=80=99.?=
Resent-From: Brian Cully <bjc@HIDDEN>
Original-Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
Resent-CC: guix-patches@HIDDEN
Resent-Date: Sat, 18 Jun 2022 23:20:01 +0000
Resent-Message-ID: <handler.55231.B55231.165559434226715 <at> debbugs.gnu.org>
Resent-Sender: help-debbugs@HIDDEN
X-GNU-PR-Message: followup 55231
X-GNU-PR-Package: guix-patches
X-GNU-PR-Keywords: patch
To: Maxime Devos <maximedevos@HIDDEN>
Cc: 55231 <at> debbugs.gnu.org
Received: via spool by 55231-submit <at> debbugs.gnu.org id=B55231.165559434226715
          (code B ref 55231); Sat, 18 Jun 2022 23:20:01 +0000
Received: (at 55231) by debbugs.gnu.org; 18 Jun 2022 23:19:02 +0000
Received: from localhost ([127.0.0.1]:50350 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1o2hiX-0006wm-O6
	for submit <at> debbugs.gnu.org; Sat, 18 Jun 2022 19:19:01 -0400
Received: from coleridge.kublai.com ([166.84.7.167]:63516 helo=mail.spork.org)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <bjc@HIDDEN>) id 1o2hiT-0006wO-2Z
 for 55231 <at> debbugs.gnu.org; Sat, 18 Jun 2022 19:19:00 -0400
Received: from ditto (ool-18b8e9e7.dyn.optonline.net [24.184.233.231])
 by mail.spork.org (Postfix) with ESMTPSA id C22503437;
 Sat, 18 Jun 2022 19:18:54 -0400 (EDT)
DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=spork.org; s=dkim;
 t=1655594336; bh=m1vdiC0HdRqzm16r6l/HoXWLR+aDmE2gFGzZ+465G1U=;
 h=References:From:To:Cc:Subject:Date:In-reply-to;
 b=bHreHiC8jmczuLLG8F/5ePuYh3MYz+12+PQfc1hO6Oxc0eWl4FRHbnf2Mz1mlw1P8
 RFk/SNfTRkXPDyUa8ffV7Scw7pvMxB4snyv/Fm2hW4szjJaHPhTj7R+Q+vHPAQDiJK
 wMkr3JgBFVaU/su/jyjOHWYUj7RBJxod+PBR5UM4=
References: <10a6842d1a6bde797d82d6b8107660bedce8b956.1655579477.git.bjc@HIDDEN>
 <65cf1060a7ce60b1b91a25f809af6264abdcfa59.1655579477.git.bjc@HIDDEN>
 <d9e2175bb610845bc2ab662eaff69d439e03f1a1.camel@HIDDEN>
 <87czf566hu.fsf@HIDDEN>
 <45da2e782470b7bc69fd3014a8c9ced154a58e49.camel@HIDDEN>
User-agent: mu4e 1.6.11; emacs 28.1
From: Brian Cully <bjc@HIDDEN>
Date: Sat, 18 Jun 2022 19:11:28 -0400
In-reply-to: <45da2e782470b7bc69fd3014a8c9ced154a58e49.camel@HIDDEN>
Message-ID: <878rpt5zmq.fsf@HIDDEN>
MIME-Version: 1.0
Content-Type: text/plain; charset=utf-8; format=flowed
Content-Transfer-Encoding: quoted-printable
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 (-)


Maxime Devos <maximedevos@HIDDEN> writes:

> Because #:substitutable? isn't set appropriately in dependents,
> substitute servers exist,=C2=A0ZFS can be used on substitute servers=20
> and
> someone using the substitute server might have a sufficiently=20
> similar
> system configuration to do substitution of a store item=20
> containing a
> copy of the ZFS binary.

So, simply using ZFS in =E2=80=98kernel-loadable-modules=E2=80=99 would be =
enough=20
to trigger this misbehavior? That sounds like a pretty serious=20
issue. Would it be possible to have the substitute servers filter=20
on the #:substitutable flag?

This is getting out of scope, though. I don't really want this=20
patch to go in without /some/ documentation regarding how modules=20
get looked up, so if anyone has an alternate module and use-case,=20
I'll just swap it in for the ZFS one.

-bjc




Message sent to guix-patches@HIDDEN:


X-Loop: help-debbugs@HIDDEN
Subject: [bug#55231] [PATCH v3 2/2] doc: =?UTF-8?Q?=E2=80=98initrd-modules=E2=80=99?= will search =?UTF-8?Q?=E2=80=98kernel-loadable-modules=E2=80=99.?=
Resent-From: Maxime Devos <maximedevos@HIDDEN>
Original-Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
Resent-CC: guix-patches@HIDDEN
Resent-Date: Sun, 19 Jun 2022 12:07:01 +0000
Resent-Message-ID: <handler.55231.B55231.165564036221233 <at> debbugs.gnu.org>
Resent-Sender: help-debbugs@HIDDEN
X-GNU-PR-Message: followup 55231
X-GNU-PR-Package: guix-patches
X-GNU-PR-Keywords: patch
To: Brian Cully <bjc@HIDDEN>
Cc: 55231 <at> debbugs.gnu.org
Received: via spool by 55231-submit <at> debbugs.gnu.org id=B55231.165564036221233
          (code B ref 55231); Sun, 19 Jun 2022 12:07:01 +0000
Received: (at 55231) by debbugs.gnu.org; 19 Jun 2022 12:06:02 +0000
Received: from localhost ([127.0.0.1]:50761 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1o2tgo-0005WG-AH
	for submit <at> debbugs.gnu.org; Sun, 19 Jun 2022 08:06:02 -0400
Received: from laurent.telenet-ops.be ([195.130.137.89]:51562)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <maximedevos@HIDDEN>) id 1o2tgm-0005Vz-Db
 for 55231 <at> debbugs.gnu.org; Sun, 19 Jun 2022 08:06:01 -0400
Received: from [172.20.10.9] ([188.189.158.25])
 by laurent.telenet-ops.be with bizsmtp
 id l05y270020Z9yEL0105y8g; Sun, 19 Jun 2022 14:05:59 +0200
Message-ID: <23328359aaef00b461b27e46b5e716655a8ff015.camel@HIDDEN>
From: Maxime Devos <maximedevos@HIDDEN>
Date: Sun, 19 Jun 2022 14:05:50 +0200
In-Reply-To: <878rpt5zmq.fsf@HIDDEN>
References: <10a6842d1a6bde797d82d6b8107660bedce8b956.1655579477.git.bjc@HIDDEN>
 <65cf1060a7ce60b1b91a25f809af6264abdcfa59.1655579477.git.bjc@HIDDEN>
 <d9e2175bb610845bc2ab662eaff69d439e03f1a1.camel@HIDDEN>
 <87czf566hu.fsf@HIDDEN>
 <45da2e782470b7bc69fd3014a8c9ced154a58e49.camel@HIDDEN>
 <878rpt5zmq.fsf@HIDDEN>
Content-Type: multipart/signed; micalg="pgp-sha512";
 protocol="application/pgp-signature"; boundary="=-yJcvYuLTN0IDVCQjZK6E"
User-Agent: Evolution 3.38.3-1 
MIME-Version: 1.0
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=telenet.be; s=r22;
 t=1655640359; bh=DSXcKN5qbZWeRnlRw5Zx6iigLa3vzAV62lC5U0XUUsY=;
 h=Subject:From:To:Cc:Date:In-Reply-To:References;
 b=mSVGzfC3GdPvni9KGSfnI+K3tLrGdxU6nvXMkgPDeaUgokW41RSjfJkYZgIDLD04J
 IQGIAbs6tzCiWIPmNWaAAFh/dPSrbEptK1C9A8ENIKYPKQMZYa/hDs7xtjAKMrRsuJ
 JE0LippUtCznlFN6pTvOXNWGwdIcuMxhuoDc3f5FX5QpVnlGc+86EqD9CH9/Sip2A6
 rKFDJ4vyXt96ej3m9SdHj2TuOyL1JKVbgW3jEyFxtDGSwKl4DAvdHIgXzkoFr6Fp/N
 uvwtdVcgBfAHRlGJOaIROy8+4sW2UL48VMpHmx/I8V0MabA4vCO8EUxr1Vtn7c3Ctz
 IZiezPxlJakeg==
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 (-)


--=-yJcvYuLTN0IDVCQjZK6E
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable

Brian Cully schreef op za 18-06-2022 om 19:11 [-0400]:
> So, simply using ZFS in =E2=80=98kernel-loadable-modules=E2=80=99 would b=
e enough=20
> to trigger this misbehavior? That sounds like a pretty serious=20
> issue. Would it be possible to have the substitute servers filter=20
> on the #:substitutable flag?

That's exactly what the #:substitutable flag is for (IIUC)!
However, the problem is that currently, that flag isn't set for
derivations that make a copy of the ZFS module.  As I wrote previously:

> > and IIUC, the code inside expression->initrd copies the kernel
> > module into the new store item,

> This is getting out of scope, though. I don't really want this=20
> patch to go in without /some/ documentation regarding how modules=20
> get looked up, so if anyone has an alternate module and use-case,=20
> I'll just swap it in for the ZFS one.

I don't have any.

Greetings,
Maxime.

--=-yJcvYuLTN0IDVCQjZK6E
Content-Type: application/pgp-signature; name="signature.asc"
Content-Description: This is a digitally signed message part
Content-Transfer-Encoding: 7bit

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

iI0EABYKADUWIQTB8z7iDFKP233XAR9J4+4iGRcl7gUCYq8RHhccbWF4aW1lZGV2
b3NAdGVsZW5ldC5iZQAKCRBJ4+4iGRcl7ryiAQCxJDyPWK8uOhO8EAe6QkxQ4VVJ
5x6qwjNw/pYnZctswQD/TqLj9GzZ0VfrT1S4sot56loPrdZ0aBiehxkpKBhOBw8=
=a5R3
-----END PGP SIGNATURE-----

--=-yJcvYuLTN0IDVCQjZK6E--





Message sent to guix-patches@HIDDEN:


X-Loop: help-debbugs@HIDDEN
Subject: [bug#55231] [PATCH v1] initrd: Allow extra search paths with =?UTF-8?Q?=E2=80=98initrd-extra-module-paths=E2=80=99?=
References: <87wnf3pv87.fsf@HIDDEN>
In-Reply-To: <87wnf3pv87.fsf@HIDDEN>
Resent-From: Kaelyn <kaelyn.alexi@HIDDEN>
Original-Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
Resent-CC: guix-patches@HIDDEN
Resent-Date: Tue, 21 Jun 2022 12:35:02 +0000
Resent-Message-ID: <handler.55231.B55231.165581487521894 <at> debbugs.gnu.org>
Resent-Sender: help-debbugs@HIDDEN
X-GNU-PR-Message: followup 55231
X-GNU-PR-Package: guix-patches
X-GNU-PR-Keywords: patch
To: "55231 <at> debbugs.gnu.org" <55231 <at> debbugs.gnu.org>
Reply-To: Kaelyn <kaelyn.alexi@HIDDEN>
Received: via spool by 55231-submit <at> debbugs.gnu.org id=B55231.165581487521894
          (code B ref 55231); Tue, 21 Jun 2022 12:35:02 +0000
Received: (at 55231) by debbugs.gnu.org; 21 Jun 2022 12:34:35 +0000
Received: from localhost ([127.0.0.1]:59373 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1o3d5X-0005h4-D9
	for submit <at> debbugs.gnu.org; Tue, 21 Jun 2022 08:34:35 -0400
Received: from mail-4325.protonmail.ch ([185.70.43.25]:58017)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <kaelyn.alexi@HIDDEN>) id 1o3d5V-0005go-Bi
 for 55231 <at> debbugs.gnu.org; Tue, 21 Jun 2022 08:34:34 -0400
Date: Tue, 21 Jun 2022 12:34:19 +0000
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=protonmail.com;
 s=protonmail3; t=1655814866; x=1656074066;
 bh=RcCjdQpzNims8V/52k3pCzRbefUV5GFZ8NW3cZDtH9M=;
 h=Date:To:From:Reply-To:Subject:Message-ID:Feedback-ID:From:To:Cc:
 Date:Subject:Reply-To:Feedback-ID:Message-ID;
 b=NOmTzVtFsQxh9s0XDg2SVPM24AlDkkiNcgPn1NuBpMUYb5kRwoUDTvGKFcbHrpozb
 d+nEcVfY0/YXeUWk2mL9XmUxniG8z9bEWhr12kuJX6N3+zTDRsUpAq9upkvR2qAqGh
 OHH48ByC7Kyox2YeT2lAVd9ew74iUIzLqSd2PHZ7bCYdElfTuKt9+4tCW+8EwCHo02
 TzNdxkVi+c65ourXaalJjIr6adM5UZXd9+gyYY6ZmYrQXyj9uXRSqF9UmFYntuNNAG
 hjdhXv8+l8iEoLSzU1zYuU7uFjAZFhdoU85IxjLgEpGh4aFxWesZBaR+Pjk9dXZHtQ
 Uch7Y5oEoKFXg==
From: Kaelyn <kaelyn.alexi@HIDDEN>
Message-ID: <62rRCnWUAiOvJIODcOCnx0Vw7EUYR3YHxLrkEfMBUHjURBOWn_JfZf76LODMt2W8syVn0hnIaeU4ysQ-kfi5-4X3wyM7oGTnOO4t2JPwRzY=@protonmail.com>
Feedback-ID: 34709329:user:proton
MIME-Version: 1.0
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: quoted-printable
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 (-)




Hi again,

Regarding the documentation example, one (contrived) alternative is:

"""
For example, if you need the driver for a Realtek RTL8821CE wireless networ=
k adapter for mounting the root filesystem over NFS, your configuration mig=
ht include the following:

@lisp
(operating-system
  ;; @dots{}
  (initrd-modules (cons "8821ce" %base-initrd-modules))
  (kernel-loadable-modules (list (list rtl8821ce-linux-module "module"))))
@end lisp
"""

While I don't have the hardware, I did verify the kernel module name by bui=
lding the rtl8821ce-linux-module package.

Cheers,
Kaelyn




Message sent to guix-patches@HIDDEN:


X-Loop: help-debbugs@HIDDEN
Subject: [bug#55231] [PATCH v4 1/2] Allows copying of out-of-tree modules to the Linux initrd.
References: <87wnf3pv87.fsf@HIDDEN>
In-Reply-To: <87wnf3pv87.fsf@HIDDEN>
Resent-From: Brian Cully <bjc@HIDDEN>
Original-Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
Resent-CC: guix-patches@HIDDEN
Resent-Date: Fri, 24 Jun 2022 13:29:02 +0000
Resent-Message-ID: <handler.55231.B55231.165607732320971 <at> debbugs.gnu.org>
Resent-Sender: help-debbugs@HIDDEN
X-GNU-PR-Message: followup 55231
X-GNU-PR-Package: guix-patches
X-GNU-PR-Keywords: patch
To: 55231 <at> debbugs.gnu.org
Cc: Brian Cully <bjc@HIDDEN>
Received: via spool by 55231-submit <at> debbugs.gnu.org id=B55231.165607732320971
          (code B ref 55231); Fri, 24 Jun 2022 13:29:02 +0000
Received: (at 55231) by debbugs.gnu.org; 24 Jun 2022 13:28:43 +0000
Received: from localhost ([127.0.0.1]:41426 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1o4jMY-0005S9-VU
	for submit <at> debbugs.gnu.org; Fri, 24 Jun 2022 09:28:43 -0400
Received: from coleridge.kublai.com ([166.84.7.167]:52185 helo=mail.spork.org)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <bjc@HIDDEN>) id 1o4jMT-0005Rt-PR
 for 55231 <at> debbugs.gnu.org; Fri, 24 Jun 2022 09:28:41 -0400
Received: from psyduck.jhoto.kublai.com (ool-18b8e9e7.dyn.optonline.net
 [24.184.233.231])
 by mail.spork.org (Postfix) with ESMTPSA id 6C6023E10;
 Fri, 24 Jun 2022 09:28:34 -0400 (EDT)
DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=spork.org; s=dkim;
 t=1656077317; bh=3ymhSD1c1tgxvfw5SNMjaMK8QYFGxB1yrY7XpGgiaHs=;
 h=From:To:Cc:Subject:Date;
 b=XolVBZib3Ntq5eeO0x8PDjIX0EtC0Cg4/qqEeoj8nxcWL7VY2gNXpliRrog0Ix4er
 o8mdeQXsqgv6/efnkXSZ/Tu84Cbs3K/+MhHnXbjBodrk3PCaJaUfWIzjBS3XjR/EXC
 NDnQSSEfl8ckdyjczU9+pOTF8lYUNoJbn3QkqqI0=
From: Brian Cully <bjc@HIDDEN>
Date: Fri, 24 Jun 2022 09:28:25 -0400
Message-Id: <10a6842d1a6bde797d82d6b8107660bedce8b956.1656077306.git.bjc@HIDDEN>
X-Mailer: git-send-email 2.36.1
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
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 (-)

With this patch, modules for ‘initrd-modules’ will not only be searched for in
the in-tree Linux modules, but also any additional modules specified in
‘kernel-loadable-modules’.

* gnu/build/linux-modules.scm (find-module-file): change DIRECTORY argument to
DIRECTORIES. Now takes a list of directories to search, rather than a single
one.
* gnu/system/linux-initrd.scm (flat-linux-module-directory): change LINUX
argument to PACKAGES. Now contains a list of file-likes to search for modules.
(raw-initrd): Add LINUX-EXTRA-MODULE-DIRECTORIES keyword argument. Pass it
to (flat-linux-module-directory) along with the selected LINUX package.
(base-initrd): Add LINUX-EXTRA-MODULE-DIRECTORIES keyword argument. Pass it
to (raw-initrd).
* gnu/system.scm (operating-system-initrd-file): pass in operating system
definition's kernel-loadable-modules into (make-initrd) as
LINUX-EXTRA-MODULE-DIRECTORIES.
---
 gnu/build/linux-modules.scm | 19 ++++++++------
 gnu/system.scm              |  2 ++
 gnu/system/linux-initrd.scm | 49 ++++++++++++++++++++++++-------------
 3 files changed, 45 insertions(+), 25 deletions(-)

diff --git a/gnu/build/linux-modules.scm b/gnu/build/linux-modules.scm
index 053720574b..97b7e429ea 100644
--- a/gnu/build/linux-modules.scm
+++ b/gnu/build/linux-modules.scm
@@ -225,8 +225,8 @@ (define (file-name->module-name file)
 '.ko[.gz|.xz]' and normalizing it."
   (normalize-module-name (strip-extension (basename file))))
 
-(define (find-module-file directory module)
-  "Lookup module NAME under DIRECTORY, and return its absolute file name.
+(define (find-module-file directories module)
+  "Lookup module NAME under DIRECTORIES, and return its absolute file name.
 NAME can be a file name with or without '.ko', or it can be a module name.
 Raise an error if it could not be found.
 
@@ -247,16 +247,19 @@ (define (find-module-file directory module)
                            (else chr)))
                        module))))
 
-  (match (find-files directory
-                     (lambda (file stat)
-                       (member (strip-extension
-                                (basename file)) names)))
+  (match (append-map (lambda (directory)
+                       (find-files directory
+                                   (lambda (file _stat)
+                                     (member (strip-extension
+                                              (basename file))
+                                             names))))
+                       directories)
     ((file)
      file)
     (()
-     (error "kernel module not found" module directory))
+     (error "kernel module not found" module directories))
     ((_ ...)
-     (error "several modules by that name" module directory))))
+     (error "several modules by that name" module directories))))
 
 (define* (recursive-module-dependencies files
                                         #:key (lookup-module dot-ko))
diff --git a/gnu/system.scm b/gnu/system.scm
index ba1b7b5152..2439560671 100644
--- a/gnu/system.scm
+++ b/gnu/system.scm
@@ -1313,6 +1313,8 @@ (define (operating-system-initrd-file os)
                #:linux (operating-system-kernel os)
                #:linux-modules
                (operating-system-initrd-modules os)
+               #:linux-extra-module-directories
+               (operating-system-kernel-loadable-modules os)
                #:mapped-devices mapped-devices
                #:keyboard-layout (operating-system-keyboard-layout os)))
 
diff --git a/gnu/system/linux-initrd.scm b/gnu/system/linux-initrd.scm
index 4c4c78e444..f6e8f75efa 100644
--- a/gnu/system/linux-initrd.scm
+++ b/gnu/system/linux-initrd.scm
@@ -119,13 +119,20 @@ (define* (expression->initrd exp
                               `(#:references-graphs (("closure" ,init))))
                "/initrd.cpio.gz"))
 
-(define (flat-linux-module-directory linux modules)
+(define (flat-linux-module-directory packages modules)
   "Return a flat directory containing the Linux kernel modules listed in
-MODULES and taken from LINUX."
+MODULES and taken from PACKAGES."
   (define imported-modules
     (source-module-closure '((gnu build linux-modules)
                              (guix build utils))))
 
+  (define package-inputs
+    (map (lambda (p)
+           (match p
+             ((p o) (gexp-input p o))
+             (p     (gexp-input p "out"))))
+         packages))
+
   (define build-exp
     (with-imported-modules imported-modules
       (with-extensions (list guile-zlib)
@@ -135,11 +142,12 @@ (define (flat-linux-module-directory linux modules)
                          (srfi srfi-1)
                          (srfi srfi-26))
 
-            (define module-dir
-              (string-append #$linux "/lib/modules"))
+            (define module-dirs
+              (map (cut string-append <> "/lib/modules")
+                   '#$package-inputs))
 
             (define modules
-              (let* ((lookup  (cut find-module-file module-dir <>))
+              (let* ((lookup  (cut find-module-file module-dirs <>))
                      (modules (map lookup '#$modules)))
                 (append modules
                         (recursive-module-dependencies
@@ -172,20 +180,23 @@ (define* (raw-initrd file-systems
                       #:key
                       (linux linux-libre)
                       (linux-modules '())
+                      (linux-extra-module-directories '())
                       (mapped-devices '())
                       (keyboard-layout #f)
                       (helper-packages '())
                       qemu-networking?
                       volatile-root?
                       (on-error 'debug))
-  "Return as a file-like object a raw initrd, with kernel
-modules taken from LINUX.  FILE-SYSTEMS is a list of file-systems to be
-mounted by the initrd, possibly in addition to the root file system specified
-on the kernel command line via 'root'.  LINUX-MODULES is a list of kernel
-modules to be loaded at boot time. MAPPED-DEVICES is a list of device
-mappings to realize before FILE-SYSTEMS are mounted.
-HELPER-PACKAGES is a list of packages to be copied in the initrd. It may include
-e2fsck/static or other packages needed by the initrd to check root partition.
+  "Return as a file-like object a raw initrd, with kernel modules taken from
+LINUX.  FILE-SYSTEMS is a list of file-systems to be mounted by the initrd,
+possibly in addition to the root file system specified on the kernel command
+line via 'root'.  LINUX-MODULES is a list of kernel modules to be loaded at
+boot time. LINUX-EXTRA-MODULE-DIRECTORIES is a list of file-like objects which
+will be searched for modules in addition to the linux kernel. MAPPED-DEVICES
+is a list of device mappings to realize before FILE-SYSTEMS are mounted.
+HELPER-PACKAGES is a list of packages to be copied in the initrd. It may
+include e2fsck/static or other packages needed by the initrd to check root
+partition.
 
 When true, KEYBOARD-LAYOUT is a <keyboard-layout> record denoting the desired
 console keyboard layout.  This is done before MAPPED-DEVICES are set up and
@@ -221,7 +232,8 @@ (define* (raw-initrd file-systems
           #~())))
 
   (define kodir
-    (flat-linux-module-directory linux linux-modules))
+    (flat-linux-module-directory (cons linux linux-extra-module-directories)
+                                 linux-modules))
 
   (expression->initrd
    (with-imported-modules (source-module-closure
@@ -366,6 +378,7 @@ (define* (base-initrd file-systems
                       #:key
                       (linux linux-libre)
                       (linux-modules '())
+                      (linux-extra-module-directories '())
                       (mapped-devices '())
                       (keyboard-layout #f)
                       qemu-networking?
@@ -386,9 +399,10 @@ (define* (base-initrd file-systems
 QEMU-NETWORKING? and VOLATILE-ROOT? behaves as in raw-initrd.
 
 The initrd is automatically populated with all the kernel modules necessary
-for FILE-SYSTEMS and for the given options.  Additional kernel
-modules can be listed in LINUX-MODULES.  They will be added to the initrd, and
-loaded at boot time in the order in which they appear."
+for FILE-SYSTEMS and for the given options.  Additional kernel modules can be
+listed in LINUX-MODULES.  Additional directories for modules can be listed in
+LINUX-EXTRA-MODULE-DIRECTORIES.  They will be added to the initrd, and loaded
+at boot time in the order in which they appear."
   (define linux-modules*
     ;; Modules added to the initrd and loaded from the initrd.
     `(,@linux-modules
@@ -408,6 +422,7 @@ (define* (base-initrd file-systems
   (raw-initrd file-systems
               #:linux linux
               #:linux-modules linux-modules*
+              #:linux-extra-module-directories linux-extra-module-directories
               #:mapped-devices mapped-devices
               #:helper-packages helper-packages
               #:keyboard-layout keyboard-layout
-- 
2.36.1





Message sent to guix-patches@HIDDEN:


X-Loop: help-debbugs@HIDDEN
Subject: [bug#55231] [PATCH v4 2/2] doc: =?UTF-8?Q?=E2=80=98initrd-modules=E2=80=99?= will search =?UTF-8?Q?=E2=80=98kernel-loadable-modules=E2=80=99.?=
Resent-From: Brian Cully <bjc@HIDDEN>
Original-Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
Resent-CC: guix-patches@HIDDEN
Resent-Date: Fri, 24 Jun 2022 13:29:02 +0000
Resent-Message-ID: <handler.55231.B55231.165607732820984 <at> debbugs.gnu.org>
Resent-Sender: help-debbugs@HIDDEN
X-GNU-PR-Message: followup 55231
X-GNU-PR-Package: guix-patches
X-GNU-PR-Keywords: patch
To: 55231 <at> debbugs.gnu.org
Cc: Brian Cully <bjc@HIDDEN>
Received: via spool by 55231-submit <at> debbugs.gnu.org id=B55231.165607732820984
          (code B ref 55231); Fri, 24 Jun 2022 13:29:02 +0000
Received: (at 55231) by debbugs.gnu.org; 24 Jun 2022 13:28:48 +0000
Received: from localhost ([127.0.0.1]:41428 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1o4jMd-0005SN-HG
	for submit <at> debbugs.gnu.org; Fri, 24 Jun 2022 09:28:47 -0400
Received: from coleridge.kublai.com ([166.84.7.167]:52568 helo=mail.spork.org)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <bjc@HIDDEN>) id 1o4jMT-0005Ru-QZ
 for 55231 <at> debbugs.gnu.org; Fri, 24 Jun 2022 09:28:42 -0400
Received: from psyduck.jhoto.kublai.com (ool-18b8e9e7.dyn.optonline.net
 [24.184.233.231])
 by mail.spork.org (Postfix) with ESMTPSA id 96EDB3E11;
 Fri, 24 Jun 2022 09:28:37 -0400 (EDT)
DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=spork.org; s=dkim;
 t=1656077317; bh=bOBi/e8drletEjC3kmo7KDSQNKfcz5WkXNnad3E8Glo=;
 h=From:To:Cc:Subject:Date:In-Reply-To:References;
 b=a8PIyleX1B7snw+rMOsCr0kVWzp5F5YuE8edpr5WF9Wb3mBmGW8shT1kW/TSuhGmL
 sMk76pjPMMwJuSuTIvKeXIuzlsZgQnsuhQIHLxQAhb6WLlVJxlpbQF8CSfTOA83RJq
 1TziiQUuLwZE+YGi7niFxTC6xMAoHRKQlW50NCL0=
From: Brian Cully <bjc@HIDDEN>
Date: Fri, 24 Jun 2022 09:28:26 -0400
Message-Id: <decfa9ca4ff55b14673e7b1013ceac4cb3bf9371.1656077306.git.bjc@HIDDEN>
X-Mailer: git-send-email 2.36.1
In-Reply-To: <10a6842d1a6bde797d82d6b8107660bedce8b956.1656077306.git.bjc@HIDDEN>
References: <10a6842d1a6bde797d82d6b8107660bedce8b956.1656077306.git.bjc@HIDDEN>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
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 (-)

---
 doc/guix.texi | 15 +++++++++++++++
 1 file changed, 15 insertions(+)

diff --git a/doc/guix.texi b/doc/guix.texi
index eda0956260..7c4682a76d 100644
--- a/doc/guix.texi
+++ b/doc/guix.texi
@@ -36461,6 +36461,21 @@ Initial RAM Disk
   (initrd-modules (cons "megaraid_sas" %base-initrd-modules)))
 @end lisp
 
+If a module listed in @code{initrd-modules} is not included in the
+Linux-libre kernel, then the location to it must be added to the
+@code{kernel-loadable-modules} list.
+
+For example, if you need the driver for a Realtek RTL8821CE wireless
+network adapter for mounting the root filesystem over NFS, your
+configuration might include the following:
+
+@lisp
+(operating-system
+  ;; @dots{}
+  (initrd-modules (cons "8821ce" %base-initrd-modules))
+  (kernel-loadable-modules (list (list rtl8821ce-linux-module "module"))))
+@end lisp
+
 @defvr {Scheme Variable} %base-initrd-modules
 This is the list of kernel modules included in the initrd by default.
 @end defvr
-- 
2.36.1






Last modified: Fri, 24 Jun 2022 13:30:02 UTC

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