unofficial mirror of guix-patches@gnu.org 
 help / color / mirror / code / Atom feed
* [bug#52498] [PATCH] linux-modules: Ignore EINVAL in ‘modprobe’ mode.
@ 2021-12-15  0:47 Tobias Geerinckx-Rice via Guix-patches via
  2021-12-16 17:59 ` bug#52498: " Leo Famulari
  0 siblings, 1 reply; 2+ messages in thread
From: Tobias Geerinckx-Rice via Guix-patches via @ 2021-12-15  0:47 UTC (permalink / raw)
  To: 52498

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





^ permalink raw reply related	[flat|nested] 2+ messages in thread

* bug#52498: [PATCH] linux-modules: Ignore EINVAL in ‘modprobe’ mode.
  2021-12-15  0:47 [bug#52498] [PATCH] linux-modules: Ignore EINVAL in ‘modprobe’ mode Tobias Geerinckx-Rice via Guix-patches via
@ 2021-12-16 17:59 ` Leo Famulari
  0 siblings, 0 replies; 2+ messages in thread
From: Leo Famulari @ 2021-12-16 17:59 UTC (permalink / raw)
  To: Tobias Geerinckx-Rice; +Cc: 52498-done

On Wed, Dec 15, 2021 at 01:47:04AM +0100, Tobias Geerinckx-Rice via Guix-patches via wrote:
> 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.

Thanks, pushed as 13f13554433c9dd47503131107dfbdd8a8031832




^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2021-12-16 18:01 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-12-15  0:47 [bug#52498] [PATCH] linux-modules: Ignore EINVAL in ‘modprobe’ mode Tobias Geerinckx-Rice via Guix-patches via
2021-12-16 17:59 ` bug#52498: " Leo Famulari

Code repositories for project(s) associated with this public inbox

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

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).