Skip to content

Commit

Permalink
Change partition flag name Boot -> BOOT (#2903)
Browse files Browse the repository at this point in the history
  • Loading branch information
codefiles authored Nov 21, 2024
1 parent 7fd726f commit bda0752
Show file tree
Hide file tree
Showing 5 changed files with 9 additions and 9 deletions.
6 changes: 3 additions & 3 deletions archinstall/lib/disk/device_model.py
Original file line number Diff line number Diff line change
Expand Up @@ -590,7 +590,7 @@ class PartitionFlagDataMixin:


class PartitionFlag(PartitionFlagDataMixin, Enum):
Boot = parted.PARTITION_BOOT
BOOT = parted.PARTITION_BOOT
XBOOTLDR = parted.PARTITION_BLS_BOOT, "bls_boot"
ESP = parted.PARTITION_ESP
LINUX_HOME = parted.PARTITION_LINUX_HOME, "linux-home"
Expand Down Expand Up @@ -713,8 +713,8 @@ class PartitionModification:
partuuid: str | None = None
uuid: str | None = None

_efi_indicator_flags = (PartitionFlag.Boot, PartitionFlag.ESP)
_boot_indicator_flags = (PartitionFlag.Boot, PartitionFlag.XBOOTLDR)
_efi_indicator_flags = (PartitionFlag.BOOT, PartitionFlag.ESP)
_boot_indicator_flags = (PartitionFlag.BOOT, PartitionFlag.XBOOTLDR)

def __post_init__(self) -> None:
# needed to use the object as a dictionary key due to hash func
Expand Down
6 changes: 3 additions & 3 deletions archinstall/lib/disk/partitioning_menu.py
Original file line number Diff line number Diff line change
Expand Up @@ -116,13 +116,13 @@ def handle_action(
case 'assign_mountpoint' if entry:
entry.mountpoint = self._prompt_mountpoint()
if entry.mountpoint == Path('/boot'):
entry.set_flag(PartitionFlag.Boot)
entry.set_flag(PartitionFlag.BOOT)
if SysInfo.has_uefi():
entry.set_flag(PartitionFlag.ESP)
case 'mark_formatting' if entry:
self._prompt_formatting(entry)
case 'mark_bootable' if entry:
entry.invert_flag(PartitionFlag.Boot)
entry.invert_flag(PartitionFlag.BOOT)
if SysInfo.has_uefi():
entry.invert_flag(PartitionFlag.ESP)
case 'set_filesystem' if entry:
Expand Down Expand Up @@ -414,7 +414,7 @@ def _create_new_partition(self) -> PartitionModification:
)

if partition.mountpoint == Path('/boot'):
partition.set_flag(PartitionFlag.Boot)
partition.set_flag(PartitionFlag.BOOT)
if SysInfo.has_uefi():
partition.set_flag(PartitionFlag.ESP)

Expand Down
2 changes: 1 addition & 1 deletion archinstall/lib/interactions/disk_conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -203,7 +203,7 @@ def select_lvm_config(


def _boot_partition(sector_size: disk.SectorSize, using_gpt: bool) -> disk.PartitionModification:
flags = [disk.PartitionFlag.Boot]
flags = [disk.PartitionFlag.BOOT]
size = disk.Size(1, disk.Unit.GiB, sector_size)
if using_gpt:
start = disk.Size(1, disk.Unit.MiB, sector_size)
Expand Down
2 changes: 1 addition & 1 deletion docs/examples/python.rst
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ After running ``python -m archinstall test_installer`` it should print something
start=Size(value=2048, unit=<Unit.sectors: 'sectors'>, sector_size=SectorSize(value=512, unit=<Unit.B: 1>)),
length=Size(value=535822336, unit=<Unit.B: 1>, sector_size=SectorSize(value=512, unit=<Unit.B: 1>)),
flags=[
<PartitionFlag.Boot: flag_id=1, alias=None>,
<PartitionFlag.BOOT: flag_id=1, alias=None>,
<PartitionFlag.ESP: flag_id=18, alias=None>
],
partn=1,
Expand Down
2 changes: 1 addition & 1 deletion examples/full_automated_installation.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
length=disk.Size(512, disk.Unit.MiB, device.device_info.sector_size),
mountpoint=Path('/boot'),
fs_type=disk.FilesystemType.Fat32,
flags=[disk.PartitionFlag.Boot]
flags=[disk.PartitionFlag.BOOT]
)
device_modification.add_partition(boot_partition)

Expand Down

0 comments on commit bda0752

Please sign in to comment.