better server UI behaviour when all core boot options disallowed

This commit is contained in:
Michael Hudson-Doyle 2023-09-04 16:31:32 +12:00
parent 8e9cf1f3c3
commit c03f0ba4f4
2 changed files with 10 additions and 0 deletions

View File

@ -419,6 +419,7 @@ class FilesystemController(SubiquityController, FilesystemManipulator):
info.capability_info.disallow_if(
lambda cap: cap.is_core_boot(),
GuidedDisallowedCapabilityReason.NOT_UEFI,
"Enhanced secure boot options only available on UEFI systems.",
)
self._variation_info[name] = info
elif catalog_entry.type.startswith("dd-"):

View File

@ -235,6 +235,15 @@ class GuidedChoiceForm(SubForm):
self.use_tpm.help = self.tpm_choice.help
self.use_tpm.help = self.tpm_choice.help.format(reason=reason)
else:
self.use_tpm.enabled = False
core_boot_disallowed = [
d for d in val.disallowed if d.capability.is_core_boot()
]
if core_boot_disallowed:
self.use_tpm.help = core_boot_disallowed[0].message
else:
self.use_tpm.help = ""
self.tpm_choice = None
def _toggle_lvm(self, sender, val):