Subject: [bug#30604] [PATCH v8 1/7] linux-modules: Add module-aliases.

From: Danny Milosavljevic <[email-masked]>
Date: Sat, 3 Mar 2018 14:55:27 +0100

* gnu/build/linux-modules.scm (module-aliases): New variable.
---
 gnu/build/linux-modules.scm | 9 +++++++++
 1 file changed, 9 insertions(+)

diff --git a/gnu/build/linux-modules.scm b/gnu/build/linux-modules.scm
index 4a6d4ff08..364339df9 100644
--- a/gnu/build/linux-modules.scm
+++ b/gnu/build/linux-modules.scm
@@ -30,6 +30,7 @@
   #:use-module (ice-9 rdelim)
   #:export (dot-ko
             ensure-dot-ko
+            module-aliases
             module-dependencies
             recursive-module-dependencies
             modules-loaded
@@ -95,6 +96,14 @@ contains module names, not actual file names."
       (('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"))