Skip to content

gpt: add qbootctl A/B slot flags as named GPT attributes - #137

Open
Royyan Zahir (royzah) wants to merge 2 commits into
qualcomm-linux:mainfrom
royzah:gpt-raw-attributes
Open

gpt: add qbootctl A/B slot flags as named GPT attributes#137
Royyan Zahir (royzah) wants to merge 2 commits into
qualcomm-linux:mainfrom
royzah:gpt-raw-attributes

Conversation

@royzah

@royzah Royyan Zahir (royzah) commented Jul 5, 2026

Copy link
Copy Markdown
Contributor

--attributes was parsed only into the bootable (bit 2) and readonly (bit 60) flags, so the qbootctl A/B slot attributes were dropped and never reached the GPT.

Add active / successful / unbootable as named partition options (gen_partition --active / --successful / --unbootable), mapping to the qbootctl A/B attribute bits (gpt-utils.h: 50 / 54 / 55). ptool builds the GPT Attributes from these named flags; no raw attribute value is written.

Comment thread qcom_ptool/ptool.py Outdated
@royzah

Royyan Zahir (royzah) commented Jul 6, 2026

Copy link
Copy Markdown
Contributor Author

Dmitry Baryshkov (@lumag)
I reverted the raw value and switched to named flags: --active / --successful / --unbootable mapping to gpt-utils.h bits 50/54/55.

@royzah Royyan Zahir (royzah) changed the title gpt: write the raw --attributes value into the partition GPT entry gpt: add qbootctl A/B slot flags as named GPT attributes Jul 6, 2026
@lumag

Copy link
Copy Markdown
Contributor

Missing the SoB tag

@royzah

Copy link
Copy Markdown
Contributor Author

Added the Signed-off-by, thanks.

@royzah

Copy link
Copy Markdown
Contributor Author

Dmitry Baryshkov (@lumag) rebased on main and completed the named set: --bootable, --readonly, --priority, --tries-remaining alongside --active/--successful/--unbootable. Every attribute bit is now reachable by name, so --attributes is never required. Kept it working for compatibility, named flags take precedence. Ready for another look.

@lumag

Copy link
Copy Markdown
Contributor

Igor Opaniuk (@igoropaniuk) could you please take a look?

@igoropaniuk

Igor Opaniuk (igoropaniuk) commented Jul 24, 2026

Copy link
Copy Markdown
Contributor

This is doing inside the legacy .conf format exactly what the YAML rework (#134) stands for - replacing an opaque hex blob with named, typed fields

I have no comments for this particular PR (LGTM), the fundamental question is if we want to keep investing time and prettify existing legacy conf file format

Btw, it also needs a make generate-checksums commit with update checksums (likely every partitions.xml for every board will change (three new attributes per partition))

@royzah

Copy link
Copy Markdown
Contributor Author

Igor Opaniuk (@igoropaniuk) thanks, checksums pushed. only the 31 partitions.xml changed, zero GPT binaries, so no board's actual partition table moves.

on legacy vs YAML, fair question, up to you and Dmitry Baryshkov (@lumag). two things worth knowing: this is also a bug fix, not just nicer names. to_bool() turns 1/yes/true into "true", and ptool.py checks == "true", so a raw value did nothing before.

and whatever #134 lands as, the .conf path sticks around until every board moves, so the flags need to work there anyway.

Comment thread tests/integration/checksums.sha256
@royzah

Copy link
Copy Markdown
Contributor Author

Dmitry Baryshkov (@lumag) done, squashed the checksums into the flags commit.

@royzah

Copy link
Copy Markdown
Contributor Author

Rebased on main, checksums regenerated on top of the qcs615-ride layout change, checks green locally. Dmitry Baryshkov (@lumag) PTAL

@lumag

Copy link
Copy Markdown
Contributor

Conflicts in qcom_ptool/gen_partition.py

@lumag Dmitry Baryshkov (lumag) left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Signed-off-by: ivan.trubachev ivan.trubachev@tii.ae

Please get a permission from Ivan to use a full name rather than a login name.

@royzah

Royyan Zahir (royzah) commented Aug 7, 2026

Copy link
Copy Markdown
Contributor Author

Fixed, both trailers now carry his full name. Same tree, message-only change. Dmitry Baryshkov (@lumag) PTAL

Add active/successful/unbootable partition options (gen_partition
--active/--successful/--unbootable) mapping to the qbootctl A/B attribute
bits 50/54/55 (gpt-utils.h). ptool builds Attributes from these named
flags; no raw attribute value is written.

Signed-off-by: Royyan Zahir <royzah@gmail.com>
Add --bootable, --readonly, --priority and --tries-remaining so every
attribute bit is reachable by name and --attributes is never required.
Named flags take precedence; --attributes keeps working unchanged.

Regenerate the integration checksums: the named defaults are emitted for
every partition, so each generated partitions.xml gains active,
successful and unbootable. The GPT binaries are unchanged.

Co-developed-by: Ivan Trubachev <ivan.trubachev@tii.ae>
Signed-off-by: Ivan Trubachev <ivan.trubachev@tii.ae>
Signed-off-by: Royyan Zahir <royzah@gmail.com>
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