Skip to content

Conversation

@correctmost
Copy link
Contributor

@correctmost correctmost requested a review from Torxed as a code owner May 28, 2025 22:18
# TODO: We need to detect if the encrypted device is a whole disk encryption,
# or simply a partition encryption. Right now we assume it's a partition (and we always have)

if self._disk_encryption and self._disk_encryption.hsm_device:
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Line 1011 already assumes self._disk_encryption is not None

if result := plugin.on_user_created(self, user):
handled_by_plugin = result

if user.password:
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

user.password is a Password object

) as installation:
# Mount all the drives to the desired mountpoint
# This *can* be done outside of the installation, but the installer can deal with it.
if disk_config:
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There is an earlier check on line 34

return ViewportEntry(tr('Press Ctrl+h for help'), 0, 0, STYLE.NORMAL)

def _show_help(self) -> None:
if not self._help_window:
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

self._help_window is always initialized:

class AbstractCurses[ValueT](metaclass=ABCMeta):
def __init__(self) -> None:
self._help_window = self._set_help_viewport()


def _mirror_configuration(self, preset: MirrorConfiguration | None = None) -> MirrorConfiguration | None:
def _mirror_configuration(self, preset: MirrorConfiguration | None = None) -> MirrorConfiguration:
mirror_configuration = MirrorMenu(preset=preset).run()
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

MirrorMenu.run() always returns a MirrorConfiguration:

def run(self) -> MirrorConfiguration:
super().run()
return self._mirror_config

partition.invert_flag(PartitionFlag.ESP)
partition.invert_flag(PartitionFlag.XBOOTLDR)
case 'set_filesystem':
fs_type = self._prompt_partition_fs_type()
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

_prompt_partition_fs_type does not allow skipping or resetting:

def _prompt_partition_fs_type(self, prompt: str | None = None) -> FilesystemType:
fs_types = filter(lambda fs: fs != FilesystemType.Crypto_luks, FilesystemType)
items = [MenuItem(fs.value, value=fs) for fs in fs_types]
group = MenuItemGroup(items, sort_items=False)
result = SelectMenu[FilesystemType](
group,
header=prompt,
alignment=Alignment.CENTER,
frame=FrameProperties.min(tr('Filesystem')),
allow_skip=False,
).run()
match result.type_:
case ResultType.Selection:
return result.get_value()
case _:
raise ValueError('Unhandled result type')

@svartkanin svartkanin merged commit 3da78fc into archlinux:master May 29, 2025
9 checks passed
@correctmost correctmost deleted the cm/enable-truthy-bool-checks branch May 29, 2025 02:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants