diff --git a/archinstall/lib/disk/device_handler.py b/archinstall/lib/disk/device_handler.py index 3dc13dd0..b6e005c1 100644 --- a/archinstall/lib/disk/device_handler.py +++ b/archinstall/lib/disk/device_handler.py @@ -4,7 +4,6 @@ import json import logging import os import time -import uuid from collections.abc import Iterable from pathlib import Path from typing import Any, Literal @@ -29,6 +28,7 @@ from .device_model import ( LvmVolumeGroup, LvmVolumeInfo, ModificationStatus, + PartitionGUID, PartitionModification, PartitionTable, SectorSize, @@ -544,8 +544,7 @@ class DeviceHandler: raise DiskError(f'Unable to add partition, most likely due to overlapping sectors: {ex}') from ex if disk.type == PartitionTable.GPT.value and part_mod.is_root(): - linux_root_x86_64 = "4F68BCE3-E8CD-4DB1-96E7-FBCAF984B709" - partition.type_uuid = uuid.UUID(linux_root_x86_64).bytes + partition.type_uuid = PartitionGUID.LINUX_ROOT_X86_64.bytes # the partition has a path now that it has been added part_mod.dev_path = Path(partition.path) diff --git a/archinstall/lib/disk/device_model.py b/archinstall/lib/disk/device_model.py index 63f69d71..9050afbc 100644 --- a/archinstall/lib/disk/device_model.py +++ b/archinstall/lib/disk/device_model.py @@ -585,11 +585,15 @@ class PartitionFlag(Enum): ESP = parted.PARTITION_ESP -# class PartitionGUIDs(Enum): -# """ -# A list of Partition type GUIDs (lsblk -o+PARTTYPE) can be found here: https://en.wikipedia.org/wiki/GUID_Partition_Table#Partition_type_GUIDs -# """ -# XBOOTLDR = 'bc13c2ff-59e6-4262-a352-b275fd6f7172' +class PartitionGUID(Enum): + """ + A list of Partition type GUIDs (lsblk -o+PARTTYPE) can be found here: https://en.wikipedia.org/wiki/GUID_Partition_Table#Partition_type_GUIDs + """ + LINUX_ROOT_X86_64 = "4F68BCE3-E8CD-4DB1-96E7-FBCAF984B709" + + @property + def bytes(self) -> bytes: + return uuid.UUID(self.value).bytes class FilesystemType(Enum):