From patchwork Tue Apr 23 20:47:19 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Sent X-Patchwork-Id: 63322 Return-Path: X-Original-To: patchwork@mira.cbaines.net Delivered-To: patchwork@mira.cbaines.net Received: by mira.cbaines.net (Postfix, from userid 113) id 751E327BBE9; Tue, 23 Apr 2024 21:49:15 +0100 (BST) X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on mira.cbaines.net X-Spam-Level: X-Spam-Status: No, score=-2.7 required=5.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,MAILING_LIST_MULTI,SPF_HELO_PASS,URIBL_BLOCKED autolearn=unavailable autolearn_force=no version=3.4.6 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mira.cbaines.net (Postfix) with ESMTPS id 9FE8227BBE2 for ; Tue, 23 Apr 2024 21:49:12 +0100 (BST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rzN4h-00032g-5v; Tue, 23 Apr 2024 16:49:11 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1rzN4O-0002zb-1g for guix-patches@gnu.org; Tue, 23 Apr 2024 16:48:52 -0400 Received: from debbugs.gnu.org ([2001:470:142:5::43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1rzN4N-0003Od-9N for guix-patches@gnu.org; Tue, 23 Apr 2024 16:48:51 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1rzN4d-0003Xq-Gz for guix-patches@gnu.org; Tue, 23 Apr 2024 16:49:07 -0400 X-Loop: help-debbugs@gnu.org Subject: [bug#70542] [PATCH 1/4] file-systems: Add requirements field to file-systems Resent-From: Richard Sent Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Tue, 23 Apr 2024 20:49:07 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 70542 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 70542@debbugs.gnu.org Cc: Richard Sent Received: via spool by 70542-submit@debbugs.gnu.org id=B70542.171390529913081 (code B ref 70542); Tue, 23 Apr 2024 20:49:07 +0000 Received: (at 70542) by debbugs.gnu.org; 23 Apr 2024 20:48:19 +0000 Received: from localhost ([127.0.0.1]:54255 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rzN3j-0003NV-Ku for submit@debbugs.gnu.org; Tue, 23 Apr 2024 16:48:18 -0400 Received: from mail-108-mta19.mxroute.com ([136.175.108.19]:46821) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rzN3d-0003M9-3a for 70542@debbugs.gnu.org; Tue, 23 Apr 2024 16:48:09 -0400 Received: from filter006.mxroute.com ([136.175.111.2] filter006.mxroute.com) (Authenticated sender: mN4UYu2MZsgR) by mail-108-mta19.mxroute.com (ZoneMTA) with ESMTPSA id 18f0cb6e2b40003bea.001 for <70542@debbugs.gnu.org> (version=TLSv1.3 cipher=TLS_AES_256_GCM_SHA384); Tue, 23 Apr 2024 20:47:43 +0000 X-Zone-Loop: 0216e505b7a0a8264361f18032a25031e2a3b3c2cb82 X-Originating-IP: [136.175.111.2] DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=freakingpenguin.com; s=x; h=Content-Transfer-Encoding:MIME-Version: References:In-Reply-To:Message-ID:Date:Subject:Cc:To:From:Sender:Reply-To: Content-Type:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Id:List-Help: List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=v3IW4uFe6Ct60NonFKfWMHf3ECzON50UkPPy5OhczLo=; b=iC/D/0ppWINBDLjJjss8erhdpz 34hfaO4vv5+P5m1U237xZOZmKXfRXvB0uzJ8EecLSJGFW7akMBlBigC3OAYDB89BemIzSLwycvOVD OZzK6OdI85gXP0eBsd0+Fc3W30p+F5lYZ8r2QoaHa2IpxlKPm/iih94cFqIr9oX6HoxWKutE/vLzM PxOe3fdRMyYlJ/oF9Xz+msVZsDuldHpuO5elTCWDT9lsXXyuuMmecTGgOgaoLvJ5P66caQVYf1JkH HxpnEFeh4857UfW657x0ws1M3Hlyp6Bo8hIo3w+BuIqxfVSmcZ4dJe+ay9Vf62BlCj72A87bxBsGX l3lJoeOg==; From: Richard Sent Date: Tue, 23 Apr 2024 16:47:19 -0400 Message-ID: In-Reply-To: References: MIME-Version: 1.0 X-Authenticated-Id: richard@freakingpenguin.com X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: guix-patches@gnu.org List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-patches-bounces+patchwork=mira.cbaines.net@gnu.org Sender: guix-patches-bounces+patchwork=mira.cbaines.net@gnu.org X-getmail-retrieved-from-mailbox: Patches * gnu/system/file-systems.scm (file-system): Add requirements field to the file-system record. This field will be used for adding additional Shepherd requirements to a file system Shepherd service. * doc/guix.texi: Add documentation for file-system requirements. Change-Id: If0392db03d48e8820aa53df1df482c12ec72e1a5 --- doc/guix.texi | 13 +++++++++++++ gnu/system/file-systems.scm | 3 +++ 2 files changed, 16 insertions(+) diff --git a/doc/guix.texi b/doc/guix.texi index 65af136e61..80b24e2de9 100644 --- a/doc/guix.texi +++ b/doc/guix.texi @@ -17751,6 +17751,19 @@ File Systems Another example is a file system that depends on a mapped device, for example for an encrypted partition (@pxref{Mapped Devices}). + +@item @code{requirements} (default: @code{'()}) +This is a list of symbols denoting Shepherd requirements that must be +met before mounting the file system. + +As an example, an NFS file system would typically have a requirement for +@code{networking}. + +Typically, file systems are mounted before most other Shepherd services +are started. However, file systems with a non-empty requirements field +are mounted after Shepherd services have begun. Any Shepherd service +that depends on a file system with a non-empty requirements field must +depend on it directly and not on the generic symbol @code{file-systems}. @end table @end deftp diff --git a/gnu/system/file-systems.scm b/gnu/system/file-systems.scm index af0567bd3e..76a51a2b69 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-requirements file-system-location file-system-type-predicate @@ -185,6 +186,8 @@ (define-record-type* file-system (default #f)) (dependencies file-system-dependencies ; list of (default '())) ; or + (requirements file-system-requirements ; list of symbols + (default '())) (location file-system-location (default (current-source-location)) (innate)))