diff --git a/archinstall/lib/disk/disk_menu.py b/archinstall/lib/disk/disk_menu.py index f8e8e2e3..82e3abe1 100644 --- a/archinstall/lib/disk/disk_menu.py +++ b/archinstall/lib/disk/disk_menu.py @@ -283,6 +283,7 @@ class DiskLayoutConfigurationMenu(AbstractSubMenu[DiskMenuConfig]): if enc_type != EncryptionType.NO_ENCRYPTION: output += tr('Iteration time') + f': {enc_config.iter_time or DEFAULT_ITER_TIME}ms\n' + output += tr('Cipher') + f': {enc_config.cipher.value}\n' if enc_config.partitions: output += f'Partitions: {len(enc_config.partitions)} selected\n' diff --git a/archinstall/lib/disk/encryption_menu.py b/archinstall/lib/disk/encryption_menu.py index 1a1b34bb..c669ec8a 100644 --- a/archinstall/lib/disk/encryption_menu.py +++ b/archinstall/lib/disk/encryption_menu.py @@ -431,14 +431,8 @@ async def select_iteration_time(preset: int | None = None) -> int | None: async def select_encryption_cipher(preset: EncryptionCipher | None = None) -> EncryptionCipher | None: - options = list(EncryptionCipher) - - if not preset: - preset = DEFAULT_CIPHER - - items = [MenuItem(o.value, value=o) for o in options] - group = MenuItemGroup(items) - group.set_focus_by_value(preset) + group = MenuItemGroup.from_enum(EncryptionCipher) + group.set_focus_by_value(preset or DEFAULT_CIPHER) result = await Selection[EncryptionCipher]( group, diff --git a/archinstall/lib/disk/luks.py b/archinstall/lib/disk/luks.py index c5f907a9..e014b688 100644 --- a/archinstall/lib/disk/luks.py +++ b/archinstall/lib/disk/luks.py @@ -150,9 +150,7 @@ class Luks2: try: SysCommand(f'cryptsetup close {self.mapper_name}') except SysCallError as close_err: - raise DiskError( - f'Could not close existing mapper "{self.mapper_name}" before unlock: {close_err}' - ) + raise DiskError(f'Could not close existing mapper "{self.mapper_name}" before unlock: {close_err}') key_file_arg, passphrase = self._get_passphrase_args(key_file) @@ -179,6 +177,7 @@ class Luks2: def lock(self) -> None: import time + umount(self.luks_dev_path) # Get crypt-information about the device by doing a reverse lookup starting with the partition path @@ -217,9 +216,7 @@ class Luks2: SysCommand(f'cryptsetup close --deferred {child.name}') debug(f'cryptsetup close --deferred issued for {child.name}') except SysCallError as deferred_err: - raise DiskError( - f'Could not close luks2 device "{child.name}": {deferred_err}' - ) from deferred_err + raise DiskError(f'Could not close luks2 device "{child.name}": {deferred_err}') from deferred_err # Wait until the mapper device node actually disappears before returning. # Subsequent commands (wipefs, mkfs, etc.) will fail with "Device busy" diff --git a/archinstall/lib/models/device.py b/archinstall/lib/models/device.py index 5b7659ce..b7f731cb 100644 --- a/archinstall/lib/models/device.py +++ b/archinstall/lib/models/device.py @@ -1523,11 +1523,8 @@ class DiskEncryption: if self.hsm_device: obj['hsm_device'] = self.hsm_device.json() - if self.iter_time != DEFAULT_ITER_TIME: # Only include if not default - obj['iter_time'] = self.iter_time - - if self.cipher != DEFAULT_CIPHER: # Only include if not default - obj['cipher'] = self.cipher.value + obj['iter_time'] = self.iter_time + obj['cipher'] = self.cipher.value return obj