aboutsummaryrefslogtreecommitdiff
path: root/gnu/system/linux-initrd.scm
diff options
context:
space:
mode:
authorMarius Bakke <mbakke@fastmail.com>2018-07-30 18:08:28 +0200
committerMarius Bakke <mbakke@fastmail.com>2018-07-30 18:08:28 +0200
commit869250809bddcf8eab26ecdedabad6fc060751dd (patch)
tree2108049faa07fd2b79d679799fa51ce8a2e5612a /gnu/system/linux-initrd.scm
parentf419abea22fe5dd3aa96c19990316e502157350b (diff)
parentf475b90c353deff5b848753bf88c855f481f1ec0 (diff)
downloadpatches-869250809bddcf8eab26ecdedabad6fc060751dd.tar
patches-869250809bddcf8eab26ecdedabad6fc060751dd.tar.gz
Merge branch 'master' into staging
Diffstat (limited to 'gnu/system/linux-initrd.scm')
-rw-r--r--gnu/system/linux-initrd.scm26
1 files changed, 5 insertions, 21 deletions
diff --git a/gnu/system/linux-initrd.scm b/gnu/system/linux-initrd.scm
index d73ebfd8d3..a5a111908f 100644
--- a/gnu/system/linux-initrd.scm
+++ b/gnu/system/linux-initrd.scm
@@ -108,34 +108,18 @@ the derivations referenced by EXP are automatically copied to the initrd."
MODULES and taken from LINUX."
(define build-exp
(with-imported-modules (source-module-closure
- '((guix build utils)
- (gnu build linux-modules)))
+ '((gnu build linux-modules)))
#~(begin
- (use-modules (ice-9 match) (ice-9 regex)
+ (use-modules (gnu build linux-modules)
(srfi srfi-1)
- (guix build utils)
- (gnu build linux-modules))
-
- (define (string->regexp str)
- ;; Return a regexp that matches STR exactly.
- (string-append "^" (regexp-quote str) "$"))
+ (srfi srfi-26))
(define module-dir
(string-append #$linux "/lib/modules"))
- (define (lookup module)
- (let ((name (ensure-dot-ko module)))
- (match (find-files module-dir (string->regexp name))
- ((file)
- file)
- (()
- (error "module not found" name module-dir))
- ((_ ...)
- (error "several modules by that name"
- name module-dir)))))
-
(define modules
- (let ((modules (map lookup '#$modules)))
+ (let* ((lookup (cut find-module-file module-dir <>))
+ (modules (map lookup '#$modules)))
(append modules
(recursive-module-dependencies modules
#:lookup-module lookup))))