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

partitioning: Add partattrs property to partition #490

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

nfraprado
Copy link
Contributor

Add a 'partattrs' property to partitions. It allows the GPT partition attribute bits to be set for a partition. Notably this is needed to set bits 48 and 56, which are part of the GUID specific range, to allow a ChromeOS Kernel partition to be booted on Chromebooks.

Copy link
Member

@sjoerdsimons sjoerdsimons left a comment

Choose a reason for hiding this comment

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

One small note; would also be great to extend the paritioning tests to test partition attributes

@@ -58,6 +58,7 @@ a 32 bits hexadecimal number (e.g. '1234ABCD' without any dash separator).
fsck: bool
fsuuid: string
partuuid: string
partattrs: list of partition attributes
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
partattrs: list of partition attributes
partattrs: list of partition attributes bits to set

Would be good to have the Verify function check it's only bit numbers in a valid range

Copy link
Member

Choose a reason for hiding this comment

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

@nfraprado Just checking if you managed to look at adding a check in the Verify function for the bit range ? Please reach out if I can help to explain the comment above :-)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Sorry for the delay. I've implemented verification now.

However I've noticed that bits 0-2 despite being documented in the specification and in the sfdisk man page, don't seem to be supported:

2024/05/31 19:42:27 sfdisk | unsupported GPT attribute bit '2'
2024/05/31 19:42:27 sfdisk | sfdisk: /dev/disk/by-fakemachine-label/fakedisk-0: partition 1: failed to set partition attributes

Should we forbid these values in verification too? Given it's documented it might be something specific to my setup. Unfortunately I don't have a lot of time to look into this.

Add a 'partattrs' property to partitions. It allows the GPT partition
attribute bits to be set for a partition. Notably this is needed to set
bits 48 and 56, which are part of the GUID specific range, to allow a
ChromeOS Kernel partition to be booted on Chromebooks.

Signed-off-by: Nícolas F. R. A. Prado <[email protected]>
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.

3 participants