summary refs log tree commit diff
path: root/gnu/system/file-systems.scm
diff options
context:
space:
mode:
authorDavid Thompson <davet@gnu.org>2015-06-18 20:40:57 -0400
committerDavid Thompson <davet@gnu.org>2015-06-19 07:49:18 -0400
commit727636aaf88db0de3c918dcd84c907e6407f8f50 (patch)
treec8df15c0a140b2764af61af82862a62b0a1dc062 /gnu/system/file-systems.scm
parent5fd77f3f437e9a648adc18efa8eb753b17915c9e (diff)
downloadguix-727636aaf88db0de3c918dcd84c907e6407f8f50.tar.gz
gnu: Add control group file systems.
* gnu/system/file-systems.scm (%control-groups): New variable.
  (%base-file-system): Include control group file systems.
Diffstat (limited to 'gnu/system/file-systems.scm')
-rw-r--r--gnu/system/file-systems.scm27
1 files changed, 23 insertions, 4 deletions
diff --git a/gnu/system/file-systems.scm b/gnu/system/file-systems.scm
index db861baed2..05c77fe3e8 100644
--- a/gnu/system/file-systems.scm
+++ b/gnu/system/file-systems.scm
@@ -39,6 +39,7 @@
             %pseudo-terminal-file-system
             %devtmpfs-file-system
             %immutable-store
+            %control-groups
 
             %base-file-systems
 
@@ -152,13 +153,31 @@ file system."
     (check? #f)
     (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"))))
+
 (define %base-file-systems
   ;; List of basic file systems to be mounted.  Note that /proc and /sys are
   ;; currently mounted by the initrd.
-  (list %devtmpfs-file-system
-        %pseudo-terminal-file-system
-        %shared-memory-file-system
-        %immutable-store))
+  (append (list %devtmpfs-file-system
+                %pseudo-terminal-file-system
+                %shared-memory-file-system
+                %immutable-store)
+          %control-groups))