Set root partition type GUID (#2505)

This commit is contained in:
codefiles 2024-05-14 23:06:27 -04:00 committed by GitHub
parent af9d741175
commit 06baa08750
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 5 additions and 0 deletions

View File

@ -4,6 +4,7 @@ import json
import os import os
import logging import logging
import time import time
import uuid
from pathlib import Path from pathlib import Path
from typing import List, Dict, Any, Optional, TYPE_CHECKING, Literal, Iterable from typing import List, Dict, Any, Optional, TYPE_CHECKING, Literal, Iterable
@ -499,6 +500,10 @@ class DeviceHandler(object):
except PartitionException as ex: except PartitionException as ex:
raise DiskError(f'Unable to add partition, most likely due to overlapping sectors: {ex}') from ex 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
# the partition has a path now that it has been added # the partition has a path now that it has been added
part_mod.dev_path = Path(partition.path) part_mod.dev_path = Path(partition.path)