Repository navigation
enchilada: slot-B install to boot_b on sde, and its CONTRIBUTING §3.1 entry - #616
matthewjaybarr-png wants to merge 5 commits into
Conversation
… sets sde push looked for <image>_b only under /sys/block/sda. It now looks on sda and each LUN in UFS_RW_LUNS, the same LUNs the init guards, and refuses a name found on more than one partition or a path it doesn't expect. enchilada opts in with UFS_RW_LUNS=sde, where its boot_b is (derekross#530's review). push and flash still refuse android-v0 until the slot-B install and its CONTRIBUTING §3.1 entry land in this pull request. tests/images-layout: the fake phone places partitions on one LUN; push finds them on a UFS_RW_LUNS LUN, not on a LUN the descriptor doesn't name, and refuses a duplicate name before writing anything. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The slot-B install for enchilada goes through the installer, the same guarded path as every other phone: serial pinned, codename typed, allowlist, dry run, then boot_b, userdata, set-active b and reboot. - BOOT_METHOD=android-v0 is accepted; SOC_IDS/SOC_COMPATIBLE stay required for android-v4 only (v0 appends its one DTB). - The product check (phone and manifest.json) uses FASTBOOT_PRODUCT when the descriptor sets it: OnePlus ABL reports the SoC, sdm845, which is not unique, so the serial and typed codename identify it. - OnePlus ABL reports an empty version-bootloader. That is now refused unless the owner passes --bootloader-slots-match unreported, having compared both slots' firmware partitions from a read-only backup. - omamobile-boot-update refuses android-v0, so such an install writes AUTO_WRITE=no: kernel updates reach slot B by push. - enchilada's CMDLINE drops omamobile.initramfs and ufs-probe, so the installed boot_b hands off to the Arch root, as the hand-flashed one did (NOTES). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…ates tools/install-phone is now enchilada's first install, and its boot-update.conf says AUTO_WRITE=no because omamobile-boot-update takes only android-v4. push is the day-2 path: an android-v0 descriptor has one image, boot_b, which push already finds on a UFS_RW_LUNS LUN (sde), checks against the partition size and the storage guard's ro flag, writes and reads back by sha256. Lift its android-v0 refusal; fastboot and flash keep theirs, since the first install goes through the installer. tests/boot-method: enchilada push now stops at the missing images, still before any phone access. RELEASES: the BOOT_METHOD row says which tools take android-v0. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
On a Qualcomm A/B phone slot B is marked successful in its GPT, which the storage guard can't police, so the write gets its own tool, run by hand once per install of slot B's boot image and never from a service. The descriptor names the write (SLOT_B_MARK: the LUN, the partition and the four LBAs). Over phone-ssh the tool reads both GPT copies through a private node under /run (the init removes the whole-disk node, and that stays so), checks both headers, both entry arrays and their CRCs, finds the partition by name once, and refuses unless its sectors are the named four, the phone booted slot B, and B is active and not unbootable. It sets bit 54 and nothing else, recomputes the entry-array CRC and both header CRCs, and checks that only those four sectors change. The default is a dry run; --write asks for 'mark boot_b', re-reads the four sectors, writes the primary pair, reads it back, then the backup pair. enchilada's entry: sde boot_b, LBA 1, 3, 786428 and 786431. Checked read-only against a copy of the real sde GPT: entry 38, the captured header and array CRCs match, and the plan changes only those fields. tests/mark-slot-b runs it against a synthetic 4096-byte-sector GPT. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Write the entry the rule asks for before the GPT write is used: LUN sde, boot_b at entry 38, LBAs 1, 3, 786428 and 786431, bit 54, and the entry-array and header CRCs it rewrites. The generic wording names the four sectors by role, since the entry sector depends on the partition. The enchilada NOTES record the plan: the install, the GPT as read on 2026-11-09, the slot flags before and after (after: recorded when it runs), the rollback from the off-repo copy of both GPT copies, and the owner's written acceptance on derekross#432 that slot A holds the rescue. tests/mark-slot-b: use grep -c instead of piping into grep -q under pipefail (tests/grep-q-pipes). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
35a2cf8 to
d3f60f9
Compare
|
Thank you, @matthewjaybarr-png. This is careful work: the tool is a dry run by default, checks both table copies before it changes one, changes only the bytes it names, and its test has I'm not merging it in this shape, for one reason of process and a few of substance. The entry has to come from me, in its own change. On #432 I asked for the §3.1 entry "as its own pull request rather than inside the device PR", and CONTRIBUTING says a device PR never writes its own exception. Here the entry is the last commit of the PR that adds the three writers, and it also rewords the general rule for every Qualcomm phone ("LBAs 1, 2, last-1 and last" becomes "both headers and the entry sector holding slot B's boot partition in each copy"). You're right that the old wording doesn't fit your phone: So please split it in three:
What I need changed in the tool and the notes:
Smaller things: For the record, what I checked: the gate and the touched test suites pass on today's main, the push change leaves the Pixels' lookup as it was, and the table arithmetic in the tool and the notes is consistent. Nothing here is a judgment on the port. It is the first partition-table write in the project, so it goes in small steps. |
|
Thank you for the careful review, @derekross. And sorry: you asked for the §3.1 entry as its own pull request, and I put it inside the device PR anyway, rule rewording and all. That was my mistake. The I've split it as you laid out:
From the Shall I close this one in favour of #651? |
|
Yes, please close this one in favour of #651, @matthewjaybarr-png, and thank you for taking the review so well. No apology needed. I've reviewed #651 there. Part 3 (the descriptor lines, the |
The slot-B install for the OnePlus 6 (enchilada), as one PR:
boot_bon LUNsdegets a real writer, and the CONTRIBUTING §3.1 entry names the one GPT write that marks it successful. CarriesUFS_RW_LUNS=sde, as asked in the review of #530.What changes
push finds slot B's images on the descriptor's
UFS_RW_LUNSas well assda; enchilada setsUFS_RW_LUNS=sde.install-phone installs an
android-v0boot image to slot B (boot_banduserdata, thenset-active b).omamobile push rewrites enchilada's
boot_bfor day-2 kernels.tools/mark-slot-b (new) is the §3.1 write. It reads
SLOT_B_MARK="sde boot_b 1 3 786428 786431"from the descriptor and refuses unless:boot_bis found once, in the descriptor's LBAs;boot_bis active and not unbootable.It is a dry run by default.
--writeneeds a typed confirmation, re-reads the four sectors, and sets bit 54 only, rewriting the array CRC and both header CRCs. It writes the primary pair and reads it back before the backup pair, through a private node under/run: the init's guard stays as it is, and/dev/sdeis never recreated.tests/mark-slot-b builds a 4096-byte-sector GPT and checks:
--writechanges exactly the four sectors andsfdisk -Vaccepts the result;CONTRIBUTING §3.1 gets the enchilada entry. AGENTS.md gets the same wording. NOTES records the plan, the GPT as read, the slot flags before (after: recorded when it runs), the rollback, and the owner's acceptance on OnePlus 6 (enchilada, SDM845) port: RAM-only first light, contributors welcome #432 that slot A holds the rescue.
Before / after
boot_bonsdeinstall-phone,omamobile pushtools/mark-slot-b, by hand, once per installtests/alltools/pr-check origin/mainpassesmark-slot-b's parser was also checked read-only against a copy of this phone'ssdeGPT. It foundboot_bat entry 38 with the CRCs that NOTES records. Becauseboot_bthere is not active yet, it refused, as it should beforeset-active b.Merge danger
Low for other devices: every descriptor but enchilada's leaves
UFS_RW_LUNSandSLOT_B_MARKunset, and both tools refuse without them. Nothing in this PR has written to the phone. The install and the GPT write each run on the owner's go after merge, and their slot flags go into NOTES.🤖 Generated with Claude Code