From 8f8ec56052766aa5105d672b77ad9eaca5c1ab3c Mon Sep 17 00:00:00 2001 From: Hilton Chain Date: Mon, 26 Feb 2024 13:47:13 +0800 Subject: linux-initrd: Avoid looking up builtin modules. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * gnu/system/linux-initrd.scm (flat-linux-module-directory) [build-exp]: New variables. : 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(-) (limited to 'gnu') diff --git a/gnu/system/linux-initrd.scm b/gnu/system/linux-initrd.scm index 58e95a1312..6236d25b9d 100644 --- a/gnu/system/linux-initrd.scm +++ b/gnu/system/linux-initrd.scm @@ -132,15 +132,27 @@ MODULES and taken from LINUX." #~(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 -- cgit v1.2.3