Revert "nixos/stage2: Check for each special mount individually and mount missing ones. (#21370)"

This reverts commit 712e62c260.

This commit broke NixOS containers. Systemd wouldn't detect if a container
started successfully and would kill it again after a grace period.

Additionally this prints mount errors due to already mounted filesystems
at boot.
This commit is contained in:
Franz Pletz 2017-01-10 17:29:19 +01:00
parent 9d35918f1a
commit e4fb2bb0c5
No known key found for this signature in database
GPG Key ID: 846FDED7792617B4

View File

@ -34,24 +34,20 @@ if [ -z "$container" ]; then
fi fi
# Likewise, stage 1 mounts /proc, /dev, /sys and /run, 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.
# We check for each mountpoint separately to avoid esoteric failure modes if [ ! -e /proc/1 ]; then
# if only a subset was mounted by whatever called us. specialMount() {
specialMount() { local device="$1"
local device="$1" local mountPoint="$2"
local mountPoint="$2" local options="$3"
local options="$3" local fsType="$4"
local fsType="$4"
if mountpoint -q "$mountpoint"; then mkdir -m 0755 -p "$mountPoint"
return 0 mount -n -t "$fsType" -o "$options" "$device" "$mountPoint"
fi }
source @earlyMountScript@
mkdir -m 0755 -p "$mountPoint" fi
mount -n -t "$fsType" -o "$options" "$device" "$mountPoint"
}
source @earlyMountScript@
echo "booting system configuration $systemConfig" > /dev/kmsg echo "booting system configuration $systemConfig" > /dev/kmsg