Skip to content
Open
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
3 changes: 0 additions & 3 deletions archinstall/lib/disk/device_handler.py
Original file line number Diff line number Diff line change
Expand Up @@ -54,9 +54,6 @@ class DeviceHandler:
def __init__(self) -> None:
self._devices: dict[Path, BDevice] = {}
self._partition_table = PartitionTable.default()
if os.environ.get('ARCHINSTALL_SKIP_DEVICE_PROBE') == '1':
debug('Skipping device probe due to ARCHINSTALL_SKIP_DEVICE_PROBE=1')
return
self.load_devices()

@property
Expand Down
52 changes: 3 additions & 49 deletions archinstall/lib/installer.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@
DiskLayoutConfiguration,
EncryptionType,
FilesystemType,
LsblkInfo,
LvmVolume,
PartitionModification,
SectorSize,
Expand Down Expand Up @@ -1092,23 +1091,6 @@ def _get_luks_uuid_from_mapper_dev(self, mapper_dev_path: Path) -> str:

return lsblk_info.children[0].uuid

def _find_crypt_parent(self, dev_path: Path) -> LsblkInfo | None:
try:
lsblk_info = get_lsblk_info(dev_path, reverse=True, full_dev_path=True)
except DiskError as err:
debug(f'Unable to determine crypt parent for {dev_path}: {err}')
return None

def _walk(node: LsblkInfo) -> LsblkInfo | None:
if node.type == 'crypt':
return node
for child in node.children:
if found := _walk(child):
return found
return None

return _walk(lsblk_info)

def _get_kernel_params_partition(
self,
root_partition: PartitionModification,
Expand All @@ -1118,35 +1100,8 @@ def _get_kernel_params_partition(
kernel_parameters = []

if root_partition in self._disk_encryption.partitions:
crypt_parent = self._find_crypt_parent(root_partition.safe_dev_path)
if crypt_parent and crypt_parent.path != root_partition.safe_dev_path:
uuid = self._get_luks_uuid_from_mapper_dev(crypt_parent.path)

if self._disk_encryption.hsm_device:
debug(f'Root partition is inside encrypted device, HSM, identifying by UUID: {uuid}')
kernel_parameters.append(f'rd.luks.name={uuid}={crypt_parent.name}')
# Note: tpm2-device and fido2-device don't play along very well:
# https://github.com/archlinux/archinstall/pull/1196#issuecomment-1129715645
kernel_parameters.append('rd.luks.options=fido2-device=auto,password-echo=no')
else:
debug(f'Root partition is inside encrypted device, identifying by UUID: {uuid}')
kernel_parameters.append(f'cryptdevice=UUID={uuid}:{crypt_parent.name}')

if id_root:
if partuuid and root_partition.partuuid:
debug(
f'Identifying root partition inside LUKS by PARTUUID: {root_partition.partuuid}',
)
kernel_parameters.append(f'root=PARTUUID={root_partition.partuuid}')
elif root_partition.uuid:
debug(
f'Identifying root partition inside LUKS by UUID: {root_partition.uuid}',
)
kernel_parameters.append(f'root=UUID={root_partition.uuid}')
else:
raise ValueError('Root partition UUID could not be determined')

return kernel_parameters
# 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.hsm_device:
debug(f'Root partition is an encrypted device, identifying by UUID: {root_partition.uuid}')
Expand Down Expand Up @@ -1615,8 +1570,7 @@ def _add_limine_bootloader(
hook_path.write_text(hook_contents)

kernel_params = ' '.join(self._get_kernel_params(root))
config_contents = f'# Created by archinstall on {self.init_time}\\n'
config_contents += 'timeout: 5\\n'
config_contents = 'timeout: 5\n'

path_root = 'boot()'
if efi_partition and boot_partition != efi_partition:
Expand Down