Skip to content

Commit d61cc62

Browse files
committed
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 #244643.
1 parent 3580ac6 commit d61cc62

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

nixos/modules/installer/tools/nixos-install.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -206,7 +206,7 @@ if [[ -z $noBootLoader ]]; then
206206
mount --rbind --mkdir / "$mountPoint"
207207
mount --make-rslave "$mountPoint"
208208
/run/current-system/bin/switch-to-configuration boot
209-
umount -R "$mountPoint" && rmdir "$mountPoint"
209+
umount -R "$mountPoint" && (rmdir "$mountPoint" 2>/dev/null || true)
210210
EOF
211211
)"
212212
fi

0 commit comments

Comments
 (0)