From a51475e0ed28b82b595ae5ab51ba5c83f849c1dd Mon Sep 17 00:00:00 2001 From: codefiles <11915375+codefiles@users.noreply.github.com> Date: Sun, 23 Feb 2025 02:51:25 -0500 Subject: [PATCH] Refactor default partition table (#3194) --- archinstall/lib/disk/filesystem.py | 5 +---- archinstall/lib/models/device_model.py | 4 ++++ 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/archinstall/lib/disk/filesystem.py b/archinstall/lib/disk/filesystem.py index 980c0378..8947f209 100644 --- a/archinstall/lib/disk/filesystem.py +++ b/archinstall/lib/disk/filesystem.py @@ -6,7 +6,6 @@ from typing import TYPE_CHECKING from archinstall.tui import Tui -from ..hardware import SysInfo from ..interactions.general_conf import ask_abort from ..luks import Luks2 from ..models.device_model import ( @@ -62,9 +61,7 @@ class FilesystemHandler: # Setup the blockdevice, filesystem (and optionally encryption). # Once that's done, we'll hand over to perform_installation() - partition_table = PartitionTable.GPT - if SysInfo.has_uefi() is False: - partition_table = PartitionTable.MBR + partition_table = PartitionTable.default() # make sure all devices are unmounted for mod in device_mods: diff --git a/archinstall/lib/models/device_model.py b/archinstall/lib/models/device_model.py index 71eeff6f..222e71e4 100644 --- a/archinstall/lib/models/device_model.py +++ b/archinstall/lib/models/device_model.py @@ -205,6 +205,10 @@ class PartitionTable(Enum): def is_mbr(self) -> bool: return self == PartitionTable.MBR + @classmethod + def default(cls) -> PartitionTable: + return cls.GPT if SysInfo.has_uefi() else cls.MBR + class Units(Enum): BINARY = 'binary'