Skip to content

Commit d29cc61

Browse files
committed
Refactor default partition table
1 parent 201968c commit d29cc61

File tree

2 files changed

+5
-4
lines changed

2 files changed

+5
-4
lines changed

archinstall/lib/disk/filesystem.py

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@
66

77
from archinstall.tui import Tui
88

9-
from ..hardware import SysInfo
109
from ..interactions.general_conf import ask_abort
1110
from ..luks import Luks2
1211
from ..models.device_model import (
@@ -62,9 +61,7 @@ def perform_filesystem_operations(self, show_countdown: bool = True) -> None:
6261

6362
# Setup the blockdevice, filesystem (and optionally encryption).
6463
# Once that's done, we'll hand over to perform_installation()
65-
partition_table = PartitionTable.GPT
66-
if SysInfo.has_uefi() is False:
67-
partition_table = PartitionTable.MBR
64+
partition_table = PartitionTable.default()
6865

6966
# make sure all devices are unmounted
7067
for mod in device_mods:

archinstall/lib/models/device_model.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -205,6 +205,10 @@ class PartitionTable(Enum):
205205
def is_mbr(self) -> bool:
206206
return self == PartitionTable.MBR
207207

208+
@classmethod
209+
def default(cls) -> PartitionTable:
210+
return cls.GPT if SysInfo.has_uefi() else cls.MBR
211+
208212

209213
class Units(Enum):
210214
BINARY = 'binary'

0 commit comments

Comments
 (0)