[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[bug#30604] [PATCH v10 2/6] linux-modules: Add 'load-linux-modules-from-
From: |
Ludovic Courtès |
Subject: |
[bug#30604] [PATCH v10 2/6] linux-modules: Add 'load-linux-modules-from-directory'. |
Date: |
Mon, 12 Mar 2018 13:39:14 +0100 |
* gnu/build/linux-modules.scm (load-linux-modules-from-directory): New
procedure.
* gnu/build/linux-boot.scm (boot-system)[lookup-module]: Remove.
Use 'load-linux-modules-from-directory' instead.
---
gnu/build/linux-boot.scm | 9 ++-------
gnu/build/linux-modules.scm | 12 ++++++++++++
2 files changed, 14 insertions(+), 7 deletions(-)
diff --git a/gnu/build/linux-boot.scm b/gnu/build/linux-boot.scm
index 18d87260a..df0b2b2d1 100644
--- a/gnu/build/linux-boot.scm
+++ b/gnu/build/linux-boot.scm
@@ -469,10 +469,6 @@ upon error."
mounts)
"ext4"))
- (define (lookup-module name)
- (string-append linux-module-directory "/"
- (ensure-dot-ko name)))
-
(display "Welcome, this is GNU's early boot Guile.\n")
(display "Use '--repl' for an initrd REPL.\n\n")
@@ -487,9 +483,8 @@ upon error."
(start-repl))
(display "loading kernel modules...\n")
- (for-each (cut load-linux-module* <>
- #:lookup-module lookup-module)
- (map lookup-module linux-modules))
+ (load-linux-modules-from-directory linux-modules
+ linux-module-directory)
(when qemu-guest-networking?
(unless (configure-qemu-networking)
diff --git a/gnu/build/linux-modules.scm b/gnu/build/linux-modules.scm
index 6101b8dc3..1337b5e88 100644
--- a/gnu/build/linux-modules.scm
+++ b/gnu/build/linux-modules.scm
@@ -38,6 +38,7 @@
modules-loaded
module-loaded?
load-linux-module*
+ load-linux-modules-from-directory
current-module-debugging-port
@@ -232,6 +233,17 @@ appears in BLACK-LIST are not loaded."
(or (and recursive? (= EEXIST (system-error-errno args)))
(apply throw args)))))))
+(define (load-linux-modules-from-directory modules directory)
+ "Load MODULES and their dependencies from DIRECTORY, a directory containing
+the '.ko' files. The '.ko' suffix is automatically added to MODULES if
+needed."
+ (define (lookup-module name)
+ (string-append directory "/" (ensure-dot-ko name)))
+
+ (for-each (cut load-linux-module* <>
+ #:lookup-module lookup-module)
+ (map lookup-module modules)))
+
;;;
;;; Device modules.
--
2.16.2
- [bug#30604] Keyboard detection before ‘cryptsetup’ runs, (continued)
- [bug#30604] Keyboard detection before ‘cryptsetup’ runs, Ludovic Courtès, 2018/03/24
- [bug#30604] [PATCH v11 1/6] linux-modules: Add "modules.alias" writer., Danny Milosavljevic, 2018/03/12
- [bug#30604] [PATCH v10 5/6] linux-initrd: Provide our own 'modprobe' program., Danny Milosavljevic, 2018/03/13
- [bug#30604] [PATCH v10 5/6] linux-initrd: Provide our own 'modprobe' program., Ludovic Courtès, 2018/03/13
- [bug#30604] [PATCH v10 5/6] linux-initrd: Provide our own 'modprobe' program., Danny Milosavljevic, 2018/03/13
- [bug#30604] [PATCH v10 5/6] linux-initrd: Provide our own 'modprobe' program., Danny Milosavljevic, 2018/03/13
- [bug#30604] [PATCH v10 4/6] vm: Make the virtio-blk uniquely identifiable in /sys., Ludovic Courtès, 2018/03/12
- [bug#30604] [PATCH v10 2/6] linux-modules: Add 'load-linux-modules-from-directory'.,
Ludovic Courtès <=
- [bug#30604] [PATCH v10 2/6] linux-modules: Add 'load-linux-modules-from-directory'., Danny Milosavljevic, 2018/03/12
- [bug#30604] [PATCH v10 3/6] linux-modules: Add 'load-needed-linux-modules'., Ludovic Courtès, 2018/03/12
- [bug#30604] [PATCH v10 3/6] linux-modules: Add 'load-needed-linux-modules'., Danny Milosavljevic, 2018/03/12
- [bug#30604] [PATCH v10 3/6] linux-modules: Add 'load-needed-linux-modules'., Ludovic Courtès, 2018/03/12
- [bug#30604] [PATCH v10 6/6] linux-modules: Add "modules.devname" writer., Ludovic Courtès, 2018/03/12
- [bug#30604] [PATCH v10 1/6] linux-modules: Add "modules.alias" writer., Danny Milosavljevic, 2018/03/12
- [bug#30604] [PATCH v10 1/6] linux-modules: Add "modules.alias" writer., Ludovic Courtès, 2018/03/12
- [bug#30604] [PATCH v8 3/7] linux-boot: Load kernel modules only when the hardware is present., Danny Milosavljevic, 2018/03/09
- [bug#30604] [PATCH v9 0/7] Load Linux module only when supported hardware is present., Danny Milosavljevic, 2018/03/03
- [bug#30604] [PATCH v9 7/7] linux-initrd: Use module-aliases->module-file-names, too., Danny Milosavljevic, 2018/03/03