mirror of
https://git.in.rschanz.org/ryan77627/guix.git
synced 2024-11-07 07:26:13 -05:00
file-systems: Factorize file-system-packages.
* gnu/system/linux-initrd.scm (base-initrd): Move helper-packages body to ... * gnu/system/file-systems.scm (file-system-packages): ... here. New variable. Also export it.
This commit is contained in:
parent
84aac61c81
commit
7208995426
2 changed files with 27 additions and 17 deletions
|
@ -22,6 +22,8 @@ (define-module (gnu system file-systems)
|
|||
#:use-module (guix records)
|
||||
#:use-module ((gnu build file-systems)
|
||||
#:select (string->uuid uuid->string))
|
||||
#:use-module (gnu packages linux)
|
||||
#:use-module (gnu packages disk)
|
||||
#:re-export (string->uuid
|
||||
uuid->string)
|
||||
#:export (<file-system>
|
||||
|
@ -65,6 +67,8 @@ (define-module (gnu system file-systems)
|
|||
|
||||
file-system-mapping->bind-mount
|
||||
|
||||
file-system-packages
|
||||
|
||||
%store-mapping
|
||||
%network-configuration-files
|
||||
%network-file-mappings))
|
||||
|
@ -411,4 +415,26 @@ (define %network-file-mappings
|
|||
(writable? (string=? file "/etc/resolv.conf"))))
|
||||
%network-configuration-files))
|
||||
|
||||
(define (file-system-type-predicate type)
|
||||
(lambda (fs)
|
||||
(string=? (file-system-type fs) type)))
|
||||
|
||||
(define* (file-system-packages file-systems #:key (volatile-root? #f))
|
||||
`(,@(if (find (lambda (fs)
|
||||
(string-prefix? "ext" (file-system-type fs)))
|
||||
file-systems)
|
||||
(list e2fsck/static)
|
||||
'())
|
||||
,@(if (find (lambda (fs)
|
||||
(string-suffix? "fat" (file-system-type fs)))
|
||||
file-systems)
|
||||
(list fatfsck/static)
|
||||
'())
|
||||
,@(if (find (file-system-type-predicate "btrfs") file-systems)
|
||||
(list btrfs-progs/static)
|
||||
'())
|
||||
,@(if volatile-root?
|
||||
(list unionfs-fuse/static)
|
||||
'())))
|
||||
|
||||
;;; file-systems.scm ends here
|
||||
|
|
|
@ -272,23 +272,7 @@ (define linux-modules
|
|||
,@extra-modules))
|
||||
|
||||
(define helper-packages
|
||||
;; Packages to be copied on the initrd.
|
||||
`(,@(if (find (lambda (fs)
|
||||
(string-prefix? "ext" (file-system-type fs)))
|
||||
file-systems)
|
||||
(list e2fsck/static)
|
||||
'())
|
||||
,@(if (find (lambda (fs)
|
||||
(string-suffix? "fat" (file-system-type fs)))
|
||||
file-systems)
|
||||
(list fatfsck/static)
|
||||
'())
|
||||
,@(if (find (file-system-type-predicate "btrfs") file-systems)
|
||||
(list btrfs-progs/static)
|
||||
'())
|
||||
,@(if volatile-root?
|
||||
(list unionfs-fuse/static)
|
||||
'())))
|
||||
(file-system-packages file-systems #:volatile-root? volatile-root?))
|
||||
|
||||
(raw-initrd file-systems
|
||||
#:linux linux
|
||||
|
|
Loading…
Reference in a new issue