Merge pull request #1541 from dbungert/more-fde-strings

More fde strings
This commit is contained in:
Dan Bungert 2023-02-14 15:51:47 -07:00 committed by GitHub
commit 25aaf00792
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 40 additions and 35 deletions

View File

@ -96,20 +96,21 @@ log = logging.getLogger("subiquity.server.controllers.filesystem")
block_discover_log = logging.getLogger('block-discover') block_discover_log = logging.getLogger('block-discover')
system_defective_encryption_text = _(""" # for translators: 'reason' is the reason FDE is unavailable.
The model being installed requires TPM-backed encryption but this system_defective_encryption_text = _(
system does not support it (the reason given was "{unavailable_reason}"). "TPM backed full-disk encryption is not available "
""") "on this device (the reason given was \"{reason}\")."
)
system_multiple_volumes_text = _(""" system_multiple_volumes_text = _(
The model being installed defines multiple volumes, which is not currently "TPM backed full-disk encryption is not yet supported when "
supported. "the target spans multiple volumes."
""") )
system_non_gpt_text = _(""" system_non_gpt_text = _(
The model being installed defines a volume with a partition table type other "TPM backed full-disk encryption is only supported with a target volume "
than GPT, which is not currently supported. "partition table of GPT."
""") )
class NoSnapdSystemsOnSource(Exception): class NoSnapdSystemsOnSource(Exception):
@ -218,7 +219,7 @@ class FilesystemController(SubiquityController, FilesystemManipulator):
if se.support == StorageEncryptionSupport.DEFECTIVE: if se.support == StorageEncryptionSupport.DEFECTIVE:
self._core_boot_classic_error = \ self._core_boot_classic_error = \
system_defective_encryption_text.format( system_defective_encryption_text.format(
unavailable_reason=se.unavailable_reason) reason=se.unavailable_reason)
if se.support == StorageEncryptionSupport.UNAVAILABLE: if se.support == StorageEncryptionSupport.UNAVAILABLE:
log.debug( log.debug(
"storage encryption unavailable: %r", se.unavailable_reason) "storage encryption unavailable: %r", se.unavailable_reason)

View File

@ -129,41 +129,45 @@ class TPMChoice:
help: str help: str
tpm_help_texts = {
"DISABLED":
_("TPM backed full-disk encryption has been disabled."),
"AVAILABLE_CAN_BE_DESELECTED":
_("The entire disk will be encrypted and protected by the "
"TPM. If this option is deselected, the disk will be "
"unencrypted and without any protection."),
"AVAILABLE_CANNOT_BE_DESELECTED":
_("The entire disk will be encrypted and protected by the TPM."),
"UNAVAILABLE":
# for translators: 'reason' is the reason FDE is unavailable.
_("TPM backed full-disk encryption is not available "
"on this device (the reason given was \"{reason}\")."),
}
choices = { choices = {
StorageEncryptionSupport.DISABLED: { StorageEncryptionSupport.DISABLED: {
safety: TPMChoice( safety: TPMChoice(
enabled=False, default=False, enabled=False, default=False,
help=_("The model being installed does not support TPM backed " help=tpm_help_texts['DISABLED'])
"full-disk encryption")) for safety in StorageSafety for safety in StorageSafety
}, },
StorageEncryptionSupport.AVAILABLE: { StorageEncryptionSupport.AVAILABLE: {
StorageSafety.ENCRYPTED: TPMChoice( StorageSafety.ENCRYPTED: TPMChoice(
enabled=False, default=True, enabled=False, default=True,
help=_("The model being installed requires TPM backed full-disk " help=tpm_help_texts['AVAILABLE_CANNOT_BE_DESELECTED']),
"encryption")),
StorageSafety.PREFER_ENCRYPTED: TPMChoice( StorageSafety.PREFER_ENCRYPTED: TPMChoice(
enabled=True, default=True, enabled=True, default=True,
help=_("The entire disk will be encrypted and protected by the " help=tpm_help_texts['AVAILABLE_CAN_BE_DESELECTED']),
"TPM. If this option is deselected, the disk will be "
"unencrypted and without any protection.")),
StorageSafety.PREFER_UNENCRYPTED: TPMChoice( StorageSafety.PREFER_UNENCRYPTED: TPMChoice(
enabled=True, default=False, enabled=True, default=False,
help=_("The model being installed does not prefer but allows TPM " help=tpm_help_texts['AVAILABLE_CAN_BE_DESELECTED']),
"backed full-disk encryption")), },
},
StorageEncryptionSupport.UNAVAILABLE: { StorageEncryptionSupport.UNAVAILABLE: {
StorageSafety.PREFER_ENCRYPTED: TPMChoice( safety: TPMChoice(
enabled=False, default=False, enabled=False, default=False,
help=_("The model being installed prefers but does not require " help=tpm_help_texts['UNAVAILABLE'])
"TPM backed full-disk encryption and it is not available " for safety in StorageSafety
"on this device (the reason given was \"{reason}\").")), },
StorageSafety.PREFER_UNENCRYPTED: TPMChoice(
enabled=False, default=False,
# for translators: 'reason' is the reason FDE is unavailable.
help=_("The model being installed does not prefer TPM backed "
"full-disk encryption and it is not available on this "
"device (the reason given was \"{reason}\").")),
},
# StorageEncryptionSupport.DEFECTIVE: handled in controller code # StorageEncryptionSupport.DEFECTIVE: handled in controller code
} }