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 @@ (define-module (gnu build linux-modules)
#:use-module (ice-9 rdelim)
#:export (dot-ko
ensure-dot-ko
module-aliases
module-dependencies
recursive-module-dependencies
modules-loaded
@ -95,6 +96,15 @@ (define (module-dependencies file)
(('depends . what)
(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
(cut string-append <> ".ko"))