fix A/B partition flags to match ABL#120
Draft
andiradulescu wants to merge 2 commits intocommaai:masterfrom
Draft
fix A/B partition flags to match ABL#120andiradulescu wants to merge 2 commits intocommaai:masterfrom
andiradulescu wants to merge 2 commits intocommaai:masterfrom
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
I noticed this on Void, since
abctlwas using the incorrect bits and after a number of reboots I was getting "Failed to boot". On serial:The problem is that
setActiveSlot()andgetActiveSlot()wrote and read A/B partition flags at wrong bit positions, 6 bits too high. This rewrites both to match ABL'sSetActiveSlot().PR #92 misinterpreted edl's
AB_FLAG_OFFSET = 6(a byte offset into the 8-byte attributes field) as a bit offset added to 48, makingAB_FLAG_OFFSET = 54instead of 48. All flag writes landed at bits 56+ which ABL ignores.This appeared to work because after the precedence fix (6ff8067), bits 48-55 from GPT images were preserved untouched, and ABL booted from those pre-set flags. But with
retry=7, successful=0from the GPT image, the device relies onmark_boot_successful— if that also writes to the wrong bit, the device bricks after exactly 7 reboots.Supersedes #118 which fixes precedence but not the offset.
Probably keeping this as draft until Void is ready to review.
Full research:
ab-flag-comparison.md
ab-flag-readings.md