From 3c59f5a63cb422d3912ffd2ecd63f8c13a409385 Mon Sep 17 00:00:00 2001 From: Anil Kulkarni Date: Fri, 3 Nov 2023 23:45:12 -0700 Subject: [PATCH 1/2] Prototype fix to detect mounted cryptfs btrfs subvolumes --- archinstall/lib/disk/device_handler.py | 29 ++++++++++++++++---------- 1 file changed, 18 insertions(+), 11 deletions(-) diff --git a/archinstall/lib/disk/device_handler.py b/archinstall/lib/disk/device_handler.py index baed2f6fbb..94f3d384c1 100644 --- a/archinstall/lib/disk/device_handler.py +++ b/archinstall/lib/disk/device_handler.py @@ -75,21 +75,28 @@ def load_devices(self): lsblk_info = get_lsblk_info(partition.path) fs_type = self._determine_fs_type(partition, lsblk_info) subvol_infos = [] + path_override = None if fs_type == FilesystemType.Btrfs: subvol_infos = self.get_btrfs_info(partition.path) - - partition_infos.append( - _PartitionInfo.from_partition( - partition, - fs_type, - lsblk_info.partn, - lsblk_info.partuuid, - lsblk_info.uuid, - lsblk_info.mountpoints, - subvol_infos - ) + elif fs_type == FilesystemType.Crypto_luks and len(lsblk_info.children) == 1: + child_lsblk_info = lsblk_info.children[0] + if FilesystemType(child_lsblk_info.fstype) == FilesystemType.Btrfs: + subvol_infos = self.get_btrfs_info(child_lsblk_info.path) + lsblk_info = child_lsblk_info + path_override = child_lsblk_info.path + info = _PartitionInfo.from_partition( + partition, + fs_type, + lsblk_info.partn, + lsblk_info.partuuid, + lsblk_info.uuid, + lsblk_info.mountpoints, + subvol_infos ) + if path_override: + info.path = path_override + partition_infos.append(info) block_device = BDevice(disk, device_info, partition_infos) block_devices[block_device.device_info.path] = block_device From 12c644d4feec5bfc37d8e4f6087eb5b2ef1d6e87 Mon Sep 17 00:00:00 2001 From: Anil Kulkarni Date: Sat, 4 Nov 2023 00:50:20 -0700 Subject: [PATCH 2/2] fall back to the luks partition for most details --- archinstall/lib/disk/device_handler.py | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-) diff --git a/archinstall/lib/disk/device_handler.py b/archinstall/lib/disk/device_handler.py index 94f3d384c1..fa81256e2b 100644 --- a/archinstall/lib/disk/device_handler.py +++ b/archinstall/lib/disk/device_handler.py @@ -75,7 +75,6 @@ def load_devices(self): lsblk_info = get_lsblk_info(partition.path) fs_type = self._determine_fs_type(partition, lsblk_info) subvol_infos = [] - path_override = None if fs_type == FilesystemType.Btrfs: subvol_infos = self.get_btrfs_info(partition.path) @@ -83,9 +82,8 @@ def load_devices(self): child_lsblk_info = lsblk_info.children[0] if FilesystemType(child_lsblk_info.fstype) == FilesystemType.Btrfs: subvol_infos = self.get_btrfs_info(child_lsblk_info.path) - lsblk_info = child_lsblk_info - path_override = child_lsblk_info.path - info = _PartitionInfo.from_partition( + fs_type = FilesystemType.Btrfs # Hack to ensure btrfs-progs gets installed + partition_infos.append(_PartitionInfo.from_partition( partition, fs_type, lsblk_info.partn, @@ -93,10 +91,7 @@ def load_devices(self): lsblk_info.uuid, lsblk_info.mountpoints, subvol_infos - ) - if path_override: - info.path = path_override - partition_infos.append(info) + )) block_device = BDevice(disk, device_info, partition_infos) block_devices[block_device.device_info.path] = block_device