From patchwork Mon Feb 26 06:06:23 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Hilton Chain X-Patchwork-Id: 61132 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 A601627BBE2; Mon, 26 Feb 2024 06:08:07 +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=-0.7 required=5.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,FROM_SUSPICIOUS_NTLD,MAILING_LIST_MULTI,PDS_OTHER_BAD_TLD, SPF_HELO_PASS,URIBL_BLOCKED autolearn=no 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 BE1AE27BBE9 for ; Mon, 26 Feb 2024 06:08:06 +0000 (GMT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1reU9P-0002U7-7X; Mon, 26 Feb 2024 01:07:43 -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 1reU9N-0002Tf-E1 for guix-patches@gnu.org; Mon, 26 Feb 2024 01:07:41 -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 1reU9N-0003Us-4d for guix-patches@gnu.org; Mon, 26 Feb 2024 01:07:41 -0500 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1reU9i-0005dy-LX; Mon, 26 Feb 2024 01:08:02 -0500 X-Loop: help-debbugs@gnu.org Subject: [bug#69400] [PATCH] linux-initrd: Avoid looking up builtin modules. Resent-From: Hilton Chain Original-Sender: "Debbugs-submit" Resent-CC: leo@famulari.name, me@tobias.gr, w@wmeyer.eu, guix-patches@gnu.org Resent-Date: Mon, 26 Feb 2024 06:08:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 69400 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 69400@debbugs.gnu.org Cc: Hilton Chain , Leo Famulari , Tobias Geerinckx-Rice , Wilko Meyer X-Debbugs-Original-To: guix-patches@gnu.org X-Debbugs-Original-Xcc: Leo Famulari , Tobias Geerinckx-Rice , Wilko Meyer Received: via spool by submit@debbugs.gnu.org id=B.170892765321616 (code B ref -1); Mon, 26 Feb 2024 06:08:02 +0000 Received: (at submit) by debbugs.gnu.org; 26 Feb 2024 06:07:33 +0000 Received: from localhost ([127.0.0.1]:34340 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1reU9E-0005cX-Mz for submit@debbugs.gnu.org; Mon, 26 Feb 2024 01:07:33 -0500 Received: from lists.gnu.org ([209.51.188.17]:50632) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1reU9C-0005cO-Ee for submit@debbugs.gnu.org; Mon, 26 Feb 2024 01:07:31 -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 1reU8m-0002PK-Um for guix-patches@gnu.org; Mon, 26 Feb 2024 01:07:04 -0500 Received: from mail.boiledscript.com ([144.168.59.46]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1reU8k-0003Ev-7z for guix-patches@gnu.org; Mon, 26 Feb 2024 01:07:04 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ultrarare.space; s=dkim; t=1708927602; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=9Z/IowYfRXkmfWhiMjz0q5KT9P+Y1v9NNrcKOOGtrjQ=; b=xSIBHos3P/ue17R1L9qMGC3QGsBOeQf1ZbRFVbL01JpKUC5KrSiDONfqIBVoRlijErMGLh Uroa7Uh215V066lQFYz1CMfYJICRybHVXANGKOTU4rZI3kLuLhH929hkvt23fc8OXkYost u7O5HI4XxOqqzywo9xiqT+BhrAJub+uX3B3fQSP4MmQCDVPpvxe8XkRsxJpIAVy9EFnb0D voWAAicN10n66NHnXz3WJm4zKg5WBjZJ2SSKNW2dfIRfFJVwF925OhtSde9IGudnrALnJK Rt5kZyxr0dSy8okfxGbmQ+pJQkT4QT7unVNGjlhPfzb+eYkjHXFAzLbQkQmevQ== Authentication-Results: mail.boiledscript.com; auth=pass smtp.mailfrom=hako@ultrarare.space Date: Mon, 26 Feb 2024 14:06:23 +0800 Message-ID: <7256f0ce334fc064a904e6d9748e9ccc7e67dfda.1708926797.git.hako@ultrarare.space> MIME-Version: 1.0 X-Spamd-Bar: / Received-SPF: pass client-ip=144.168.59.46; envelope-from=hako@ultrarare.space; helo=mail.boiledscript.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action 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: Hilton Chain X-ACL-Warn: , Hilton Chain via Guix-patches X-Patchwork-Original-From: Hilton Chain via Guix-patches via From: Hilton Chain 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 * 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(-) 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 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