mirror of
https://git.in.rschanz.org/ryan77627/guix.git
synced 2024-12-25 13:58:15 -05:00
linux-initrd: Avoid monadic style a bit.
* gnu/system/linux-initrd.scm (expression->initrd): Use 'program-file' for 'init'. (flat-linux-module-directory): Use 'computed-file' instead of 'gexp->derivation'. (raw-initrd): Adjust accordingly.
This commit is contained in:
parent
e208bf789c
commit
6d9a859038
1 changed files with 50 additions and 48 deletions
|
@ -68,8 +68,9 @@ (define* (expression->initrd exp
|
|||
;; 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 init
|
||||
(program-file "init" exp #:guile guile))
|
||||
|
||||
(define builder
|
||||
(with-imported-modules (source-module-closure
|
||||
'((gnu build linux-initrd)))
|
||||
|
@ -85,7 +86,7 @@ (define builder
|
|||
#:gzip (string-append #$gzip "/bin/gzip")))))
|
||||
|
||||
(gexp->derivation name builder
|
||||
#:references-graphs `(("closure" ,init)))))
|
||||
#: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 @@ (define modules
|
|||
(basename module))))
|
||||
(delete-duplicates modules)))))
|
||||
|
||||
(gexp->derivation "linux-modules" build-exp))
|
||||
(computed-file "linux-modules" build-exp))
|
||||
|
||||
(define* (raw-initrd file-systems
|
||||
#:key
|
||||
|
@ -165,8 +166,9 @@ (define device-mapping-commands
|
|||
(open source target)))
|
||||
mapped-devices))
|
||||
|
||||
(mlet %store-monad ((kodir (flat-linux-module-directory linux
|
||||
linux-modules)))
|
||||
(define kodir
|
||||
(flat-linux-module-directory linux linux-modules))
|
||||
|
||||
(expression->initrd
|
||||
(with-imported-modules (source-module-closure
|
||||
'((gnu build linux-boot)
|
||||
|
@ -198,7 +200,7 @@ (define device-mapping-commands
|
|||
#:linux-module-directory '#$kodir
|
||||
#:qemu-guest-networking? #$qemu-networking?
|
||||
#:volatile-root? '#$volatile-root?)))
|
||||
#:name "raw-initrd")))
|
||||
#:name "raw-initrd"))
|
||||
|
||||
(define* (file-system-packages file-systems #:key (volatile-root? #f))
|
||||
"Return the list of statically-linked, stripped packages to check
|
||||
|
|
Loading…
Reference in a new issue