all messages for Guix-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: raid5atemyhomework via Guix-patches via <guix-patches@gnu.org>
To: "45692@debbugs.gnu.org" <45692@debbugs.gnu.org>
Subject: [bug#45692] [PATCH 2/4] gnu: Make file-systems target extensible by services.
Date: Wed, 06 Jan 2021 15:55:36 +0000	[thread overview]
Message-ID: <Mg_8FIL2l-Zd7f6rM0kLocdknqSlZfYwXsKBY88f0vqvn_pqTW3otQGnYeTcg1SLbUXuzsO0P5-O35udXT5-c-gzr21W0E0XEYTAbAkdlpI=@protonmail.com> (raw)
In-Reply-To: <f9YNSdmHSIAVHWwDRwnh8QVeNjUG4M6YMJMntulZ3s8cYPVCBHrVIirwkuGxpYIduWVNAyi13dFVlqUKs7_QXPDBvbDe_JNNEC_SoNBTprk=@protonmail.com>

From 792a8f8efc95e4fe9a94d42f839ddcfb034b8540 Mon Sep 17 00:00:00 2001
From: raid5atemyhomework <raid5atemyhomework@protonmail.com>
Date: Wed, 6 Jan 2021 08:15:54 +0800
Subject: [PATCH 2/4] gnu: Make file-systems target extensible by services.

* gnu/services/base.scm (file-system-shepherd-services): Move file-systems
shepherd service to ...
(file-systems-target-shepherd-services): ... new procedure here.
(file-systems-target-service-type): New variable.
(file-system-service-type): Extend file-systems-target service to add each
file-system as a requirement.
* gnu/system.scm (operating-system-default-essential-services): Instantiate
file-systems-target-service-type.
(hurd-default-essential-services): Instantiate file-systems-target-service-type.
---
 gnu/services/base.scm | 37 +++++++++++++++++++++++++++----------
 gnu/system.scm        |  2 ++
 2 files changed, 29 insertions(+), 10 deletions(-)

diff --git a/gnu/services/base.scm b/gnu/services/base.scm
index 945b546607..13cfb6a8a2 100644
--- a/gnu/services/base.scm
+++ b/gnu/services/base.scm
@@ -13,6 +13,7 @@
 ;;; Copyright © 2019 Jan (janneke) Nieuwenhuizen <janneke@gnu.org>
 ;;; Copyright © 2020 Florian Pelz <pelzflorian@pelzflorian.de>
 ;;; Copyright © 2020 Brice Waegeneire <brice@waegenei.re>
+;;; Copyright © 2021 raid5atemyhomework <raid5atemyhomework@protonmail.com>
 ;;;
 ;;; This file is part of GNU Guix.
 ;;;
@@ -67,6 +68,7 @@
   #:export (fstab-service-type
             root-file-system-service
             file-system-service-type
+            file-systems-target-service-type
             swap-service
             host-name-service
             console-keymap-service
@@ -362,18 +364,29 @@ FILE-SYSTEM."
                        (gnu system file-systems)
                        ,@%default-modules)))))))

