nixos/activation: Avoid remounting non-existing FS
Regression introduced by 79d4636d506094eae3c5c7575a0bef817cba9bda.
The mentioned commit moves /run/keys from stage 2 to
boot.specialFileSystems, the latter being remounted during system
activation.
Unfortunately, the specialMount function in the activation script does
this unconditionally and thus will fail if it can't be remounted because
the mount point simply doesn't exist.
We now check the mount point for existance and only remount if it exists
but mkdir + mount it if it doesn't.
Tested against the "simple" NixOS installer test.
Signed-off-by: aszlig <aszlig@redmoonstudios.org>
commitf94ea04805845d1d98e2a9ff1342c3aad196d3a1
authoraszlig <aszlig@redmoonstudios.org>
dateMon 26 Sep 2016, 01:54 (10 years ago)
parent8967a3f
nixos/modules/system/activation/activation-script.nix+6−1
@@ -167,7 +167,12 @@ in
167167 local options="$3"
168168 local fsType="$4"
169169
170− ${pkgs.utillinux}/bin/mount -t "$fsType" -o "remount,$options" "$device" "$mountPoint"
170+ if ${pkgs.utillinux}/bin/mountpoint -q "$mountPoint"; then
171+ local options="remount,$options"
172+ else
173+ mkdir -m 0755 -p "$mountPoint"
174+ fi
175+ ${pkgs.utillinux}/bin/mount -t "$fsType" -o "$options" "$device" "$mountPoint"
171176 }
172177 source ${config.system.build.earlyMountScript}
173178 '';