Skip to content

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

Open
Royyan Zahir (royzah) wants to merge 1 commit 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 1 commit into
qualcomm-linux:mainfrom
royzah:gpt-raw-attributes

Conversation

@royzah

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

Copy link
Copy Markdown

--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
Attributes = 0x0
# import pdb; pdb.set_trace()
# Raw --attributes (A/B slot bits) first, then the named flags below.
Attributes = int(PhyPartition[k][j].get("attributes", "0x0"), 16)

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.

I'd say, no. Please add named flags only.

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.
@royzah

Royyan Zahir (royzah) commented Jul 6, 2026

Copy link
Copy Markdown
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
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.

2 participants