diff options
author | Ludovic Courtès <ludo@gnu.org> | 2018-03-14 23:09:57 +0100 |
---|---|---|
committer | Ludovic Courtès <ludo@gnu.org> | 2018-03-18 22:35:03 +0100 |
commit | a57df67b5932c7f458d4a31a82a477634d6af1a0 (patch) | |
tree | c1147ee7dc3dc07f5450a3ec99b3623820a0c0c3 /gnu/build/linux-modules.scm | |
parent | 248db51c7ee2ef68653fbfe34b17d1cc905e10a6 (diff) | |
download | patches-a57df67b5932c7f458d4a31a82a477634d6af1a0.tar patches-a57df67b5932c7f458d4a31a82a477634d6af1a0.tar.gz |
linux-modules: Add 'current-kernel-directory'.
* gnu/build/linux-modules.scm (current-kernel-directory): New procedure.
(current-alias-file): Use it.
Diffstat (limited to 'gnu/build/linux-modules.scm')
-rw-r--r-- | gnu/build/linux-modules.scm | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/gnu/build/linux-modules.scm b/gnu/build/linux-modules.scm index 4fe673cca2..3dd60f434f 100644 --- a/gnu/build/linux-modules.scm +++ b/gnu/build/linux-modules.scm @@ -357,12 +357,15 @@ and each module is a module name like \"snd_hda_intel\"." (() ;empty line (loop aliases))))))) -(define (current-alias-file) - "Return the absolute file name of the default 'modules.alias' file." +(define (current-kernel-directory) + "Return the directory of the currently running Linux kernel." (string-append (or (getenv "LINUX_MODULE_DIRECTORY") "/run/booted-system/kernel/lib/modules") - "/" (utsname:release (uname)) - "/" "modules.alias")) + "/" (utsname:release (uname)))) + +(define (current-alias-file) + "Return the absolute file name of the default 'modules.alias' file." + (string-append (current-kernel-directory) "/modules.alias")) (define* (known-module-aliases #:optional (alias-file (current-alias-file))) "Return the list of alias/module pairs read from ALIAS-FILE. Each alias is |