From 8257e9f73f6d8f233731b5632863a5d7a4ae827e Mon Sep 17 00:00:00 2001 From: codefiles <11915375+codefiles@users.noreply.github.com> Date: Mon, 2 Oct 2023 01:50:20 -0400 Subject: Fix missing info for pre-mounted disk configuration (#2143) --- archinstall/lib/disk/device_handler.py | 9 ++++++++- archinstall/lib/disk/device_model.py | 9 +++++++++ 2 files changed, 17 insertions(+), 1 deletion(-) (limited to 'archinstall') diff --git a/archinstall/lib/disk/device_handler.py b/archinstall/lib/disk/device_handler.py index f2835b7b..6927671d 100644 --- a/archinstall/lib/disk/device_handler.py +++ b/archinstall/lib/disk/device_handler.py @@ -83,7 +83,9 @@ class DeviceHandler(object): _PartitionInfo.from_partition( partition, fs_type, + lsblk_info.partn, lsblk_info.partuuid, + lsblk_info.uuid, lsblk_info.mountpoints, subvol_infos ) @@ -598,7 +600,12 @@ class DeviceHandler(object): path = Path(part_info.disk.device.path) part_mods.setdefault(path, []) part_mod = PartitionModification.from_existing_partition(part_info) - part_mod.mountpoint = mountpoint.root / mountpoint.relative_to(base_mountpoint) + if part_mod.mountpoint: + part_mod.mountpoint = mountpoint.root / mountpoint.relative_to(base_mountpoint) + else: + for subvol in part_mod.btrfs_subvols: + if sm := subvol.mountpoint: + subvol.mountpoint = sm.root / sm.relative_to(base_mountpoint) part_mods[path].append(part_mod) break diff --git a/archinstall/lib/disk/device_model.py b/archinstall/lib/disk/device_model.py index 6992bccb..26169485 100644 --- a/archinstall/lib/disk/device_model.py +++ b/archinstall/lib/disk/device_model.py @@ -308,7 +308,9 @@ class _PartitionInfo: start: Size length: Size flags: List[PartitionFlag] + partn: int partuuid: str + uuid: str disk: Disk mountpoints: List[Path] btrfs_subvol_infos: List[_BtrfsSubvolumeInfo] = field(default_factory=list) @@ -342,7 +344,9 @@ class _PartitionInfo: cls, partition: Partition, fs_type: Optional[FilesystemType], + partn: int, partuuid: str, + uuid: str, mountpoints: List[Path], btrfs_subvol_infos: List[_BtrfsSubvolumeInfo] = [] ) -> _PartitionInfo: @@ -370,7 +374,9 @@ class _PartitionInfo: start=start, length=length, flags=flags, + partn=partn, partuuid=partuuid, + uuid=uuid, disk=partition.disk, mountpoints=mountpoints, btrfs_subvol_infos=btrfs_subvol_infos @@ -713,6 +719,9 @@ class PartitionModification: length=partition_info.length, fs_type=partition_info.fs_type, dev_path=partition_info.path, + partn=partition_info.partn, + partuuid=partition_info.partuuid, + uuid=partition_info.uuid, flags=partition_info.flags, mountpoint=mountpoint, btrfs_subvols=subvol_mods -- cgit v1.2.3-70-g09d2