profiles: 'linux-module-database' hooks gracefully handles module-less kernels.
Fixes <https://bugs.gnu.org/41924>. * 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 <kanichos@yandex.ru>
This commit is contained in:
parent
fea072d727
commit
05f79da93f
1 changed files with 8 additions and 3 deletions
|
@ -1221,9 +1221,10 @@ This is meant to be used as a profile hook."
|
||||||
inputs))
|
inputs))
|
||||||
(directory-entries
|
(directory-entries
|
||||||
(lambda (directory)
|
(lambda (directory)
|
||||||
(scandir directory
|
(or (scandir directory
|
||||||
(lambda (basename)
|
(lambda (basename)
|
||||||
(not (string-prefix? "." basename))))))
|
(not (string-prefix? "." basename))))
|
||||||
|
'())))
|
||||||
;; Note: Should usually result in one entry.
|
;; Note: Should usually result in one entry.
|
||||||
(versions (delete-duplicates
|
(versions (delete-duplicates
|
||||||
(append-map directory-entries
|
(append-map directory-entries
|
||||||
|
@ -1234,6 +1235,10 @@ This is meant to be used as a profile hook."
|
||||||
(setenv "PATH" #+(file-append kmod "/bin"))
|
(setenv "PATH" #+(file-append kmod "/bin"))
|
||||||
(make-linux-module-directory inputs version #$output)
|
(make-linux-module-directory inputs version #$output)
|
||||||
(setenv "PATH" old-path)))
|
(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
|
(_ (error "Specified Linux kernel and Linux kernel modules
|
||||||
are not all of the same version")))))))
|
are not all of the same version")))))))
|
||||||
(gexp->derivation "linux-module-database" build
|
(gexp->derivation "linux-module-database" build
|
||||||
|
|
Reference in a new issue