+(define (file-systems-target-shepherd-services requirements)
+  (list
+    (shepherd-service
+      (provision '(file-systems))
+      (requirement (cons* 'root-file-system 'user-file-systems requirements))
+      (documentation "Target for all the initially-mounted file systems")
+      (start #~(const #t))
+      (stop #~(const #t)))))
+(define file-systems-target-service-type
+  (service-type
+    (name 'file-systems)
+    (extensions (list (service-extension shepherd-root-service-type
+                                         file-systems-target-shepherd-services)))
+    (compose concatenate)
+    (extend append)
+    ;; Extensions can add new values to this list.
+    (default-value '())
+    (description "The @code{file-systems} service is the target that is started
+when all file systems have been mounted.")))
+
 (define (file-system-shepherd-services file-systems)
   "Return the list of Shepherd services for FILE-SYSTEMS."
   (let* ((file-systems (filter file-system-mount? 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)))
-       (documentation "Target for all the initially-mounted file systems")
-       (start #~(const #t))
-       (stop #~(const #f))))

     (define known-mount-points
       (map file-system-mount-point file-systems))
@@ -403,7 +416,7 @@ FILE-SYSTEM."
                            (filter (negate known?) (mount-points)))
                  #f))))

-    (cons* sink user-unmount
+    (cons* user-unmount
            (map file-system-shepherd-service file-systems))))

 (define (file-system-fstab-entries file-systems)
@@ -431,6 +444,10 @@ FILE-SYSTEM."
                        (service-extension fstab-service-type
                                           file-system-fstab-entries)

+                       ;; Have 'file-systems' depend on each declared file system.
+                       (service-extension file-systems-target-service-type
+                                          (cut map file-system->shepherd-service-name <>))
+
                        ;; Have 'user-processes' depend on 'file-systems'.
                        (service-extension user-processes-service-type
                                           (const '(file-systems)))))
diff --git a/gnu/system.scm b/gnu/system.scm
index 5c530f176e..6987641ee8 100644
--- a/gnu/system.scm
+++ b/gnu/system.scm
@@ -667,6 +667,7 @@ bookkeeping."
                     (operating-system-setuid-programs os))
            (service profile-service-type
                     (operating-system-packages os))
+           (service file-systems-target-service-type)
            other-fs
            (append mappings swaps

@@ -691,6 +692,7 @@ bookkeeping."
                                    (operating-system-groups os))
                            (operating-system-skeletons os))
           (root-file-system-service)
+          (service file-systems-target-service-type)
           (service file-system-service-type '())
           (service fstab-service-type
                    (filter file-system-needed-for-boot?
--
2.29.2





  parent reply	other threads:[~2021-01-06 15:56 UTC|newest]

Thread overview: 81+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-01-06 15:52 [bug#45692] [PATCH 0/4] Even Better ZFS Support on Guix raid5atemyhomework via Guix-patches via
2021-01-06 15:54 ` [bug#45692] [PATCH 1/4] gnu: Allow services to install kernel-loadable modules raid5atemyhomework via Guix-patches via
2021-01-08 16:16   ` raid5atemyhomework via Guix-patches via
2021-02-10 14:13   ` [bug#45692] [PATCH 0/4] Even Better ZFS Support on Guix Ludovic Courtès
2021-02-10 15:44   ` Ludovic Courtès
2021-02-10 16:49     ` raid5atemyhomework via Guix-patches via
2021-01-06 15:55 ` raid5atemyhomework via Guix-patches via [this message]
2021-01-23 13:05   ` [bug#45692] [PATCH 2/4] gnu: Make file-systems target extensible by services 宋文武
2021-01-25  0:18     ` guix-patches--- via
2021-02-10 14:17       ` [bug#45692] [PATCH 0/4] Even Better ZFS Support on Guix Ludovic Courtès
2021-02-10 14:46         ` raid5atemyhomework via Guix-patches via
2021-01-06 15:56 ` [bug#45692] [PATCH 3/4] gnu: Fix ZFS package raid5atemyhomework via Guix-patches via
2021-01-07  8:23   ` Danny Milosavljevic
2021-01-06 15:57 ` [bug#45692] [PATCH 4/4] gnu: Add ZFS service raid5atemyhomework via Guix-patches via
2021-01-06 19:41   ` [bug#45703] kernel-module-configuration-service for configuring kernel parameters Danny Milosavljevic
2021-01-07  0:04     ` raid5atemyhomework via Guix-patches via
2021-01-07  5:38       ` [bug#45692] " raid5atemyhomework via Guix-patches via
2021-01-07  9:16         ` [bug#42193] " raid5atemyhomework via Guix-patches via
2021-01-08 15:02   ` [bug#45692] [PATCH 4/4] gnu: Add ZFS service raid5atemyhomework via Guix-patches via
2021-01-09  8:31     ` raid5atemyhomework via Guix-patches via
2021-02-08  3:31       ` Danny Milosavljevic
2021-02-08  6:25         ` raid5atemyhomework via Guix-patches via
2021-02-10 14:27     ` [bug#45692] [PATCH 0/4] Even Better ZFS Support on Guix Ludovic Courtès
2021-02-10 14:32       ` raid5atemyhomework via Guix-patches via
2021-02-13  1:49       ` raid5atemyhomework via Guix-patches via
2021-03-22 14:33 ` [bug#45692] [PATCH v3 0/3] New patch series for " raid5atemyhomework via Guix-patches via
2021-03-28 12:55   ` Léo Le Bouter via Guix-patches via
2021-03-29  4:39     ` raid5atemyhomework via Guix-patches via
2021-07-23 15:11       ` raid5atemyhomework via Guix-patches via
2021-03-22 14:33 ` [bug#45692] [PATCH v3 1/3] gnu: Allow services to install kernel-loadable modules raid5atemyhomework via Guix-patches via
2021-05-11 14:17   ` Danny Milosavljevic
2021-03-22 14:34 ` [bug#45692] [PATCH v3 2/3] gnu: Add zfs-auto-snapshot raid5atemyhomework via Guix-patches via
2021-05-11 14:05   ` Danny Milosavljevic
2021-05-13  1:21     ` raid5atemyhomework via Guix-patches via
2021-05-13 13:08       ` Danny Milosavljevic
2021-03-22 14:35 ` [bug#45692] [PATCH v3 3/3] gnu: Add ZFS service type raid5atemyhomework via Guix-patches via
2021-07-25 14:03   ` raid5atemyhomework via Guix-patches via
2021-07-25 14:31 ` [bug#45692] [PATCH v4 " raid5atemyhomework via Guix-patches via
2021-08-01  9:41   ` raid5atemyhomework via Guix-patches via
2021-08-10 11:43     ` raid5atemyhomework via Guix-patches via
2021-08-31  0:48       ` raid5atemyhomework via Guix-patches via
2021-09-02 20:57   ` Maxime Devos
2021-09-02 22:22     ` Maxime Devos
2021-09-03 12:41       ` raid5atemyhomework via Guix-patches via
2021-09-04 18:58     ` raid5atemyhomework via Guix-patches via
2021-09-06  8:08     ` zimoun
2021-09-06 10:40       ` Maxime Devos
2021-09-06 11:08         ` raid5atemyhomework via Guix-patches via
2021-09-06 17:17         ` zimoun
2021-09-07  9:54           ` Maxime Devos
2021-09-08  1:23             ` raid5atemyhomework via Guix-patches via
2021-09-15 14:04               ` raid5atemyhomework via Guix-patches via
2021-09-21  9:42                 ` zimoun
2021-09-04 21:19   ` Xinglu Chen
2021-09-06 10:52     ` raid5atemyhomework via Guix-patches via
2021-09-06 14:22       ` Xinglu Chen
2021-09-02 21:24 ` [bug#45692] Gaslighting Mason Loring Bliss
2021-09-03 12:22   ` Maxime Devos
2021-09-06  7:59   ` [bug#45692] zimoun
2021-09-30 14:56 ` [bug#45692] [PATCH v5 3/3] gnu: Add ZFS service type raid5atemyhomework via Guix-patches via
2021-10-19 13:18   ` raid5atemyhomework via Guix-patches via
2021-10-27  7:30     ` raid5atemyhomework via Guix-patches via
2021-10-27 16:38       ` pelzflorian (Florian Pelz)
2021-11-30 15:26         ` raid5atemyhomework via Guix-patches via
2021-12-12 13:32           ` raid5atemyhomework via Guix-patches via
2021-12-21 21:15             ` [bug#45643] [PATCH 0/3] Better Support for ZFS on Guix Brice Waegeneire
2022-01-01 11:59               ` [bug#45692] bug#45643: " raid5atemyhomework via Guix-patches via
2022-01-19 14:24                 ` raid5atemyhomework via Guix-patches via
2022-01-07  4:21 ` [bug#45692] " raid5atemyhomework via Guix-patches via
2022-02-14 14:10   ` raid5atemyhomework via Guix-patches via
2022-02-18  7:13     ` raid5atemyhomework via Guix-patches via
2022-03-16 23:44       ` raid5atemyhomework via Guix-patches via
2022-03-17  8:24       ` Liliana Marie Prikler
2022-03-17 17:22         ` Maxime Devos
2022-03-17 18:38           ` zimoun
2022-03-17 19:10             ` Maxime Devos
2022-03-19 14:24           ` raid5atemyhomework via Guix-patches via
2022-03-20  4:42             ` Maxim Cournoyer
2022-03-19 14:09         ` raid5atemyhomework via Guix-patches via
2022-03-19 16:22           ` Leo Famulari
2022-03-19 14:25 ` [bug#45692] (No Subject) raid5atemyhomework via Guix-patches via

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='Mg_8FIL2l-Zd7f6rM0kLocdknqSlZfYwXsKBY88f0vqvn_pqTW3otQGnYeTcg1SLbUXuzsO0P5-O35udXT5-c-gzr21W0E0XEYTAbAkdlpI=@protonmail.com' \
    --to=guix-patches@gnu.org \
    --cc=45692@debbugs.gnu.org \
    --cc=raid5atemyhomework@protonmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/guix.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.