From 05f79da93fb4fd5216feb41510bf0a41f8eedf5b Mon Sep 17 00:00:00 2001 From: Ludovic Courtès Date: Thu, 18 Jun 2020 14:35:46 +0200 Subject: profiles: 'linux-module-database' hooks gracefully handles module-less kernels. Fixes . * guix/profiles.scm (linux-module-database)[build]: Arrange so 'directory-entries' always returns a list. Add 'match' clause for the empty list. Co-authored-by: Ivan Kozlov --- guix/profiles.scm | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) (limited to 'guix') diff --git a/guix/profiles.scm b/guix/profiles.scm index f7af01b9b2..f34f73e17e 100644 --- a/guix/profiles.scm +++ b/guix/profiles.scm @@ -1221,9 +1221,10 @@ (define build inputs)) (directory-entries (lambda (directory) - (scandir directory - (lambda (basename) - (not (string-prefix? "." basename)))))) + (or (scandir directory + (lambda (basename) + (not (string-prefix? "." basename)))) + '()))) ;; Note: Should usually result in one entry. (versions (delete-duplicates (append-map directory-entries @@ -1234,6 +1235,10 @@ (define build (setenv "PATH" #+(file-append kmod "/bin")) (make-linux-module-directory inputs version #$output) (setenv "PATH" old-path))) + (() + ;; Nothing here, maybe because this is a kernel with + ;; CONFIG_MODULES=n. + (mkdir #$output)) (_ (error "Specified Linux kernel and Linux kernel modules are not all of the same version"))))))) (gexp->derivation "linux-module-database" build -- cgit v1.2.3