[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
05/08: linux-initrd: Copy modules and their dependencies to the initrd.
From: |
Ludovic Courtès |
Subject: |
05/08: linux-initrd: Copy modules and their dependencies to the initrd. |
Date: |
Thu, 27 Nov 2014 23:11:00 +0000 |
civodul pushed a commit to branch master
in repository guix.
commit 600c285b6345d8b0cc04f9e92e47ad5bcd437948
Author: Ludovic Courtès <address@hidden>
Date: Fri Nov 28 00:01:29 2014 +0100
linux-initrd: Copy modules and their dependencies to the initrd.
* gnu/system/linux-initrd.scm (flat-linux-module-directory)[build-exp]:
Add 'lookup' procedure. Use 'recursive-module-dependencies' to
compute the list of modules to copy.
Adjust #:modules parameter.
---
gnu/system/linux-initrd.scm | 40 ++++++++++++++++++++++++++++------------
1 files changed, 28 insertions(+), 12 deletions(-)
diff --git a/gnu/system/linux-initrd.scm b/gnu/system/linux-initrd.scm
index 3279172..71aba1e 100644
--- a/gnu/system/linux-initrd.scm
+++ b/gnu/system/linux-initrd.scm
@@ -92,7 +92,9 @@ MODULES and taken from LINUX."
(define build-exp
#~(begin
(use-modules (ice-9 match) (ice-9 regex)
- (guix build utils))
+ (srfi srfi-1)
+ (guix build utils)
+ (gnu build linux-modules))
(define (string->regexp str)
;; Return a regexp that matches STR exactly.
@@ -101,21 +103,35 @@ MODULES and taken from LINUX."
(define module-dir
(string-append #$linux "/lib/modules"))
+ (define (lookup module)
+ (let ((name (ensure-dot-ko module)))
+ (match (find-files module-dir (string->regexp name))
+ ((file)
+ file)
+ (()
+ (error "module not found" name module-dir))
+ ((_ ...)
+ (error "several modules by that name"
+ name module-dir)))))
+
+ (define modules
+ (let ((modules (map lookup '#$modules)))
+ (append modules
+ (recursive-module-dependencies modules
+ #:lookup-module lookup))))
+
(mkdir #$output)
(for-each (lambda (module)
- (match (find-files module-dir (string->regexp module))
- ((file)
- (format #t "copying '~a'...~%" file)
- (copy-file file (string-append #$output "/" module)))
- (()
- (error "module not found" module module-dir))
- ((_ ...)
- (error "several modules by that name"
- module module-dir))))
- '#$modules)))
+ (format #t "copying '~a'...~%" module)
+ (copy-file module
+ (string-append #$output "/"
+ (basename module))))
+ (delete-duplicates modules))))
(gexp->derivation "linux-modules" build-exp
- #:modules '((guix build utils))))
+ #:modules '((guix build utils)
+ (guix elf)
+ (gnu build linux-modules))))
(define (file-system->spec fs)
"Return a list corresponding to file-system FS that can be passed to the
- branch master updated (4625141 -> 08b1990), Ludovic Courtès, 2014/11/27
- 01/08: substitute-binary: Change "unresponsive" to "slow"., Ludovic Courtès, 2014/11/27
- 02/08: doc: Update stale references in "Bootstrapping"., Ludovic Courtès, 2014/11/27
- 05/08: linux-initrd: Copy modules and their dependencies to the initrd.,
Ludovic Courtès <=
- 07/08: linux-initrd: Remove now redundant module names., Ludovic Courtès, 2014/11/27
- 06/08: linux-boot: Load modules and their dependencies, Ã la 'modprobe'., Ludovic Courtès, 2014/11/27
- 08/08: linux-initrd: Remove the ".ko" suffix from module names in 'base-initrd'., Ludovic Courtès, 2014/11/27
- 04/08: system: Add (gnu build linux-modules)., Ludovic Courtès, 2014/11/27
- 03/08: Add (guix elf)., Ludovic Courtès, 2014/11/27