From patchwork Tue Feb 11 14:56:07 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Morgan Arnold X-Patchwork-Id: 38480 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 64D7327BBEA; Tue, 11 Feb 2025 14:57:25 +0000 (GMT) X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on mira.cbaines.net X-Spam-Level: X-Spam-Status: No, score=-7.4 required=5.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,MAILING_LIST_MULTI,RCVD_IN_DNSWL_BLOCKED,RCVD_IN_MSPIKE_H2, RCVD_IN_VALIDITY_CERTIFIED,RCVD_IN_VALIDITY_RPBL,RCVD_IN_VALIDITY_SAFE, SPF_HELO_PASS,URIBL_BLOCKED autolearn=ham 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 DBE7827BBE2 for ; Tue, 11 Feb 2025 14:57:23 +0000 (GMT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1thrhA-0003jK-Ol; Tue, 11 Feb 2025 09:57:05 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1thrh9-0003j0-85 for guix-patches@gnu.org; Tue, 11 Feb 2025 09:57:03 -0500 Received: from debbugs.gnu.org ([2001:470:142:5::43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1thrh8-0000wt-V2 for guix-patches@gnu.org; Tue, 11 Feb 2025 09:57:02 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=debbugs.gnu.org; s=debbugs-gnu-org; h=MIME-Version:From:Date:To:In-Reply-To:References:Subject; bh=X1H7ZRdf1749Bg+aquscNKYP85xe/HPB/X76dHLQph8=; b=HWg8qt1kbvUOM8dqNgehnvYafPkDkBeusAyxUkqnL/lQxt7BuaEBwrtqLua9/gMzJtnYowrD29uPi4KydRir9EKhPu2jCRJULKDsurSw9rQpv1fJrJGqaUDp09W+3ckcC46SvGlIQ5PJLGTFtt3n9iYmFpFVFrsVgz5A7bb7RN5uB6qFmktVq78pogO4RZB7j1kENwuaEQ+9pnna9GpP3zJGNlJHzpuq1Dbcuhl1pQzQyt76Iw4gG1Se8ptia+3DrAiOo00imjv9QRAJpREH0dbq3zRkx520nSRzIIKCODTivMXTONkUw4u1PfK3xogVS30Ww8uW+iqI52Nuxzp+gQ==; Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1thrh8-0004so-PO for guix-patches@gnu.org; Tue, 11 Feb 2025 09:57:02 -0500 X-Loop: help-debbugs@gnu.org Subject: [bug#55231] [PATCH v5 1/3] Allows copying of out-of-tree modules to the Linux initrd. References: <87wnf3pv87.fsf@ditto.jhoto.spork.org> In-Reply-To: <87wnf3pv87.fsf@ditto.jhoto.spork.org> Resent-From: Morgan Arnold Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Tue, 11 Feb 2025 14:57: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: 55231@debbugs.gnu.org Cc: Brian Cully Received: via spool by 55231-submit@debbugs.gnu.org id=B55231.173928578618274 (code B ref 55231); Tue, 11 Feb 2025 14:57:02 +0000 Received: (at 55231) by debbugs.gnu.org; 11 Feb 2025 14:56:26 +0000 Received: from localhost ([127.0.0.1]:57509 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1thrgY-0004kV-2t for submit@debbugs.gnu.org; Tue, 11 Feb 2025 09:56:26 -0500 Received: from mail-40133.protonmail.ch ([185.70.40.133]:35909) by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1thrgT-0004cx-S8 for 55231@debbugs.gnu.org; Tue, 11 Feb 2025 09:56:23 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=proton.me; s=protonmail; t=1739285773; x=1739544973; bh=X1H7ZRdf1749Bg+aquscNKYP85xe/HPB/X76dHLQph8=; h=Date:To:From:Cc:Subject:Message-ID:Feedback-ID:From:To:Cc:Date: Subject:Reply-To:Feedback-ID:Message-ID:BIMI-Selector: List-Unsubscribe:List-Unsubscribe-Post; b=SjpitOwdkADTNHlSEyNG+AcZwLC0HgXjH+E/0+AdupuwpqToMQK0ZYutYUmyChDju JiKRmY5X9perLNWihHPWUazEOl1WkFH7LC27Jtre+uuNczGeYXUu+zNPwe4dHRqcD6 Qy8EfkK1BiVynGExN3gTGTXgqL7gkF5mCII2s1zQe8W+TV+fAg/xlAoJ0VkyQF0Pot +OstewyRa5q5ZVdnGYmHtk2OF6Dd/wowTVLkMnTzClIowaudq4tcSe9Ui6KIAgjYQ0 m7H1vsvjNioIgAPgegDM7/7EHZ1ekTkU9OZ/OoNZiw1+1/Ld7nSCN07FdGAggBQ14h I3uUcHsHLeK9g== Date: Tue, 11 Feb 2025 14:56:07 +0000 Message-ID: <15e253236ef3ffae9adf9139c274eeb8cfdf9e8e.1739285590.git.morgan.arnold@proton.me> Feedback-ID: 45510636:user:proton X-Pm-Message-ID: f42dc2d3f480c89b0a7bfcd00b5c76d8de5a9186 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: , Reply-to: Morgan Arnold X-ACL-Warn: , Morgan Arnold via Guix-patches X-Patchwork-Original-From: Morgan Arnold via Guix-patches via From: Morgan Arnold Errors-To: guix-patches-bounces+patchwork=mira.cbaines.net@gnu.org Sender: guix-patches-bounces+patchwork=mira.cbaines.net@gnu.org X-getmail-retrieved-from-mailbox: Patches From: Brian Cully 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 | 50 ++++++++++++++++++++++++------------- 3 files changed, 45 insertions(+), 26 deletions(-) base-commit: a8f223f91cf1170c85c0133e12856476e40a8288 diff --git a/gnu/build/linux-modules.scm b/gnu/build/linux-modules.scm index 32baf6c525..b47bce9ab2 100644 --- a/gnu/build/linux-modules.scm +++ b/gnu/build/linux-modules.scm @@ -246,8 +246,8 @@ (define (file-name->module-name file) '.ko[.gz|.xz|.zst]' 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. @@ -268,16 +268,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 8df871f255..1921b60c25 100644 --- a/gnu/system.scm +++ b/gnu/system.scm @@ -1373,6 +1373,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 dc08edc791..dab40dfe22 100644 --- a/gnu/system/linux-initrd.scm +++ b/gnu/system/linux-initrd.scm @@ -120,13 +120,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 guile-zstd) @@ -138,8 +145,9 @@ (define (flat-linux-module-directory linux modules) (srfi srfi-26) (ice-9 match)) - (define module-dir - (string-append #$linux "/lib/modules")) + (define module-dirs + (map (cut string-append <> "/lib/modules") + '#$package-inputs)) (define builtin-modules (match (find-files module-dir (lambda (file stat) @@ -157,7 +165,7 @@ (define (flat-linux-module-directory linux modules) (lset-difference string=? '#$modules builtin-modules)) (define modules - (let* ((lookup (cut find-module-file module-dir <>)) + (let* ((lookup (cut find-module-file module-dirs <>)) (modules (map lookup modules-to-lookup))) (append modules (recursive-module-dependencies @@ -192,6 +200,7 @@ (define* (raw-initrd file-systems #:key (linux linux-libre) (linux-modules '()) + (linux-extra-module-directories '()) (pre-mount #t) (mapped-devices '()) (keyboard-layout #f) @@ -199,15 +208,16 @@ (define* (raw-initrd file-systems 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. PRE-MOUNT is a -G-expression to evaluate before realizing MAPPED-DEVICES. -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 record denoting the desired console keyboard layout. This is done before MAPPED-DEVICES are set up and @@ -243,7 +253,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 @@ -390,6 +401,7 @@ (define* (base-initrd file-systems #:key (linux linux-libre) (linux-modules '()) + (linux-extra-module-directories '()) (mapped-devices '()) (keyboard-layout #f) qemu-networking? @@ -410,9 +422,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 @@ -432,6 +445,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 From patchwork Tue Feb 11 14:56:30 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Morgan Arnold X-Patchwork-Id: 38482 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 8F50227BBEA; Tue, 11 Feb 2025 14:58:17 +0000 (GMT) X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on mira.cbaines.net X-Spam-Level: X-Spam-Status: No, score=-7.4 required=5.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,MAILING_LIST_MULTI,RCVD_IN_DNSWL_BLOCKED,RCVD_IN_MSPIKE_H2, RCVD_IN_VALIDITY_CERTIFIED,RCVD_IN_VALIDITY_RPBL,RCVD_IN_VALIDITY_SAFE, SPF_HELO_PASS,URIBL_BLOCKED autolearn=ham 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 5266927BBE2 for ; Tue, 11 Feb 2025 14:58:17 +0000 (GMT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1thri8-0003tF-H5; Tue, 11 Feb 2025 09:58:04 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1thri6-0003su-Te for guix-patches@gnu.org; Tue, 11 Feb 2025 09:58:02 -0500 Received: from debbugs.gnu.org ([2001:470:142:5::43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1thri6-00017z-Hs for guix-patches@gnu.org; Tue, 11 Feb 2025 09:58:02 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=debbugs.gnu.org; s=debbugs-gnu-org; h=MIME-Version:References:In-Reply-To:From:Date:To:Subject; bh=hH7JD+Lak3rlR+ED7DzAteQSn19TVoCZW3AEyoCtjNA=; b=fr01q2adX46lQ8eSEBKLJY+fsVDJ7zlOX+c5bWswc0Yl//+dAbuTkeU3CwNaoI6/C6eqMiDnYkm++Uy7hzQVx6ElwdP1Ieo+yhcvVzrSL/LPF4RxffHjGEqlF18R7/8I2Yo0ww6mQ7kV1ie9MMigBwblCIRk9MsANtU+hEeyo/QaKYEsYvvSLOul8KCMjPtdCHh0zjXNx1aYO0eiu1EO3ShJd0PZ8nr8XGsCUcq8VD/cCTHDxKg8qV6IgHgqtMY4Ahc0Zk1dynOGrnbwhkO6ehGxd63384r054CIOMxumCEynTextsYuTDZR4i4/dxrGDbGDRfJypnAEDa++iXAHsw==; Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1thri6-0004tw-BF for guix-patches@gnu.org; Tue, 11 Feb 2025 09:58:02 -0500 X-Loop: help-debbugs@gnu.org Subject: [bug#55231] [PATCH v5 2/3] doc: =?utf-8?b?4oCYaW5pdHJkLW1vZHVsZXM=?= =?utf-8?b?4oCZ?= will search =?utf-8?b?4oCYa2VybmVsLWxvYWRhYmxlLW1vZHVsZXM=?= =?utf-8?b?4oCZLg==?= Resent-From: Morgan Arnold Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Tue, 11 Feb 2025 14:58: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: 55231@debbugs.gnu.org Cc: Brian Cully Received: via spool by 55231-submit@debbugs.gnu.org id=B55231.173928582218778 (code B ref 55231); Tue, 11 Feb 2025 14:58:02 +0000 Received: (at 55231) by debbugs.gnu.org; 11 Feb 2025 14:57:02 +0000 Received: from localhost ([127.0.0.1]:57972 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1thrh6-0004sY-LR for submit@debbugs.gnu.org; Tue, 11 Feb 2025 09:57:02 -0500 Received: from mail-4322.protonmail.ch ([185.70.43.22]:16513) by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1thrh3-0004sI-8T for 55231@debbugs.gnu.org; Tue, 11 Feb 2025 09:56:58 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=proton.me; s=protonmail; t=1739285810; x=1739545010; bh=hH7JD+Lak3rlR+ED7DzAteQSn19TVoCZW3AEyoCtjNA=; h=Date:To:From:Cc:Subject:Message-ID:In-Reply-To:References: Feedback-ID:From:To:Cc:Date:Subject:Reply-To:Feedback-ID: Message-ID:BIMI-Selector:List-Unsubscribe:List-Unsubscribe-Post; b=NzCKKhCsn2ZaJr8wx4hMF34URsy+CseoFJK1LspSgM7eJIxag19j6gdu12zvLHM0p 2/CaYuEhS8cO5Nx9KJNqaMWhqB1rBCRU8lrLUw80iqAsv72E9ic+Ays7QMIs2V0hoT x4A/C8CaaXA1NZZ8UlHLxlJXgr3J8rMLv8YDkdm+t8jByi+ui32MQA2tgu4CUm/RZG Owr6Becp61WinF9iSzpoF9fcr2v7kmTufMf+GngSNXKsOMAmN+pbqTRppA153ZwMZN mqTeSZaGcOCUDpkhN9dFfQvRnWWZ/TTF/798yyNdIBPImnWjIuACZGgY77M1e9tkbE 5B4O0mxVEUjMw== Date: Tue, 11 Feb 2025 14:56:30 +0000 Message-ID: In-Reply-To: <15e253236ef3ffae9adf9139c274eeb8cfdf9e8e.1739285590.git.morgan.arnold@proton.me> References: <15e253236ef3ffae9adf9139c274eeb8cfdf9e8e.1739285590.git.morgan.arnold@proton.me> Feedback-ID: 45510636:user:proton X-Pm-Message-ID: 94dd00c7f8f0a9fb1e4e1e89af1a5ae58926c5c7 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: , Reply-to: Morgan Arnold X-ACL-Warn: , Morgan Arnold via Guix-patches X-Patchwork-Original-From: Morgan Arnold via Guix-patches via From: Morgan Arnold Errors-To: guix-patches-bounces+patchwork=mira.cbaines.net@gnu.org Sender: guix-patches-bounces+patchwork=mira.cbaines.net@gnu.org X-getmail-retrieved-from-mailbox: Patches From: Brian Cully --- doc/guix.texi | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/doc/guix.texi b/doc/guix.texi index bb5f29277f..2ca8bbda51 100644 --- a/doc/guix.texi +++ b/doc/guix.texi @@ -43252,6 +43252,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 + @defvar %base-initrd-modules This is the list of kernel modules included in the initrd by default. @end defvar From patchwork Tue Feb 11 14:56:50 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Morgan Arnold X-Patchwork-Id: 38481 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 F1CE927BBE9; Tue, 11 Feb 2025 14:58:13 +0000 (GMT) X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on mira.cbaines.net X-Spam-Level: X-Spam-Status: No, score=-7.4 required=5.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,MAILING_LIST_MULTI,RCVD_IN_DNSWL_BLOCKED,RCVD_IN_MSPIKE_H2, RCVD_IN_VALIDITY_CERTIFIED,RCVD_IN_VALIDITY_RPBL,RCVD_IN_VALIDITY_SAFE, 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 62BEF27BBE2 for ; Tue, 11 Feb 2025 14:58:12 +0000 (GMT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1thriA-0003u4-Uf; Tue, 11 Feb 2025 09:58:07 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1thri7-0003t3-Fd for guix-patches@gnu.org; Tue, 11 Feb 2025 09:58:03 -0500 Received: from debbugs.gnu.org ([2001:470:142:5::43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1thri7-00018E-1M for guix-patches@gnu.org; Tue, 11 Feb 2025 09:58:03 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=debbugs.gnu.org; s=debbugs-gnu-org; h=MIME-Version:References:In-Reply-To:From:Date:To:Subject; bh=wOB4xPWP7UhWkEcTp3UfAuy2ACEP93Y+vKhvQ5Es1LU=; b=pw5ySDjabk4I4PFSQMRF+wv6r7OfEzKB7RNR6ox6SM2QuQpI3HupnfJHakr1TVYCoc1To8F/xCnxe+5fVrxOfFB51YjAeo+rHHUreWa+LiYaSaUunYkfmlpA8UCxz3bf7wxpDLnDUmQt8YetMSu6YDi1l2ezHiS94de+K3YBN2G7BT6vxC08dA1xB2IOREIAka0MFIiGhA5rS+prpFtZF/d3YN1YzbO+BYK9fuY5b7rfBGcGEkbkHJVwFGFXKOoUH5kchh6/uHx+2qAhZCwEFbx0bOWywiPtizGYjWzeh+tg4mtwaPcwtXjRuzC4t9R67IViR25XBXLKsh7Fs2W+gA==; Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1thri6-0004u3-S8 for guix-patches@gnu.org; Tue, 11 Feb 2025 09:58:02 -0500 X-Loop: help-debbugs@gnu.org Subject: [bug#55231] [PATCH v5 3/3] Prevent possible copyright violations caused by initrd changes. Resent-From: Morgan Arnold Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Tue, 11 Feb 2025 14:58: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: 55231@debbugs.gnu.org Cc: Morgan Arnold Received: via spool by 55231-submit@debbugs.gnu.org id=B55231.173928582418800 (code B ref 55231); Tue, 11 Feb 2025 14:58:02 +0000 Received: (at 55231) by debbugs.gnu.org; 11 Feb 2025 14:57:04 +0000 Received: from localhost ([127.0.0.1]:57975 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1thrh9-0004tA-SW for submit@debbugs.gnu.org; Tue, 11 Feb 2025 09:57:04 -0500 Received: from mail-40134.protonmail.ch ([185.70.40.134]:12963) by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1thrh5-0004sL-UZ for 55231@debbugs.gnu.org; Tue, 11 Feb 2025 09:57:00 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=proton.me; s=h4hlmtzubvcl3mfwa4tcicao5e.protonmail; t=1739285813; x=1739545013; bh=wOB4xPWP7UhWkEcTp3UfAuy2ACEP93Y+vKhvQ5Es1LU=; h=Date:To:From:Cc:Subject:Message-ID:In-Reply-To:References: Feedback-ID:From:To:Cc:Date:Subject:Reply-To:Feedback-ID: Message-ID:BIMI-Selector:List-Unsubscribe:List-Unsubscribe-Post; b=jGr8P1hm/xbVzQw4HQaaOO4irgGXj9LxfkRTcICrcmphWlW9mwtFFYBoAtWUdqDRd /CbMGVbHqmtFV7VRk1VwTqEfVzvw6aPz64FN1XnFYSgXOcHs2BvbPxfgG5OCXqn9v/ Ltfut87b8rZpdnlwVm10reg/3XnO0qnoa8S51++k6g0CYe/Ftk8TS+j9oFO84SDt7D a8XHbmDtxDJqcYYoxLpkcv4zEmGY0GlDWGe2Fc7YkH2Lr/uBgu5NaK/VyETAzYTod+ uur+++e7EzOgmyBF0D+GbGpzfVKuuP+ebnAgUjj5QTv23OG97Q8n8XlPcBD6x8RciE Raie6S0mJJuEg== Date: Tue, 11 Feb 2025 14:56:50 +0000 Message-ID: <7658251299b5b223bb35ab6e23aa74c8e15c5a08.1739285590.git.morgan.arnold@proton.me> In-Reply-To: <15e253236ef3ffae9adf9139c274eeb8cfdf9e8e.1739285590.git.morgan.arnold@proton.me> References: <15e253236ef3ffae9adf9139c274eeb8cfdf9e8e.1739285590.git.morgan.arnold@proton.me> Feedback-ID: 45510636:user:proton X-Pm-Message-ID: 21e79b7fedd74b3cf78ffc6d6cff9e04525c627d 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: , Reply-to: Morgan Arnold X-ACL-Warn: , Morgan Arnold via Guix-patches X-Patchwork-Original-From: Morgan Arnold via Guix-patches via From: Morgan Arnold Errors-To: guix-patches-bounces+patchwork=mira.cbaines.net@gnu.org Sender: guix-patches-bounces+patchwork=mira.cbaines.net@gnu.org X-getmail-retrieved-from-mailbox: Patches This commit changes the conditions under which derivations, as constructed by the `derivation` function, are made substitutable, to prevent potential copyright violations related to the construction of substitutable initrds including non-substitutable derivations (in particular, ZFS). This change prevents such copyright violations by only marking a derivation as substitutable if it is marked substitutable and all of its inputs are marked as substitutable. This means that non-substitutable derivations have a "poisoning" effect, preventing derivations which take them as input from being substitutable. Change-Id: I80ba4a371ee0c55a1294aff311d4e7b151055fac --- guix/derivations.scm | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/guix/derivations.scm b/guix/derivations.scm index bef98cd26a..789e235eb8 100644 --- a/guix/derivations.scm +++ b/guix/derivations.scm @@ -868,6 +868,9 @@ (define* (derivation store name builder args env-vars) #f))))) + (define inputs-substitutable? (every substitutable-derivation? + (map derivation-input-derivation inputs))) + (define (user+system-env-vars) ;; Some options are passed to the build daemon via the env. vars of ;; derivations (urgh!). We hide that from our API, but here is the place @@ -875,7 +878,7 @@ (define* (derivation store name builder args (let ((env-vars `(,@(if local-build? `(("preferLocalBuild" . "1")) '()) - ,@(if (not substitutable?) + ,@(if (not (and substitutable? inputs-substitutable?))) `(("allowSubstitutes" . "0")) '()) ,@(if allowed-references