Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 11 additions & 11 deletions archinstall/lib/disk/partitioning_menu.py
Original file line number Diff line number Diff line change
Expand Up @@ -323,17 +323,17 @@ def handle_action(
partition.invert_flag(PartitionFlag.XBOOTLDR)
case 'set_filesystem':
fs_type = self._prompt_partition_fs_type()
Copy link
Copy Markdown
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')

if fs_type:
if partition.is_swap():
partition.invert_flag(PartitionFlag.SWAP)
partition.fs_type = fs_type
if partition.is_swap():
partition.mountpoint = None
partition.flags = []
partition.set_flag(PartitionFlag.SWAP)
# btrfs subvolumes will define mountpoints
if fs_type == FilesystemType.Btrfs:
partition.mountpoint = None

if partition.is_swap():
partition.invert_flag(PartitionFlag.SWAP)
partition.fs_type = fs_type
if partition.is_swap():
partition.mountpoint = None
partition.flags = []
partition.set_flag(PartitionFlag.SWAP)
# btrfs subvolumes will define mountpoints
if fs_type == FilesystemType.Btrfs:
partition.mountpoint = None
case 'btrfs_mark_compressed':
self._toggle_mount_option(partition, BtrfsMountOption.compress)
case 'btrfs_mark_nodatacow':
Expand Down
17 changes: 8 additions & 9 deletions archinstall/lib/global_menu.py
Original file line number Diff line number Diff line change
Expand Up @@ -511,18 +511,17 @@ def _create_user_account(self, preset: list[User] | None = None) -> list[User]:
users = ask_for_additional_users(defined_users=preset)
return users

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
Copy Markdown
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


if mirror_configuration:
if mirror_configuration.optional_repositories:
# reset the package list cache in case the repository selection has changed
list_available_packages.cache_clear()
if mirror_configuration.optional_repositories:
# reset the package list cache in case the repository selection has changed
list_available_packages.cache_clear()

# enable the repositories in the config
pacman_config = PacmanConfig(None)
pacman_config.enable(mirror_configuration.optional_repositories)
pacman_config.apply()
# enable the repositories in the config
pacman_config = PacmanConfig(None)
pacman_config.enable(mirror_configuration.optional_repositories)
pacman_config.apply()

return mirror_configuration

Expand Down
7 changes: 3 additions & 4 deletions archinstall/lib/installer.py
Original file line number Diff line number Diff line change
Expand Up @@ -1012,7 +1012,7 @@ def _get_kernel_params_partition(
# 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
Copy Markdown
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 self._disk_encryption.hsm_device:
debug(f'Root partition is an encrypted device, identifying by UUID: {root_partition.uuid}')
# Note: UUID must be used, not PARTUUID for sd-encrypt to work
kernel_parameters.append(f'rd.luks.name={root_partition.uuid}=root')
Expand Down Expand Up @@ -1672,8 +1672,7 @@ def _create_user(self, user: User) -> None:
if result := plugin.on_user_created(self, user):
handled_by_plugin = result

if user.password:
Copy link
Copy Markdown
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

self.set_user_password(user)
self.set_user_password(user)

for group in user.groups:
SysCommand(f'arch-chroot {self.target} gpasswd -a {user.username} {group}')
Expand All @@ -1684,7 +1683,7 @@ def _create_user(self, user: User) -> None:
def set_user_password(self, user: User) -> bool:
info(f'Setting password for {user.username}')

enc_password = user.password.enc_password if user.password else None
enc_password = user.password.enc_password

if not enc_password:
debug('User password is empty')
Expand Down
1 change: 1 addition & 0 deletions archinstall/lib/pacman/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
class PacmanConfig:
def __init__(self, target: Path | None):
self._config_path = Path('/etc') / 'pacman.conf'
self._config_remote_path: Path | None = None

if target:
self._config_remote_path = target / 'etc' / 'pacman.conf'
Expand Down
3 changes: 1 addition & 2 deletions archinstall/scripts/only_hd.py
Original file line number Diff line number Diff line change
Expand Up @@ -45,8 +45,7 @@ def perform_installation(mountpoint: Path) -> None:
) 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
Copy Markdown
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

installation.mount_ordered_layout()
installation.mount_ordered_layout()

# to generate a fstab directory holder. Avoids an error on exit and at the same time checks the procedure
target = Path(f'{mountpoint}/etc/fstab')
Expand Down
5 changes: 0 additions & 5 deletions archinstall/tui/curses_menu.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@

from archinstall.lib.translationhandler import tr

from ..lib.output import debug
from .help import Help
from .menu_item import MenuItem, MenuItemGroup, MenuItemsState
from .result import Result, ResultType
Expand Down Expand Up @@ -87,10 +86,6 @@ def help_entry(self) -> ViewportEntry:
return ViewportEntry(tr('Press Ctrl+h for help'), 0, 0, STYLE.NORMAL)

def _show_help(self) -> None:
if not self._help_window:
Copy link
Copy Markdown
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()

debug('no help window set')
return

help_text = Help.get_help_text()
lines = help_text.split('\n')

Expand Down
1 change: 1 addition & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,7 @@ enable_error_code = [
"possibly-undefined",
"redundant-expr",
"redundant-self",
"truthy-bool",
"truthy-iterable",
"unimported-reveal",
"unused-awaitable",
Expand Down