summary refs log tree commit diff
path: root/gnu/services
diff options
context:
space:
mode:
authorLudovic Courtès <ludo@gnu.org>2015-10-29 18:22:19 +0100
committerLudovic Courtès <ludo@gnu.org>2015-10-29 19:07:58 +0100
commite502bf8953afcd1e0cf29cd729e7c62c5c27792f (patch)
tree24a796b0e8beef91632b2d36f93fae32b2543c7d /gnu/services
parent362f496da9fc929d9548b8a56990779718b13c95 (diff)
downloadguix-e502bf8953afcd1e0cf29cd729e7c62c5c27792f.tar.gz
system: File systems depend on their corresponding device mappings.
Fixes a regression introduced in commit 0adfe95.

* gnu/system.scm (other-file-system-services)[requirements]: Remove.
  [add-dependencies]: New procedure.
  Use it.
* gnu/system/file-systems.scm (<file-system>)[dependencies]: Update
  comment.
* gnu/services/base.scm (mapped-device->dmd-service-name,
  dependency->dmd-service-name): New procedures.
  (file-system-service-type): Use it.
Diffstat (limited to 'gnu/services')
-rw-r--r--gnu/services/base.scm14
1 files changed, 13 insertions, 1 deletions
diff --git a/gnu/services/base.scm b/gnu/services/base.scm
index b8e8ccd5f1..604416b985 100644
--- a/gnu/services/base.scm
+++ b/gnu/services/base.scm
@@ -144,6 +144,18 @@ FILE-SYSTEM."
   (symbol-append 'file-system-
                  (string->symbol (file-system-mount-point file-system))))
 
+(define (mapped-device->dmd-service-name md)
+  "Return the symbol that denotes the dmd service of MD, a <mapped-device>."
+  (symbol-append 'device-mapping-
+                 (string->symbol (mapped-device-target md))))
+
+(define dependency->dmd-service-name
+  (match-lambda
+    ((? mapped-device? md)
+     (mapped-device->dmd-service-name md))
+    ((? file-system? fs)
+     (file-system->dmd-service-name fs))))
+
 (define file-system-service-type
   ;; TODO(?): Make this an extensible service that takes <file-system> objects
   ;; and returns a list of <dmd-service>.
@@ -160,7 +172,7 @@ FILE-SYSTEM."
        (dmd-service
         (provision (list (file-system->dmd-service-name file-system)))
         (requirement `(root-file-system
-                       ,@(map file-system->dmd-service-name dependencies)))
+                       ,@(map dependency->dmd-service-name dependencies)))
         (documentation "Check, mount, and unmount the given file system.")
         (start #~(lambda args
                    ;; FIXME: Use or factorize with 'mount-file-system'.