git.iko.soy/typeable/nixpkgs
on master help sign in
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

commitab9537ca22ce3fd4efc1795c58105504022d0c48 authorRickard Nilsson <rickynils@gmail.com> dateWed 7 Sep 2016, 07:38 (10 years ago) parent5f6557d
1 file changed+2−2
nixos/modules/system/boot/stage-2-init.sh+2−2
nixos/modules/system/boot/stage-2-init.sh+2−2
@@ -29,14 +29,14 @@ setPath "@path@"
2929# Normally, stage 1 mounts the root filesystem read/writable.
3030# However, in some environments, stage 2 is executed directly, and the
3131# root is read-only. So make it writable here.
32−if [ "$container" != systemd-nspawn ]; then
32+if [ -z "$container" ]; then
3333 mount -n -o remount,rw none /
3434fi
3535
3636
3737# Likewise, stage 1 mounts /proc, /dev and /sys, so if we don't have a
3838# stage 1, we need to do that here.
39−if [ ! -e /proc/1 ]; then
39+if [ ! -e /proc/1 ] || [ -n "$container" ]; then
4040 specialMount() {
4141 local device="$1"
4242 local mountPoint="$2"