[grubcfg] Avoid UnboundLocal, always set zfs_root_path to something

This commit is contained in:
Adriaan de Groot 2021-11-16 17:22:43 +01:00
parent 8233be93cf
commit b0d951d7e5

View File

@ -117,6 +117,8 @@ def modify_grub_default(partitions, root_mount_point, distributor):
swap_outer_mappername = None swap_outer_mappername = None
no_save_default = False no_save_default = False
unencrypted_separate_boot = any(p["mountPoint"] == "/boot" and "luksMapperName" not in p for p in partitions) unencrypted_separate_boot = any(p["mountPoint"] == "/boot" and "luksMapperName" not in p for p in partitions)
# If there is no dracut, and the root partition is ZFS, this gets set below
zfs_root_path = None
for partition in partitions: for partition in partitions:
if partition["mountPoint"] in ("/", "/boot") and partition["fs"] in ("btrfs", "f2fs"): if partition["mountPoint"] in ("/", "/boot") and partition["fs"] in ("btrfs", "f2fs"):