Skip to content

Commit

Permalink
MBR: fix compatibility with libparted >= 3.6
Browse files Browse the repository at this point in the history
With parted 3.6 a check was implemented that allows setting the LBA flag
only for msdos partitions that support it (i.e. all fat types, DOS_EXT and EXT_LBA).

To fix the issue only set the flag when it is supported.
  • Loading branch information
MofX committed Feb 13, 2025
1 parent d1de02d commit e49b060
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion embdgen-core/src/embdgen/core/label/BaseLabel.py
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ def add_partition(self, part: PartitionRegion, logical: bool=False, boot_partiti
)
if boot_partition:
partition.setFlag(parted.PARTITION_BOOT)
if self._label_type == "msdos":
if self._label_type == "msdos" and partition.isFlagAvailable(parted.PARTITION_LBA):
partition.setFlag(parted.PARTITION_LBA)
if part.fstype == "esp":
partition.setFlag(parted.PARTITION_ESP)
Expand Down

0 comments on commit e49b060

Please sign in to comment.