guix-commits
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

03/03: linux-modules: Raise an error when a kernel module cannot be foun


From: Ludovic Courtès
Subject: 03/03: linux-modules: Raise an error when a kernel module cannot be found.
Date: Wed, 29 Aug 2018 17:32:08 -0400 (EDT)

civodul pushed a commit to branch master
in repository guix.

commit 4db7a9dc663c5b26e45ec35538bf68ff87acdf7b
Author: Ludovic Courtès <address@hidden>
Date:   Wed Aug 29 23:29:03 2018 +0200

    linux-modules: Raise an error when a kernel module cannot be found.
    
    Previously we'd get an unhelpful backtrace like this:
    
      In gnu/build/linux-modules.scm:
         184:47  4 (recursive-module-dependencies _ #:lookup-module _)
          98:14  3 (module-dependencies _)
          85:18  2 (modinfo-section-contents _)
      In ice-9/ports.scm:
         439:11  1 (call-with-input-file #f #<procedure get-bytevector-al?> ?)
      In unknown file:
             0 (open-file #f "r" #:encoding #f #:guess-encoding #f)
    
      ERROR: In procedure open-file:
      Wrong type (expecting string): #f
      builder for `/gnu/store/…-linux-modules.drv' failed with exit code 1
    
    * gnu/build/linux-modules.scm (find-module-file): When MODULE cannot be
    found, raise an error instead of returning #f.  This is more useful to
    the user.
---
 gnu/build/linux-modules.scm | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/gnu/build/linux-modules.scm b/gnu/build/linux-modules.scm
index ae141b6..2d81175 100644
--- a/gnu/build/linux-modules.scm
+++ b/gnu/build/linux-modules.scm
@@ -136,7 +136,7 @@ and normalizing it."
 (define (find-module-file directory module)
   "Lookup module NAME under DIRECTORY, and return its absolute file name.
 NAME can be a file name with or without '.ko', or it can be a module name.
-Return #f if it could not be found.
+Raise an error if it could not be found.
 
 Module names can differ from file names in interesting ways; for instance,
 module names usually (always?) use underscores as the inter-word separator,
@@ -162,7 +162,7 @@ whereas file names often, but not always, use hyphens.  
Examples:
     ((file)
      file)
     (()
-     #f)
+     (error "kernel module not found" module directory))
     ((_ ...)
      (error "several modules by that name" module directory))))
 



reply via email to

[Prev in Thread] Current Thread [Next in Thread]