nixos-install: fix removal of non-empty /mnt
After building the target system, `nixos-install` tries to remove `/mnt` on the target filesystem. And the script may fail without any explanation, if `/mnt` isn't empty. This commit makes the installation process carry on even if there are files under `/mnt`. See https://github.com/NixOS/nixpkgs/issues/244643.
This commit is contained in:
parent
3580ac6c65
commit
d61cc625fa
@ -206,7 +206,7 @@ if [[ -z $noBootLoader ]]; then
|
|||||||
mount --rbind --mkdir / "$mountPoint"
|
mount --rbind --mkdir / "$mountPoint"
|
||||||
mount --make-rslave "$mountPoint"
|
mount --make-rslave "$mountPoint"
|
||||||
/run/current-system/bin/switch-to-configuration boot
|
/run/current-system/bin/switch-to-configuration boot
|
||||||
umount -R "$mountPoint" && rmdir "$mountPoint"
|
umount -R "$mountPoint" && (rmdir "$mountPoint" 2>/dev/null || true)
|
||||||
EOF
|
EOF
|
||||||
)"
|
)"
|
||||||
fi
|
fi
|
||||||
|
Loading…
Reference in New Issue
Block a user