From patchwork Wed Dec 15 00:47:04 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Tobias Geerinckx-Rice X-Patchwork-Id: 35231 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 E0F3527BBEA; Wed, 15 Dec 2021 00:55:14 +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=-3.7 required=5.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,MAILING_LIST_MULTI,RCVD_IN_MSPIKE_H2,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 A790627BBE9 for ; Wed, 15 Dec 2021 00:55:14 +0000 (GMT) Received: from localhost ([::1]:58096 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mxIZd-0004I4-SH for patchwork@mira.cbaines.net; Tue, 14 Dec 2021 19:55:13 -0500 Received: from eggs.gnu.org ([209.51.188.92]:58062) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mxISg-0002Sc-C2 for guix-patches@gnu.org; Tue, 14 Dec 2021 19:48:02 -0500 Received: from debbugs.gnu.org ([209.51.188.43]:48365) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1mxISg-0001N9-2q for guix-patches@gnu.org; Tue, 14 Dec 2021 19:48:02 -0500 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1mxISf-0006pW-Id for guix-patches@gnu.org; Tue, 14 Dec 2021 19:48:01 -0500 X-Loop: help-debbugs@gnu.org Subject: [bug#52498] [PATCH] linux-modules: Ignore EINVAL in =?utf-8?b?4oCY?= =?utf-8?b?bW9kcHJvYmXigJk=?= mode. Resent-From: Tobias Geerinckx-Rice Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Wed, 15 Dec 2021 00:48:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 52498 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 52498@debbugs.gnu.org X-Debbugs-Original-To: guix-patches@gnu.org Received: via spool by submit@debbugs.gnu.org id=B.163952924526199 (code B ref -1); Wed, 15 Dec 2021 00:48:01 +0000 Received: (at submit) by debbugs.gnu.org; 15 Dec 2021 00:47:25 +0000 Received: from localhost ([127.0.0.1]:59911 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mxIS4-0006oV-RL for submit@debbugs.gnu.org; Tue, 14 Dec 2021 19:47:25 -0500 Received: from lists.gnu.org ([209.51.188.17]:44176) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mxIS3-0006oO-Ct for submit@debbugs.gnu.org; Tue, 14 Dec 2021 19:47:23 -0500 Received: from eggs.gnu.org ([209.51.188.92]:58014) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mxIS2-0002Ha-8R for guix-patches@gnu.org; Tue, 14 Dec 2021 19:47:23 -0500 Received: from [2a02:c205:2020:6054::1] (port=34696 helo=tobias.gr) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mxIRu-0001Jm-VQ for guix-patches@gnu.org; Tue, 14 Dec 2021 19:47:20 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; s=2018; bh=mAq6ZmKp1Is3W NJCD10dFnMTJcaltNKYkX+D9a+iiP0=; h=date:subject:to:from; d=tobias.gr; b=b223cPYgHGbg6KysfrWrFLSKNj20Bf9ZTHk3p+HE23Oa+iqap4Klsz2c/hxCfEfSKWjL Jm+GQdX+XxcRzI+LyD0JYyKazSo60L4+NIZNTVMjFRuby9bnJX/glgRl2fiYwyhY1O+3T7 uvVW4ZL7XXy8I3Sf1NxEoduF3ublHYII8wPx0rmXbs4fNgMvwCg6V7qUSoUzlTRSNFj37T YF/3I4OcCdVwnjcI1WNuOfaH20/id5t4FaUPSbpBrGWjljEgtH5YzLVuL0p1VgvDy/Sjmp 3DPTP5qEn4C10N4sk82utLAMm+TKnzTJ0n5w3eL2r9vZVvRPkV0R3ZJkkJy1B3pA== Received: by submission.tobias.gr (OpenSMTPD) with ESMTPSA id d537da01 (TLSv1.3:AEAD-AES256-GCM-SHA384:256:NO) for ; Wed, 15 Dec 2021 00:47:07 +0000 (UTC) Date: Wed, 15 Dec 2021 01:47:04 +0100 Message-Id: <20211215004704.25215-1-me@tobias.gr> X-Mailer: git-send-email 2.34.0 MIME-Version: 1.0 X-Host-Lookup-Failed: Reverse DNS lookup failed for 2a02:c205:2020:6054::1 (failed) Received-SPF: pass client-ip=2a02:c205:2020:6054::1; envelope-from=me@tobias.gr; helo=tobias.gr X-Spam_score_int: -12 X-Spam_score: -1.3 X-Spam_bar: - X-Spam_report: (-1.3 / 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, RDNS_NONE=0.793, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001 autolearn=no 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: , Errors-To: guix-patches-bounces+patchwork=mira.cbaines.net@gnu.org Sender: "Guix-patches" Reply-to: Tobias Geerinckx-Rice X-ACL-Warn: , Tobias Geerinckx-Rice via Guix-patches X-Patchwork-Original-From: Tobias Geerinckx-Rice via Guix-patches via From: Tobias Geerinckx-Rice X-getmail-retrieved-from-mailbox: Patches Loading the framebuffer-coreboot module simply fails with EINVAL on a non-Corebooted system. Crashing the system with a kernel panic is not a reasonable reaction to loading valid modules on unsupported hardware. The kernel should log an error, which the user is expected to see. Bogus module names will still be fatally reported by linux-modules.drv. * gnu/build/linux-modules.scm (load-linux-module*): Ignore EINVAL errors when operating recursively. --- gnu/build/linux-modules.scm | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/gnu/build/linux-modules.scm b/gnu/build/linux-modules.scm index 3a47322065..053720574b 100644 --- a/gnu/build/linux-modules.scm +++ b/gnu/build/linux-modules.scm @@ -354,11 +354,13 @@ (define (load-dependencies file) (close-fdes fd) #t) (lambda args - ;; If this module was already loaded and we're in modprobe style, ignore - ;; the error. (when fd (close-fdes fd)) - (or (and recursive? (= EEXIST (system-error-errno args))) - (apply throw args))))))) + (let ((errno (system-error-errno args))) + (or (and recursive? ; we're operating in ‘modprobe’ style + (member errno + (list EEXIST ; already loaded + EINVAL))) ; unsupported by hardware + (apply throw args)))))))) (define (load-linux-modules-from-directory modules directory) "Load MODULES and their dependencies from DIRECTORY, a directory containing