Skip to content

Add new job to set the GPT partition attributes

Gaël PORTAY requested to merge gportay/kpmcore:partition-attributes into master

Hello,

This MR intends to add the support for GPT partition attributes using the sfdisk backend.

This MR is similar to !4 (merged) for GPT partition label (PARTLABEL) and !8 (merged) for GPT partition UUID (PARTUUID).

It is the last of the GPT features serie.

There are 64 attributes flags according to wikipedia:

Bit Content
0 Platform required (required by the computer to function properly, OEM partition for example, disk partitioning utilities must preserve the partition as is)
1 EFI firmware should ignore the content of the partition and not try to read from it
2 Legacy BIOS bootable (equivalent to active flag (typically bit 7 set) at offset +0h in partition entries of the MBR partition table)[9]
3–47 Reserved for future use
48–63 Defined and used by the individual partition type

The CLI sfdisk sets the partition attributes using the option --part-attrs.

sfdisk let us defines the attributes flags reserved for partition type using the number of the flag (i.e. 48 to 63), but we need to use the keywords RequiredPartition, NoBlockIOProtocol, LegacyBIOSBootable to specify the already defined flags bit 0, 1 and 2.

I cannot make my decision between using a QStringList that may simplify the implementation and was influenced by the sfdisk keywords or using a strict QList<quint8> to defines the list of the attributes.

Using the QList<quint8> seems the right way to go but we need to maintain a table of translation for keywords. What do you thing?

Best Regards, Gaël

Edited by Gaël PORTAY

Merge request reports