diff options
author | Leo Famulari <leo@famulari.name> | 2017-07-10 14:37:53 -0400 |
---|---|---|
committer | Leo Famulari <leo@famulari.name> | 2017-07-10 14:37:53 -0400 |
commit | c8eb2b8c60d954b4522555a5c75b7bb4be5a1a4d (patch) | |
tree | 3a2e569e333ccd9265237868d3f46b2d1e04e3a9 /gnu/system/linux-initrd.scm | |
parent | ad22c7185395a52bd90ea5890a2ac79f44d00352 (diff) | |
parent | 61adfb00b11cc16a70e60f19fd8e0a838a3ef608 (diff) | |
download | guix-c8eb2b8c60d954b4522555a5c75b7bb4be5a1a4d.tar guix-c8eb2b8c60d954b4522555a5c75b7bb4be5a1a4d.tar.gz |
Merge branch 'master' into core-updates
Diffstat (limited to 'gnu/system/linux-initrd.scm')
-rw-r--r-- | gnu/system/linux-initrd.scm | 111 |
1 files changed, 58 insertions, 53 deletions
diff --git a/gnu/system/linux-initrd.scm b/gnu/system/linux-initrd.scm index 3a5e76034a..5a7aec5c87 100644 --- a/gnu/system/linux-initrd.scm +++ b/gnu/system/linux-initrd.scm @@ -68,24 +68,25 @@ the derivations referenced by EXP are automatically copied to the initrd." ;; General Linux overview in `Documentation/early-userspace/README' and ;; `Documentation/filesystems/ramfs-rootfs-initramfs.txt'. - (mlet %store-monad ((init (gexp->script "init" exp - #:guile guile))) - (define builder - (with-imported-modules (source-module-closure - '((gnu build linux-initrd))) - #~(begin - (use-modules (gnu build linux-initrd)) - - (mkdir #$output) - (build-initrd (string-append #$output "/initrd") - #:guile #$guile - #:init #$init - ;; Copy everything INIT refers to into the initrd. - #:references-graphs '("closure") - #:gzip (string-append #$gzip "/bin/gzip"))))) - - (gexp->derivation name builder - #:references-graphs `(("closure" ,init))))) + (define init + (program-file "init" exp #:guile guile)) + + (define builder + (with-imported-modules (source-module-closure + '((gnu build linux-initrd))) + #~(begin + (use-modules (gnu build linux-initrd)) + + (mkdir #$output) + (build-initrd (string-append #$output "/initrd") + #:guile #$guile + #:init #$init + ;; Copy everything INIT refers to into the initrd. + #:references-graphs '("closure") + #:gzip (string-append #$gzip "/bin/gzip"))))) + + (gexp->derivation name builder + #:references-graphs `(("closure" ,init)))) (define (flat-linux-module-directory linux modules) "Return a flat directory containing the Linux kernel modules listed in @@ -132,7 +133,7 @@ MODULES and taken from LINUX." (basename module)))) (delete-duplicates modules))))) - (gexp->derivation "linux-modules" build-exp)) + (computed-file "linux-modules" build-exp)) (define* (raw-initrd file-systems #:key @@ -165,40 +166,41 @@ to it are lost." (open source target))) mapped-devices)) - (mlet %store-monad ((kodir (flat-linux-module-directory linux - linux-modules))) - (expression->initrd - (with-imported-modules (source-module-closure - '((gnu build linux-boot) - (guix build utils) - (guix build bournish) - (gnu build file-systems))) - #~(begin - (use-modules (gnu build linux-boot) - (guix build utils) - (guix build bournish) ;add the 'bournish' meta-command - (srfi srfi-26) - - ;; FIXME: The following modules are for - ;; LUKS-DEVICE-MAPPING. We should instead propagate - ;; this info via gexps. - ((gnu build file-systems) - #:select (find-partition-by-luks-uuid)) - (rnrs bytevectors)) - - (with-output-to-port (%make-void-port "w") - (lambda () - (set-path-environment-variable "PATH" '("bin" "sbin") - '#$helper-packages))) - - (boot-system #:mounts '#$(map file-system->spec file-systems) - #:pre-mount (lambda () - (and #$@device-mapping-commands)) - #:linux-modules '#$linux-modules - #:linux-module-directory '#$kodir - #:qemu-guest-networking? #$qemu-networking? - #:volatile-root? '#$volatile-root?))) - #:name "raw-initrd"))) + (define kodir + (flat-linux-module-directory linux linux-modules)) + + (expression->initrd + (with-imported-modules (source-module-closure + '((gnu build linux-boot) + (guix build utils) + (guix build bournish) + (gnu build file-systems))) + #~(begin + (use-modules (gnu build linux-boot) + (guix build utils) + (guix build bournish) ;add the 'bournish' meta-command + (srfi srfi-26) + + ;; FIXME: The following modules are for + ;; LUKS-DEVICE-MAPPING. We should instead propagate + ;; this info via gexps. + ((gnu build file-systems) + #:select (find-partition-by-luks-uuid)) + (rnrs bytevectors)) + + (with-output-to-port (%make-void-port "w") + (lambda () + (set-path-environment-variable "PATH" '("bin" "sbin") + '#$helper-packages))) + + (boot-system #:mounts '#$(map file-system->spec file-systems) + #:pre-mount (lambda () + (and #$@device-mapping-commands)) + #:linux-modules '#$linux-modules + #:linux-module-directory '#$kodir + #:qemu-guest-networking? #$qemu-networking? + #:volatile-root? '#$volatile-root?))) + #:name "raw-initrd")) (define* (file-system-packages file-systems #:key (volatile-root? #f)) "Return the list of statically-linked, stripped packages to check @@ -285,6 +287,9 @@ loaded at boot time in the order in which they appear." ,@(if (find (file-system-type-predicate "btrfs") file-systems) '("btrfs") '()) + ,@(if (find (file-system-type-predicate "iso9660") file-systems) + '("isofs") + '()) ,@(if volatile-root? '("fuse") '()) |