From bac46ad5e5b7fc26fcb972cceeca385568a29e1d Mon Sep 17 00:00:00 2001 From: themylogin Date: Thu, 23 Dec 2021 21:00:05 +0100 Subject: [PATCH] Do not crash on upgrading FreeBSD installations without `bootfs` property set --- truenas_install/__main__.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/truenas_install/__main__.py b/truenas_install/__main__.py index 69f104d..cdde582 100644 --- a/truenas_install/__main__.py +++ b/truenas_install/__main__.py @@ -356,7 +356,8 @@ def main(): # Set bootfs before running update-grub run_command(["zpool", "set", f"bootfs={dataset_name}", pool_name]) if is_freebsd_upgrade: - run_command(["zfs", "set", "truenas:12=1", old_bootfs_prop]) + if old_bootfs_prop != "-": + run_command(["zfs", "set", "truenas:12=1", old_bootfs_prop]) cp = run_command([f"{root}/usr/local/bin/truenas-initrd.py", root], check=False) if cp.returncode > 1: