summary refs log tree commit diff
diff options
context:
space:
mode:
authorAndrew J. Hesford <ajh@sideband.org>2020-01-27 10:39:01 -0500
committerAndrew J. Hesford <48421688+ahesford@users.noreply.github.com>2020-07-12 08:17:21 -0400
commita93b8b92e215ce1934cea364db1b68f099b902f3 (patch)
treebbb61e6b90360b79f73d80409fedb34bb1744083
parent6b56c7a13778e1079076a8c56e243e850be841dd (diff)
downloadrunit-void-a93b8b92e215ce1934cea364db1b68f099b902f3.tar.gz
runit-void-a93b8b92e215ce1934cea364db1b68f099b902f3.tar.xz
runit-void-a93b8b92e215ce1934cea364db1b68f099b902f3.zip
core-services/00-pseudofs.sh: mount cgroup v2 unified file system
-rw-r--r--core-services/00-pseudofs.sh4
1 files changed, 4 insertions, 0 deletions
diff --git a/core-services/00-pseudofs.sh b/core-services/00-pseudofs.sh
index 1ae7398..8fe1257 100644
--- a/core-services/00-pseudofs.sh
+++ b/core-services/00-pseudofs.sh
@@ -11,6 +11,10 @@ mountpoint -q /dev/shm || mount -o mode=1777,nosuid,nodev -n -t tmpfs shm /dev/s
 mountpoint -q /sys/kernel/security || mount -n -t securityfs securityfs /sys/kernel/security
 
 if [ -z "$VIRTUALIZATION" ]; then
+    # cgroup v1
     mountpoint -q /sys/fs/cgroup || mount -o mode=0755 -t tmpfs cgroup /sys/fs/cgroup
     awk '$4 == 1 { system("mountpoint -q /sys/fs/cgroup/" $1 " || { mkdir -p /sys/fs/cgroup/" $1 " && mount -t cgroup -o " $1 " cgroup /sys/fs/cgroup/" $1 " ;}" ) }' /proc/cgroups
+    # cgroup v2
+    mkdir -p /sys/fs/cgroup/unified
+    mountpoint -q /sys/fs/cgroup/unified || mount -t cgroup2 -o nsdelegate cgroup2 /sys/fs/cgroup/unified
 fi