summary refs log tree commit diff
path: root/nixos/modules/system/boot/stage-2-init.sh
diff options
context:
space:
mode:
authorRickard Nilsson <rickynils@gmail.com>2016-09-07 07:38:35 +0000
committerRickard Nilsson <rickynils@gmail.com>2016-09-07 07:50:04 +0000
commitab9537ca22ce3fd4efc1795c58105504022d0c48 (patch)
treebb89bcc4adfc009c4ef8c4f20cf676fea3c34890 /nixos/modules/system/boot/stage-2-init.sh
parent5f6557d43769230dce07bd873c17c1180f7eddc1 (diff)
downloadnixpkgs-ab9537ca22ce3fd4efc1795c58105504022d0c48.tar
nixpkgs-ab9537ca22ce3fd4efc1795c58105504022d0c48.tar.gz
nixpkgs-ab9537ca22ce3fd4efc1795c58105504022d0c48.tar.bz2
nixpkgs-ab9537ca22ce3fd4efc1795c58105504022d0c48.tar.lz
nixpkgs-ab9537ca22ce3fd4efc1795c58105504022d0c48.tar.xz
nixpkgs-ab9537ca22ce3fd4efc1795c58105504022d0c48.tar.zst
nixpkgs-ab9537ca22ce3fd4efc1795c58105504022d0c48.zip
nixos: Generalise the container tests in stage-2 boot
This way, stage-2 behaves correctly also for libvirt-lxc containers.

Some more discussion on this:
https://github.com/NixOS/nixpkgs/commit/a7a08188bf650ababa36300a9a6f34169e2a73bf
https://github.com/NixOS/nixpkgs/commit/bfe46a653ba2f8ff9902128f485cbd87c49cbca7
Diffstat (limited to 'nixos/modules/system/boot/stage-2-init.sh')
-rw-r--r--nixos/modules/system/boot/stage-2-init.sh4
1 files changed, 2 insertions, 2 deletions
diff --git a/nixos/modules/system/boot/stage-2-init.sh b/nixos/modules/system/boot/stage-2-init.sh
index 704150e77d7..590c2b9a141 100644
--- a/nixos/modules/system/boot/stage-2-init.sh
+++ b/nixos/modules/system/boot/stage-2-init.sh
@@ -29,14 +29,14 @@ 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.
-if [ "$container" != systemd-nspawn ]; then
+if [ -z "$container" ]; then
     mount -n -o remount,rw none /
 fi
 
 
 # Likewise, stage 1 mounts /proc, /dev and /sys, so if we don't have a
 # stage 1, we need to do that here.
-if [ ! -e /proc/1 ]; then
+if [ ! -e /proc/1 ] || [ -n "$container" ]; then
     specialMount() {
         local device="$1"
         local mountPoint="$2"