Skip to content

swap partition type GUIDs between A/B slots#127

Open
andiradulescu wants to merge 2 commits intocommaai:masterfrom
andiradulescu:fix/guid-swap
Open

swap partition type GUIDs between A/B slots#127
andiradulescu wants to merge 2 commits intocommaai:masterfrom
andiradulescu:fix/guid-swap

Conversation

@andiradulescu
Copy link
Copy Markdown
Contributor

@andiradulescu andiradulescu commented Mar 9, 2026

Follow-up to #120

setActiveSlot() now swaps partition type GUIDs between _a and _b counterparts when switching slots, matching ABL's SwitchPtnSlots() / SwapPtnGuid().

Without GUID swap, ABL's ValidateSlotGuids (enabled on some devices) rejects slot B because boot_b and system_b both have the same inactive placeholder GUID (77036cd4-03d5-42bb-8ed1-37e5a88baa34), producing: ValidateSlotGuids: BootableSlot _b does not have valid guids.

  • GPT.swapSlotGuids() swaps type GUIDs between same-LUN _a/_b pairs
  • QDL.setActiveSlot() detects current slot and only swaps when actually changing slots (matching ABL's CurrentSlot != NewSlot guard)
  • Downgrades GPT primary/backup inconsistency message from warn to debug (normal after ABL boot)

Test plan

  • bun test passes (42 GPT tests including 7 new GUID swap tests with real device GUIDs)
  • bun lint passes
  • Verified on real device: A→B→A round-trip, GUIDs swap correctly and restore to factory state

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.

1 participant