Skip to content

Commit a61d4e5

Browse files
authored
Revert "Handle whole-disk LUKS root params (archlinux#4205)" (archlinux#4229)
This reverts commit 0dddc73.
1 parent 21358f7 commit a61d4e5

2 files changed

Lines changed: 3 additions & 52 deletions

File tree

archinstall/lib/disk/device_handler.py

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -54,9 +54,6 @@ class DeviceHandler:
5454
def __init__(self) -> None:
5555
self._devices: dict[Path, BDevice] = {}
5656
self._partition_table = PartitionTable.default()
57-
if os.environ.get('ARCHINSTALL_SKIP_DEVICE_PROBE') == '1':
58-
debug('Skipping device probe due to ARCHINSTALL_SKIP_DEVICE_PROBE=1')
59-
return
6057
self.load_devices()
6158

6259
@property

archinstall/lib/installer.py

Lines changed: 3 additions & 49 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,6 @@
2323
DiskLayoutConfiguration,
2424
EncryptionType,
2525
FilesystemType,
26-
LsblkInfo,
2726
LvmVolume,
2827
PartitionModification,
2928
SectorSize,
@@ -1092,23 +1091,6 @@ def _get_luks_uuid_from_mapper_dev(self, mapper_dev_path: Path) -> str:
10921091

10931092
return lsblk_info.children[0].uuid
10941093

1095-
def _find_crypt_parent(self, dev_path: Path) -> LsblkInfo | None:
1096-
try:
1097-
lsblk_info = get_lsblk_info(dev_path, reverse=True, full_dev_path=True)
1098-
except DiskError as err:
1099-
debug(f'Unable to determine crypt parent for {dev_path}: {err}')
1100-
return None
1101-
1102-
def _walk(node: LsblkInfo) -> LsblkInfo | None:
1103-
if node.type == 'crypt':
1104-
return node
1105-
for child in node.children:
1106-
if found := _walk(child):
1107-
return found
1108-
return None
1109-
1110-
return _walk(lsblk_info)
1111-
11121094
def _get_kernel_params_partition(
11131095
self,
11141096
root_partition: PartitionModification,
@@ -1118,35 +1100,8 @@ def _get_kernel_params_partition(
11181100
kernel_parameters = []
11191101

11201102
if root_partition in self._disk_encryption.partitions:
1121-
crypt_parent = self._find_crypt_parent(root_partition.safe_dev_path)
1122-
if crypt_parent and crypt_parent.path != root_partition.safe_dev_path:
1123-
uuid = self._get_luks_uuid_from_mapper_dev(crypt_parent.path)
1124-
1125-
if self._disk_encryption.hsm_device:
1126-
debug(f'Root partition is inside encrypted device, HSM, identifying by UUID: {uuid}')
1127-
kernel_parameters.append(f'rd.luks.name={uuid}={crypt_parent.name}')
1128-
# Note: tpm2-device and fido2-device don't play along very well:
1129-
# https://github.com/archlinux/archinstall/pull/1196#issuecomment-1129715645
1130-
kernel_parameters.append('rd.luks.options=fido2-device=auto,password-echo=no')
1131-
else:
1132-
debug(f'Root partition is inside encrypted device, identifying by UUID: {uuid}')
1133-
kernel_parameters.append(f'cryptdevice=UUID={uuid}:{crypt_parent.name}')
1134-
1135-
if id_root:
1136-
if partuuid and root_partition.partuuid:
1137-
debug(
1138-
f'Identifying root partition inside LUKS by PARTUUID: {root_partition.partuuid}',
1139-
)
1140-
kernel_parameters.append(f'root=PARTUUID={root_partition.partuuid}')
1141-
elif root_partition.uuid:
1142-
debug(
1143-
f'Identifying root partition inside LUKS by UUID: {root_partition.uuid}',
1144-
)
1145-
kernel_parameters.append(f'root=UUID={root_partition.uuid}')
1146-
else:
1147-
raise ValueError('Root partition UUID could not be determined')
1148-
1149-
return kernel_parameters
1103+
# TODO: We need to detect if the encrypted device is a whole disk encryption,
1104+
# or simply a partition encryption. Right now we assume it's a partition (and we always have)
11501105

11511106
if self._disk_encryption.hsm_device:
11521107
debug(f'Root partition is an encrypted device, identifying by UUID: {root_partition.uuid}')
@@ -1615,8 +1570,7 @@ def _add_limine_bootloader(
16151570
hook_path.write_text(hook_contents)
16161571

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

16211575
path_root = 'boot()'
16221576
if efi_partition and boot_partition != efi_partition:

0 commit comments

Comments
 (0)