From 579df5bc80fbedc59dc1b99751dcc49deab8f488 Mon Sep 17 00:00:00 2001 From: Richard Sent Date: Sat, 1 Jun 2024 19:26:16 -0400 Subject: services: base: Add optional delayed mount of file-systems MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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 --- gnu/system/file-systems.scm | 57 ++++++++++++++++++++++++--------------------- 1 file changed, 30 insertions(+), 27 deletions(-) (limited to 'gnu/system') diff --git a/gnu/system/file-systems.scm b/gnu/system/file-systems.scm index c791b24a9f..4ea8237c70 100644 --- a/gnu/system/file-systems.scm +++ b/gnu/system/file-systems.scm @@ -57,6 +57,7 @@ (define-module (gnu system file-systems) file-system-repair file-system-create-mount-point? file-system-dependencies + file-system-shepherd-requirements file-system-location file-system-type-predicate @@ -161,33 +162,35 @@ (define-syntax validate-file-system-flags (define-record-type* file-system make-file-system file-system? - (device file-system-device) ; string | | - (mount-point file-system-mount-point) ; string - (type file-system-type) ; string - (flags file-system-flags ; list of symbols - (default '()) - (sanitize validate-file-system-flags)) - (options file-system-options ; string or #f - (default #f)) - (mount? file-system-mount? ; Boolean - (default #t)) - (mount-may-fail? file-system-mount-may-fail? ; Boolean - (default #f)) - (needed-for-boot? %file-system-needed-for-boot? ; Boolean - (default #f)) - (check? file-system-check? ; Boolean - (default #t)) - (skip-check-if-clean? file-system-skip-check-if-clean? ; Boolean - (default #t)) - (repair file-system-repair ; symbol or #f - (default 'preen)) - (create-mount-point? file-system-create-mount-point? ; Boolean - (default #f)) - (dependencies file-system-dependencies ; list of - (default '())) ; or - (location file-system-location - (default (current-source-location)) - (innate))) + (device file-system-device) ; string | | + (mount-point file-system-mount-point) ; string + (type file-system-type) ; string + (flags file-system-flags ; list of symbols + (default '()) + (sanitize validate-file-system-flags)) + (options file-system-options ; string or #f + (default #f)) + (mount? file-system-mount? ; Boolean + (default #t)) + (mount-may-fail? file-system-mount-may-fail? ; Boolean + (default #f)) + (needed-for-boot? %file-system-needed-for-boot? ; Boolean + (default #f)) + (check? file-system-check? ; Boolean + (default #t)) + (skip-check-if-clean? file-system-skip-check-if-clean? ; Boolean + (default #t)) + (repair file-system-repair ; symbol or #f + (default 'preen)) + (create-mount-point? file-system-create-mount-point? ; Boolean + (default #f)) + (dependencies file-system-dependencies ; list of + (default '())) ; or + (shepherd-requirements file-system-shepherd-requirements ; list of symbols + (default '())) + (location file-system-location + (default (current-source-location)) + (innate))) ;; A file system label for use in the 'device' field. (define-record-type -- cgit v1.2.3