Refactor default partition table (#3194)
This commit is contained in:
parent
d69441a2da
commit
a51475e0ed
|
|
@ -6,7 +6,6 @@ from typing import TYPE_CHECKING
|
||||||
|
|
||||||
from archinstall.tui import Tui
|
from archinstall.tui import Tui
|
||||||
|
|
||||||
from ..hardware import SysInfo
|
|
||||||
from ..interactions.general_conf import ask_abort
|
from ..interactions.general_conf import ask_abort
|
||||||
from ..luks import Luks2
|
from ..luks import Luks2
|
||||||
from ..models.device_model import (
|
from ..models.device_model import (
|
||||||
|
|
@ -62,9 +61,7 @@ class FilesystemHandler:
|
||||||
|
|
||||||
# Setup the blockdevice, filesystem (and optionally encryption).
|
# Setup the blockdevice, filesystem (and optionally encryption).
|
||||||
# Once that's done, we'll hand over to perform_installation()
|
# Once that's done, we'll hand over to perform_installation()
|
||||||
partition_table = PartitionTable.GPT
|
partition_table = PartitionTable.default()
|
||||||
if SysInfo.has_uefi() is False:
|
|
||||||
partition_table = PartitionTable.MBR
|
|
||||||
|
|
||||||
# make sure all devices are unmounted
|
# make sure all devices are unmounted
|
||||||
for mod in device_mods:
|
for mod in device_mods:
|
||||||
|
|
|
||||||
|
|
@ -205,6 +205,10 @@ class PartitionTable(Enum):
|
||||||
def is_mbr(self) -> bool:
|
def is_mbr(self) -> bool:
|
||||||
return self == PartitionTable.MBR
|
return self == PartitionTable.MBR
|
||||||
|
|
||||||
|
@classmethod
|
||||||
|
def default(cls) -> PartitionTable:
|
||||||
|
return cls.GPT if SysInfo.has_uefi() else cls.MBR
|
||||||
|
|
||||||
|
|
||||||
class Units(Enum):
|
class Units(Enum):
|
||||||
BINARY = 'binary'
|
BINARY = 'binary'
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue