From a9e9b704a3cddbe3491bff78c85aa79f2d4f2447 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B6rg=20Thalheim?= Date: Tue, 18 Jul 2023 15:29:47 +0200 Subject: [PATCH] skip zpool command if we don't have it installed for example not all installer will have it. --- src/nixos-anywhere.sh | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/nixos-anywhere.sh b/src/nixos-anywhere.sh index 9451b04..5ebf8fa 100755 --- a/src/nixos-anywhere.sh +++ b/src/nixos-anywhere.sh @@ -423,7 +423,9 @@ export PATH=\$PATH:/run/current-system/sw/bin mkdir -p /mnt/tmp chmod 777 /mnt/tmp nixos-install --no-root-passwd --no-channel-copy --system "$nixos_system" -zpool export -a || : # we always want to export the zfs pools so people can boot from it without force import +if command -v zpool >/dev/null; then + zpool export -a || : # we always want to export the zfs pools so people can boot from it without force import +fi # We will reboot in background so we can cleanly finish the script before the hosts go down. # This makes integration into scripts easier nohup bash -c '${maybe_reboot}' >/dev/null &