linux-modules: Add module-aliases.

* gnu/build/linux-modules.scm (module-aliases): New variable.
This commit is contained in:
Danny Milosavljevic 2018-03-03 14:55:27 +01:00
parent c94752ad22
commit 8b2219d847
No known key found for this signature in database
GPG Key ID: E71A35542C30BAA5

View File

@ -30,6 +30,7 @@
#:use-module (ice-9 rdelim) #:use-module (ice-9 rdelim)
#:export (dot-ko #:export (dot-ko
ensure-dot-ko ensure-dot-ko
module-aliases
module-dependencies module-dependencies
recursive-module-dependencies recursive-module-dependencies
modules-loaded modules-loaded
@ -95,6 +96,15 @@ contains module names, not actual file names."
(('depends . what) (('depends . what)
(string-tokenize what %not-comma))))) (string-tokenize what %not-comma)))))
(define (module-aliases file)
"Return the list of aliases of module FILE."
(let ((info (modinfo-section-contents file)))
(filter-map (match-lambda
(('alias . value)
value)
(_ #f))
(modinfo-section-contents file))))
(define dot-ko (define dot-ko
(cut string-append <> ".ko")) (cut string-append <> ".ko"))