summaryrefslogtreecommitdiff
path: root/gnu/services
diff options
context:
space:
mode:
authorLudovic Courtès <ludo@gnu.org>2014-06-02 23:58:50 +0200
committerLudovic Courtès <ludo@gnu.org>2014-06-03 00:14:58 +0200
commitd4c87617e5c0c50573019e4621ed318489cf209a (patch)
tree5027b6bc308940b1c746f9081ace608bafb841a0 /gnu/services
parent2405858a0477aca880bb32c032df459de68e1bfd (diff)
system: File system sources can be marked as labels or devices.
* gnu/system/file-systems.scm (<file-system>)[title]: New field. * gnu/services/base.scm (file-system-service): Add #:title parameter. In 'start' gexp, use 'canonicalize-device-spec' and honor TITLE. * gnu/system.scm (other-file-system-services, operating-system-root-file-system, operating-system-initrd-file): Adjust accordingly. * gnu/system/linux-initrd.scm (file-system->spec): Likewise. * gnu/system/vm.scm (system-disk-image): Add 'title' field for the root file system. * guix/build/linux-initrd.scm (mount-file-system): Expect the second element of SPEC to be the title. (boot-system)[root-mount-point?, root-fs-type]: Likewise. * gnu/services/dmd.scm (dmd-configuration-file): Select 'canonicalize-device-spec'.
Diffstat (limited to 'gnu/services')
-rw-r--r--gnu/services/base.scm15
-rw-r--r--gnu/services/dmd.scm2
2 files changed, 10 insertions, 7 deletions
diff --git a/gnu/services/base.scm b/gnu/services/base.scm
index 3643f7cfc1..4442203524 100644
--- a/gnu/services/base.scm
+++ b/gnu/services/base.scm
@@ -89,9 +89,11 @@ This service must be the root of the service dependency graph so that its
(respawn? #f)))))
(define* (file-system-service device target type
- #:key (check? #t) options)
+ #:key (check? #t) options (title 'any))
"Return a service that mounts DEVICE on TARGET as a file system TYPE with
-OPTIONS. When CHECK? is true, check the file system before mounting it."
+OPTIONS. TITLE is a symbol specifying what kind of name DEVICE is: 'label for
+a partition label, 'device for a device file name, or 'any. When CHECK? is
+true, check the file system before mounting it."
(with-monad %store-monad
(return
(service
@@ -99,10 +101,11 @@ OPTIONS. When CHECK? is true, check the file system before mounting it."
(requirement '(root-file-system))
(documentation "Check, mount, and unmount the given file system.")
(start #~(lambda args
- #$(if check?
- #~(check-file-system #$device #$type)
- #~#t)
- (mount #$device #$target #$type 0 #$options)
+ (let ((device (canonicalize-device-spec #$device '#$title)))
+ #$(if check?
+ #~(check-file-system device #$type)
+ #~#t)
+ (mount device #$target #$type 0 #$options))
#t))
(stop #~(lambda args
;; Normally there are no processes left at this point, so
diff --git a/gnu/services/dmd.scm b/gnu/services/dmd.scm
index 982c196fe4..74adb27885 100644
--- a/gnu/services/dmd.scm
+++ b/gnu/services/dmd.scm
@@ -50,7 +50,7 @@
(use-modules (ice-9 ftw)
(guix build syscalls)
((guix build linux-initrd)
- #:select (check-file-system)))
+ #:select (check-file-system canonicalize-device-spec)))
(register-services
#$@(map (lambda (service)