Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

stages/sfdisk: support changing GPT partition attribute bits #966

Merged
merged 1 commit into from Mar 23, 2022

Conversation

eballetbo
Copy link

The GPT attribute field is a 64-bit field that contains two subfields. The higher field is interpreted only in the context of the partition ID, while the lower field is common to all partition IDs. sfdisk supports to change this fields, and also a osbuild user might be interested on change these bits. This patchset adds support to change these bits in the sfdisk stage.

The meaning of these bits (from Wikipedia) :

  • 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)
  • 3–47 Reserved for future use
  • 48–63 Defined and used by the individual partition type

Copy link
Member

@teg teg left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi @eballetbo! Thanks for your contribution. It looks reasonable to me, I only have one style comment.

stages/org.osbuild.sfdisk Outdated Show resolved Hide resolved
Copy link
Contributor

@gicmo gicmo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks so much! In addition to what @teg said, just a small print statement that I think we don't need.

stages/org.osbuild.sfdisk Outdated Show resolved Hide resolved
When is specified change the GPT partition attribute bits. The attributes
is a comma list of bits numbers or bit names. You can take a look at the
manual page of sfdisk to see the supported attribute bits.
@eballetbo
Copy link
Author

Pushed a new branch with the requested changes. Using an array of integers and removed the debug message introduced by mistake.

@eballetbo eballetbo requested review from gicmo and teg March 9, 2022 16:26
Copy link
Member

@teg teg left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me!

@gicmo
Copy link
Contributor

gicmo commented Mar 22, 2022

Restarted the test.

@gicmo gicmo enabled auto-merge (rebase) March 22, 2022 18:55
Copy link
Contributor

@gicmo gicmo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks a lot!

@gicmo gicmo merged commit 31eed79 into osbuild:main Mar 23, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants