summaryrefslogtreecommitdiff
path: root/gnu/system/file-systems.scm
diff options
context:
space:
mode:
authorMark H Weaver <mhw@netris.org>2015-07-19 18:12:34 -0400
committerMark H Weaver <mhw@netris.org>2015-07-19 18:12:34 -0400
commit1b4e48d498a96d478baa1aae7d9c7ecdbd817d6f (patch)
tree4b650999e49a6f4d3dd116fab3f9ee8222247e07 /gnu/system/file-systems.scm
parentaa27987f71cb8afa698ede551e20b1248f160113 (diff)
parent50c7a1e297bff0935674b4f30e854a8889becfdd (diff)
Merge branch 'master' into core-updates
Diffstat (limited to 'gnu/system/file-systems.scm')
-rw-r--r--gnu/system/file-systems.scm47
1 files changed, 29 insertions, 18 deletions
diff --git a/gnu/system/file-systems.scm b/gnu/system/file-systems.scm
index ece8fb41e6..003eb443d1 100644
--- a/gnu/system/file-systems.scm
+++ b/gnu/system/file-systems.scm
@@ -37,6 +37,7 @@
file-system-options
file-system-check?
file-system-create-mount-point?
+ file-system-dependencies
file-system->spec
string->uuid
@@ -97,7 +98,10 @@
(check? file-system-check? ; Boolean
(default #t))
(create-mount-point? file-system-create-mount-point? ; Boolean
- (default #f)))
+ (default #f))
+ (dependencies file-system-dependencies ; list of strings (mount
+ ; points depended on)
+ (default '())))
(define-inlinable (file-system-needed-for-boot? fs)
"Return true if FS has the 'needed-for-boot?' flag set, or if it's the root
@@ -153,8 +157,10 @@ UUID representation."
((_ str)
(string? (syntax->datum #'str))
;; A literal string: do the conversion at expansion time.
- (with-syntax ((bv (string->uuid (syntax->datum #'str))))
- #''bv))
+ (let ((bv (string->uuid (syntax->datum #'str))))
+ (unless bv
+ (syntax-violation 'uuid "invalid UUID" s))
+ (datum->syntax #'str bv)))
((_ str)
#'(string->uuid str)))))
@@ -231,21 +237,26 @@ UUID representation."
(flags '(read-only bind-mount))))
(define %control-groups
- (cons (file-system
- (device "cgroup")
- (mount-point "/sys/fs/cgroup")
- (type "tmpfs")
- (check? #f))
- (map (lambda (subsystem)
- (file-system
- (device "cgroup")
- (mount-point (string-append "/sys/fs/cgroup/" subsystem))
- (type "cgroup")
- (check? #f)
- (options subsystem)
- (create-mount-point? #t)))
- '("cpuset" "cpu" "cpuacct" "memory" "devices" "freezer"
- "blkio" "perf_event" "hugetlb"))))
+ (let ((parent (file-system
+ (device "cgroup")
+ (mount-point "/sys/fs/cgroup")
+ (type "tmpfs")
+ (check? #f))))
+ (cons parent
+ (map (lambda (subsystem)
+ (file-system
+ (device "cgroup")
+ (mount-point (string-append "/sys/fs/cgroup/" subsystem))
+ (type "cgroup")
+ (check? #f)
+ (options subsystem)
+ (create-mount-point? #t)
+
+ ;; This must be mounted after, and unmounted before the
+ ;; parent directory.
+ (dependencies (list parent))))
+ '("cpuset" "cpu" "cpuacct" "memory" "devices" "freezer"
+ "blkio" "perf_event" "hugetlb")))))
(define %base-file-systems
;; List of basic file systems to be mounted. Note that /proc and /sys are