mirror of
https://codeberg.org/hako/Rosenthal.git
synced 2026-03-29 13:54:23 +00:00
services: zfs: Support builtin ZFS module use case.
* modules/rosenthal/services/file-systems.scm (zfs-configuration): [zfs] [kernel-has-zfs-module?]: New fields. (zfs-linux-loadable-module-service, add-zfs-package): New procedures. (zfs-service-type): Use them.
This commit is contained in:
parent
eff166865a
commit
e899a34d8e
@ -107,16 +107,34 @@
|
|||||||
;;;
|
;;;
|
||||||
|
|
||||||
(define-configuration/no-serialization zfs-configuration
|
(define-configuration/no-serialization zfs-configuration
|
||||||
|
(zfs
|
||||||
|
(file-like zfs)
|
||||||
|
"ZFS package to use.")
|
||||||
|
(kernel-has-zfs-module?
|
||||||
|
(boolean #f)
|
||||||
|
"Whether or not ZFS modules have already been built into the kernel.")
|
||||||
(volumes?
|
(volumes?
|
||||||
(boolean #f)
|
(boolean #f)
|
||||||
"")
|
"Wait for ZFS volumes.")
|
||||||
(auto-mount?
|
(auto-mount?
|
||||||
(boolean #t)
|
(boolean #t)
|
||||||
""))
|
"Mount all available ZFS file systems."))
|
||||||
|
|
||||||
(define zfs-shepherd
|
(define zfs-linux-loadable-module-service
|
||||||
(match-record-lambda <zfs-configuration>
|
(match-record-lambda <zfs-configuration>
|
||||||
(volumes? auto-mount?)
|
(zfs kernel-has-zfs-module?)
|
||||||
|
(if kernel-has-zfs-module?
|
||||||
|
'()
|
||||||
|
(list `(,zfs "module")))))
|
||||||
|
|
||||||
|
(define add-zfs-package
|
||||||
|
(match-record-lambda <zfs-configuration>
|
||||||
|
(zfs)
|
||||||
|
(list zfs)))
|
||||||
|
|
||||||
|
(define zfs-shepherd-service
|
||||||
|
(match-record-lambda <zfs-configuration>
|
||||||
|
(zfs volumes? auto-mount?)
|
||||||
(append
|
(append
|
||||||
(list
|
(list
|
||||||
(shepherd-service
|
(shepherd-service
|
||||||
@ -168,16 +186,16 @@
|
|||||||
(name 'zfs)
|
(name 'zfs)
|
||||||
(extensions
|
(extensions
|
||||||
(list (service-extension linux-loadable-module-service-type
|
(list (service-extension linux-loadable-module-service-type
|
||||||
(const (list `(,zfs "module"))))
|
zfs-linux-loadable-module-service)
|
||||||
(service-extension udev-service-type
|
(service-extension udev-service-type
|
||||||
(const (list zfs)))
|
add-zfs-package)
|
||||||
(service-extension kernel-module-loader-service-type
|
(service-extension kernel-module-loader-service-type
|
||||||
(const '("zfs")))
|
(const '("zfs")))
|
||||||
(service-extension shepherd-root-service-type
|
(service-extension shepherd-root-service-type
|
||||||
zfs-shepherd)
|
zfs-shepherd-service)
|
||||||
(service-extension user-processes-service-type
|
(service-extension user-processes-service-type
|
||||||
(const '(file-system-zfs)))
|
(const '(file-system-zfs)))
|
||||||
(service-extension profile-service-type
|
(service-extension profile-service-type
|
||||||
(const (list zfs)))))
|
add-zfs-package)))
|
||||||
(default-value (zfs-configuration))
|
(default-value (zfs-configuration))
|
||||||
(description "")))
|
(description "")))
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user