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
This commit is contained in:
@@ -29,14 +29,14 @@ setPath "@path@"
|
|||||||
# Normally, stage 1 mounts the root filesystem read/writable.
|
# Normally, stage 1 mounts the root filesystem read/writable.
|
||||||
# However, in some environments, stage 2 is executed directly, and the
|
# However, in some environments, stage 2 is executed directly, and the
|
||||||
# root is read-only. So make it writable here.
|
# root is read-only. So make it writable here.
|
||||||
if [ "$container" != systemd-nspawn ]; then
|
if [ -z "$container" ]; then
|
||||||
mount -n -o remount,rw none /
|
mount -n -o remount,rw none /
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
|
||||||
# Likewise, stage 1 mounts /proc, /dev and /sys, so if we don't have a
|
# Likewise, stage 1 mounts /proc, /dev and /sys, so if we don't have a
|
||||||
# stage 1, we need to do that here.
|
# stage 1, we need to do that here.
|
||||||
if [ ! -e /proc/1 ]; then
|
if [ ! -e /proc/1 ] || [ -n "$container" ]; then
|
||||||
specialMount() {
|
specialMount() {
|
||||||
local device="$1"
|
local device="$1"
|
||||||
local mountPoint="$2"
|
local mountPoint="$2"
|
||||||
|
|||||||
Reference in New Issue
Block a user