mirror of
https://codeberg.org/guix/guix.git
synced 2025-10-02 02:15:12 +00:00
services: base: Add optional delayed mount of file-systems
Add a mechanism to only require mounting a subset of file-system entries during early Shepherd initialization. Any file-system with additional Shepherd service requirements (e.g. networking) is not required to provision 'file-systems. * gnu/services/base.scm (file-system-shepherd-service): Splice file-system-requirements into the Shepherd service requirement list. (file-system-shepherd-services): Provision 'file-system only when file system services without additional Shepherd requirements are started. * gnu/system/file-systems.scm (file-system): Add shepherd-requirements field to the file-system record. This field is used for adding additional Shepherd requirements to a file-system Shepherd service. * doc/guix.texi: Add documentation for file-system shepherd-requirements. Change-Id: If0392db03d48e8820aa53df1df482c12ec72e1a5 Signed-off-by: Ludovic Courtès <ludo@gnu.org>
This commit is contained in:
parent
5d3edff1a6
commit
579df5bc80
3 changed files with 56 additions and 29 deletions
|
@ -404,6 +404,7 @@ upon boot."
|
|||
(create? (file-system-create-mount-point? file-system))
|
||||
(mount? (file-system-mount? file-system))
|
||||
(dependencies (file-system-dependencies file-system))
|
||||
(requirements (file-system-shepherd-requirements file-system))
|
||||
(packages (file-system-packages (list file-system))))
|
||||
(and (or mount? create?)
|
||||
(with-imported-modules (source-module-closure
|
||||
|
@ -412,7 +413,8 @@ upon boot."
|
|||
(provision (list (file-system->shepherd-service-name file-system)))
|
||||
(requirement `(root-file-system
|
||||
udev
|
||||
,@(map dependency->shepherd-service-name dependencies)))
|
||||
,@(map dependency->shepherd-service-name dependencies)
|
||||
,@requirements))
|
||||
(documentation "Check, mount, and unmount the given file system.")
|
||||
(start #~(lambda args
|
||||
#$(if create?
|
||||
|
@ -461,12 +463,20 @@ upon boot."
|
|||
(or (file-system-mount? x)
|
||||
(file-system-create-mount-point? x)))
|
||||
file-systems)))
|
||||
|
||||
(define sink
|
||||
(shepherd-service
|
||||
(provision '(file-systems))
|
||||
(requirement (cons* 'root-file-system 'user-file-systems
|
||||
(map file-system->shepherd-service-name
|
||||
file-systems)))
|
||||
;; Do not require file systems with Shepherd
|
||||
;; requirements to provision
|
||||
;; 'file-systems. Many Shepherd services
|
||||
;; require 'file-systems, so we would likely
|
||||
;; deadlock.
|
||||
(filter (lambda (file-system)
|
||||
(null? (file-system-shepherd-requirements file-system)))
|
||||
file-systems))))
|
||||
(documentation "Target for all the initially-mounted file systems")
|
||||
(start #~(const #t))
|
||||
(stop #~(const #f))))
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue