From patchwork Mon May 2 22:53:31 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Brian Cully X-Patchwork-Id: 39088 Return-Path: X-Original-To: patchwork@mira.cbaines.net Delivered-To: patchwork@mira.cbaines.net Received: by mira.cbaines.net (Postfix, from userid 113) id E382E27BBE9; Mon, 2 May 2022 23:56:21 +0100 (BST) X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on mira.cbaines.net X-Spam-Level: X-Spam-Status: No, score=-3.7 required=5.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,MAILING_LIST_MULTI,RCVD_IN_MSPIKE_H2,SPF_HELO_PASS, URIBL_BLOCKED autolearn=unavailable autolearn_force=no version=3.4.6 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mira.cbaines.net (Postfix) with ESMTPS id 5892127BBEA for ; Mon, 2 May 2022 23:56:19 +0100 (BST) Received: from localhost ([::1]:44388 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1nlexm-0004aE-G6 for patchwork@mira.cbaines.net; Mon, 02 May 2022 18:56:18 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:51128) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nlexe-0004Zq-DR for guix-patches@gnu.org; Mon, 02 May 2022 18:56:10 -0400 Received: from debbugs.gnu.org ([209.51.188.43]:44366) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1nlexW-0004uF-Iw for guix-patches@gnu.org; Mon, 02 May 2022 18:56:10 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1nlexW-0002aC-GQ for guix-patches@gnu.org; Mon, 02 May 2022 18:56:02 -0400 X-Loop: help-debbugs@gnu.org 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 Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Mon, 02 May 2022 22:56:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 55231 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: Maxime Devos Cc: 55231@debbugs.gnu.org Received: via spool by 55231-submit@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 ) id 1nlewq-0002ZI-0d for submit@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 ) id 1nlewo-0002ZA-5i for 55231@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@ditto.jhoto.spork.org> User-agent: mu4e 1.6.10; emacs 28.1 Date: Mon, 02 May 2022 18:53:31 -0400 In-reply-to: Message-ID: <87sfprpmt3.fsf@ditto.jhoto.spork.org> MIME-Version: 1.0 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: guix-patches@gnu.org List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-patches-bounces+patchwork=mira.cbaines.net@gnu.org Sender: "Guix-patches" Reply-to: Brian Cully X-ACL-Warn: , Brian Cully via Guix-patches X-Patchwork-Original-From: Brian Cully via Guix-patches via From: Brian Cully X-getmail-retrieved-from-mailbox: Patches Maxime Devos writes: > 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. I knew I missed something. How’s this look? --- doc/guix.texi | 42 ++++++++++++++++++++++++++++++++++-------- 1 file changed, 34 insertions(+), 8 deletions(-) A procedure that returns an initial RAM disk for the Linux kernel. This field is provided to support low-level customization and @@ -35516,6 +35526,19 @@ file system, you would write: (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 @@ -35629,13 +35652,15 @@ here is how to use it and customize it 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] [#: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. @@ -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 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{} record denoting the desired console keyboard layout. This is done before @var{mapped-devices} 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}. +@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})