all messages for Guix-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Tobias Geerinckx-Rice via Guix-patches via <guix-patches@gnu.org>
To: 52498@debbugs.gnu.org
Subject: [bug#52498] [PATCH] linux-modules: Ignore EINVAL in ‘modprobe’ mode.
Date: Wed, 15 Dec 2021 01:47:04 +0100	[thread overview]
Message-ID: <20211215004704.25215-1-me@tobias.gr> (raw)

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





             reply	other threads:[~2021-12-15  0:55 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-12-15  0:47 Tobias Geerinckx-Rice via Guix-patches via [this message]
2021-12-16 17:59 ` bug#52498: [PATCH] linux-modules: Ignore EINVAL in ‘modprobe’ mode Leo Famulari

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20211215004704.25215-1-me@tobias.gr \
    --to=guix-patches@gnu.org \
    --cc=52498@debbugs.gnu.org \
    --cc=me@tobias.gr \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

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

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.