GNU bug report logs - #69400
[PATCH] linux-initrd: Avoid looking up builtin modules.

Previous Next

Package: guix-patches;

Reported by: Hilton Chain <hako <at> ultrarare.space>

Date: Mon, 26 Feb 2024 06:08:02 UTC

Severity: normal

Tags: patch

Done: Hilton Chain <hako <at> ultrarare.space>

Bug is archived. No further changes may be made.

To add a comment to this bug, you must first unarchive it, by sending
a message to control AT debbugs.gnu.org, with unarchive 69400 in the body.
You can then email your comments to 69400 AT debbugs.gnu.org in the normal way.

Toggle the display of automated, internal messages from the tracker.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to leo <at> famulari.name, me <at> tobias.gr, w <at> wmeyer.eu, guix-patches <at> gnu.org:
bug#69400; Package guix-patches. (Mon, 26 Feb 2024 06:08:02 GMT) Full text and rfc822 format available.

Acknowledgement sent to Hilton Chain <hako <at> ultrarare.space>:
New bug report received and forwarded. Copy sent to leo <at> famulari.name, me <at> tobias.gr, w <at> wmeyer.eu, guix-patches <at> gnu.org. (Mon, 26 Feb 2024 06:08:02 GMT) Full text and rfc822 format available.

Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):

From: Hilton Chain <hako <at> ultrarare.space>
To: guix-patches <at> gnu.org
Cc: Hilton Chain <hako <at> ultrarare.space>
Subject: [PATCH] linux-initrd: Avoid looking up builtin modules.
Date: Mon, 26 Feb 2024 14:06:23 +0800
* 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




Information forwarded to guix-patches <at> gnu.org:
bug#69400; Package guix-patches. (Wed, 06 Mar 2024 22:23:02 GMT) Full text and rfc822 format available.

Message #8 received at 69400 <at> debbugs.gnu.org (full text, mbox):

From: Ludovic Courtès <ludo <at> gnu.org>
To: Hilton Chain <hako <at> ultrarare.space>
Cc: Wilko Meyer <w <at> wmeyer.eu>, 69400 <at> debbugs.gnu.org,
 Tobias Geerinckx-Rice <me <at> tobias.gr>, Leo Famulari <leo <at> famulari.name>
Subject: Re: [bug#69400] [PATCH] linux-initrd: Avoid looking up builtin
 modules.
Date: Wed, 06 Mar 2024 23:21:45 +0100
Hi,

Hilton Chain <hako <at> ultrarare.space> skribis:

> * 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

Good catch!  Did you experience build failures because of that?
(Namely, the machinery looking for modules that didn’t exist.)

LGTM, thanks!

Ludo’.




Reply sent to Hilton Chain <hako <at> ultrarare.space>:
You have taken responsibility. (Sat, 09 Mar 2024 03:23:02 GMT) Full text and rfc822 format available.

Notification sent to Hilton Chain <hako <at> ultrarare.space>:
bug acknowledged by developer. (Sat, 09 Mar 2024 03:23:02 GMT) Full text and rfc822 format available.

Message #13 received at 69400-done <at> debbugs.gnu.org (full text, mbox):

From: Hilton Chain <hako <at> ultrarare.space>
To: Ludovic Courtès <ludo <at> gnu.org>
Cc: Wilko Meyer <w <at> wmeyer.eu>, 69400-done <at> debbugs.gnu.org,
 Tobias Geerinckx-Rice <me <at> tobias.gr>, Leo Famulari <leo <at> famulari.name>
Subject: Re: [bug#69400] [PATCH] linux-initrd: Avoid looking up builtin
 modules.
Date: Sat, 09 Mar 2024 11:17:51 +0800
Hi,

On Thu, 07 Mar 2024 06:21:45 +0800,
Ludovic Courtès wrote:
>
> Hi,
>
> Hilton Chain <hako <at> ultrarare.space> skribis:
>
> > * 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
>
> Good catch!  Did you experience build failures because of that?
> (Namely, the machinery looking for modules that didn’t exist.)
>
> LGTM, thanks!


Yes, I actually encountered the issue back to the first time customizing a
kernel with Guix System!

Recently I tried to write a script to enable all possible modules for
(gnu system linux-initrd) and realized "CONFIG_CRYPTO_ECB" (required for CIFS
support) in defconfig for part of our kernels are set to built-in.  As a result,
I think it's now necessary to make a change within Guix instead. :)

Applied as 8f8ec56052766aa5105d672b77ad9eaca5c1ab3c.

Thanks

bug archived. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> debbugs.gnu.org. (Sat, 06 Apr 2024 11:24:08 GMT) Full text and rfc822 format available.

This bug report was last modified 1 year and 74 days ago.

Previous Next


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