unofficial mirror of guix-patches@gnu.org 
 help / color / mirror / code / Atom feed
* [bug#69400] [PATCH] linux-initrd: Avoid looking up builtin modules.
@ 2024-02-26  6:06 Hilton Chain via Guix-patches via
  2024-03-06 22:21 ` Ludovic Courtès
  0 siblings, 1 reply; 3+ messages in thread
From: Hilton Chain via Guix-patches via @ 2024-02-26  6:06 UTC (permalink / raw)
  To: 69400; +Cc: Hilton Chain, Leo Famulari, Tobias Geerinckx-Rice, Wilko Meyer

* gnu/system/linux-initrd.scm (flat-linux-module-directory)
[build-exp]<builtin-modules,modules-to-lookup>: New variables.
<modules>: Use ‘modules-to-lookup’ to avoid looking up builtin modules.

Change-Id: I60fdae0211bb6632508b1c63582e013e78186cd1
---
 gnu/system/linux-initrd.scm | 14 +++++++++++++-
 1 file changed, 13 insertions(+), 1 deletion(-)

diff --git a/gnu/system/linux-initrd.scm b/gnu/system/linux-initrd.scm
index 5847f52a37..25563b703f 100644
--- a/gnu/system/linux-initrd.scm
+++ b/gnu/system/linux-initrd.scm
@@ -132,15 +132,27 @@ (define (flat-linux-module-directory linux modules)
         #~(begin
             (use-modules (gnu build linux-modules)
                          (guix build utils)
+                         (rnrs io ports)
                          (srfi srfi-1)
                          (srfi srfi-26))

             (define module-dir
               (string-append #$linux "/lib/modules"))

+            (define builtin-modules
+              (call-with-input-file
+                  (first (find-files module-dir "modules.builtin$"))
+                (lambda (port)
+                  (map file-name->module-name
+                       (string-tokenize
+                        (get-string-all port))))))
+
+            (define modules-to-lookup
+              (lset-difference string=? '#$modules builtin-modules))
+
             (define modules
               (let* ((lookup  (cut find-module-file module-dir <>))
-                     (modules (map lookup '#$modules)))
+                     (modules (map lookup modules-to-lookup)))
                 (append modules
                         (recursive-module-dependencies
                          modules

base-commit: b25b94335a3ee8d68d2145da8e5ea0325ecea451
prerequisite-patch-id: c615f2b08070db6cbe847a2bdd5b7c0aae79789b
prerequisite-patch-id: fd7da036342f36a8c698f5c8975f9e48d3ade435
prerequisite-patch-id: a2c81c14423bb9858f33d7d26976e8eea61982b7
prerequisite-patch-id: e30fd25b1dc4aaaff76474153836cd48e8565eb9
prerequisite-patch-id: 1d070b26dc64ee2ec95f14c4f5fc23419f766810
prerequisite-patch-id: 03de992f0312d5f0ee3368ebc3c1fad7c955d095
prerequisite-patch-id: b330efe2b0713e30b766c3b84643df67eb1eae5d
prerequisite-patch-id: a233d53e8895d3f82af872fffb2e3858f44ceb23
prerequisite-patch-id: a2b6bd60bc05d7b5a75f15a06b1b614afd6a7033
prerequisite-patch-id: f2a0189de95456f15ec6a92526c72fbedb74f359
--
2.41.0




^ permalink raw reply related	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2024-03-09  3:22 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-02-26  6:06 [bug#69400] [PATCH] linux-initrd: Avoid looking up builtin modules Hilton Chain via Guix-patches via
2024-03-06 22:21 ` Ludovic Courtès
2024-03-09  3:17   ` bug#69400: " Hilton Chain via Guix-patches via

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/guix.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).