From 624c07e8680501a00b3edd45476a6380127aaad7 Mon Sep 17 00:00:00 2001 From: Mark Nipper Date: Mon, 15 Apr 2024 01:37:27 -0700 Subject: Split core packages more, improve installer and set richese to minimal packages for testing --- scripts/install-with-disko | 19 ++++++++++++++++++- 1 file changed, 18 insertions(+), 1 deletion(-) (limited to 'scripts/install-with-disko') diff --git a/scripts/install-with-disko b/scripts/install-with-disko index 859a647..4a89676 100755 --- a/scripts/install-with-disko +++ b/scripts/install-with-disko @@ -28,10 +28,20 @@ if grep -q "data.keyfile" "${DIR}/../hosts/${TARGET_HOST}/disks.nix"; then while true; do echo -en "\n${TARGET_HOST} uses ZFS encryption. Enter a passphrase to encrypt your pool: " read -s pass - echo -e '\n' + echo if [[ "${#pass}" -lt 8 ]]; then echo 'ERROR! Passphrase must be at least 8 characters.' >&2 + continue + fi + + echo -n "Re-enter passphrase: " + read -s pass2 + echo -e '\n' + + if [[ "${pass}" != "${pass2}" ]]; then + echo 'ERROR! Passphrases must match.' >&2 + continue else break fi @@ -65,4 +75,11 @@ if [[ "${REPLY}" == "y" ]]; then sudo rsync -a --delete --exclude .git "${DIR}/.." /mnt/etc/nixos cd /mnt/etc/nixos sudo nixos-install --flake ".#${TARGET_HOST}" + + if [[ "${?}" -eq 0 ]]; then + cd + mount | grep -v zfs | awk '$3 ~ /^\/mnt\// {print $3}' | xargs -i{} sudo umount -lf {} + while ! sudo umount -t zfs -a; do echo 'attempting to umount all ZFS file systems' >&2; sleep 1; done + while ! sudo zpool export -a; do echo 'attempting to export all zpools' >&2; sleep 1; done + fi fi -- cgit v1.2.3