about summary refs log tree commit diff
path: root/nixos
diff options
context:
space:
mode:
authorEelco Dolstra <eelco.dolstra@logicblox.com>2014-08-12 02:51:20 +0200
committerEelco Dolstra <eelco.dolstra@logicblox.com>2014-08-12 03:13:32 +0200
commitb99af5579ef3c132acade1f2f4e420ca3bb51abd (patch)
tree932a999e53b080a3bdddf68e2e1b48ae0fef85f6 /nixos
parent04ec038e892139ba9df3e5a435e8a7b0db2ca805 (diff)
downloadnixlib-b99af5579ef3c132acade1f2f4e420ca3bb51abd.tar
nixlib-b99af5579ef3c132acade1f2f4e420ca3bb51abd.tar.gz
nixlib-b99af5579ef3c132acade1f2f4e420ca3bb51abd.tar.bz2
nixlib-b99af5579ef3c132acade1f2f4e420ca3bb51abd.tar.lz
nixlib-b99af5579ef3c132acade1f2f4e420ca3bb51abd.tar.xz
nixlib-b99af5579ef3c132acade1f2f4e420ca3bb51abd.tar.zst
nixlib-b99af5579ef3c132acade1f2f4e420ca3bb51abd.zip
Containers: Don't remount /
Diffstat (limited to 'nixos')
-rw-r--r--nixos/modules/system/boot/stage-2-init.sh4
-rw-r--r--nixos/modules/virtualisation/container-config.nix2
2 files changed, 5 insertions, 1 deletions
diff --git a/nixos/modules/system/boot/stage-2-init.sh b/nixos/modules/system/boot/stage-2-init.sh
index fcefdfa88a36..6fff776f8581 100644
--- a/nixos/modules/system/boot/stage-2-init.sh
+++ b/nixos/modules/system/boot/stage-2-init.sh
@@ -29,7 +29,9 @@ setPath "@path@"
 # Normally, stage 1 mounts the root filesystem read/writable.
 # However, in some environments, stage 2 is executed directly, and the
 # root is read-only.  So make it writable here.
-mount -n -o remount,rw none /
+if [ "$container" != systemd-nspawn ]; then
+    mount -n -o remount,rw none /
+fi
 
 
 # Likewise, stage 1 mounts /proc, /dev and /sys, so if we don't have a
diff --git a/nixos/modules/virtualisation/container-config.nix b/nixos/modules/virtualisation/container-config.nix
index b81f97f2b4ec..84e3aa283520 100644
--- a/nixos/modules/virtualisation/container-config.nix
+++ b/nixos/modules/virtualisation/container-config.nix
@@ -89,6 +89,8 @@ with lib;
         restartIfChanged = false;
       };
 
+    systemd.services.systemd-remount-fs.enable = false;
+
   };
 
 }