Repository navigation
Conversation
…252) The kernel counts a partition read-only when its own flag or its disk's is set (bdev_read_only). The guard removed /dev/sda and left sda's flag clear, but set the boot LUNs' (sdb, sdc, sdd) disk flags and kept their whole-disk nodes, so writing any one boot-LUN partition (devinfo) meant clearing the disk flag, and while it was clear /dev/sdd reached every partition on the LUN. #483 found it; the maintainer's ruling on #252: guard the boot LUNs the way the main LUN is guarded. Every LUN is now guarded the same way: its whole-disk node removed (a node that won't go is retried, warned about and reported), its own flag never set, each partition's own flag set except the allowlist, which still opens partitions of sda only. The hand-over check also refuses Arch while any whole-disk node is there. Nothing becomes writable that wasn't, and a tool can open one partition by clearing that partition's own flag alone. omamobile-boot-success (device-cheetah 0.1.45, raven 0.1.33, lynx 0.2.3) ran blockdev --setrw on /dev/sdd first; under the new guard that node is gone and the marker fails whenever slot B needs marking. It now clears devinfo's own flag alone when the disk flag is clear, and keeps the old disk-then-partition sequence when an older initramfs set the disk flag, so a fastboot rollback to an older image set still marks slot B. push, omamobile-boot-update, nv-backup, phone-provision, omamobile-fp and phone-smoke use partitions found by PARTNAME and never a whole-disk node. Tested without a phone or a build: tests/storage-guard (fake sysfs whose ro files follow the own-or-disk rule: every disk node gone and its flag clear, each boot-LUN partition's own flag set, the allowlist unchanged and sda-only, devinfo's own flag opening devinfo alone with no disk flag, a returning or stuck node and a late LUN), tests/initramfs-steps, sh -n, and the new packages/omamobile-device-cheetah/test/boot-success (new and old guard, a flag that won't clear, a failed write, a non-LUN devinfo; it fails on the old marker), also run on raven's and lynx's markers. Ten mutations of the guard and five of the marker were each caught. Never booted: device/cheetah/STORAGE-GUARD-PLAN.md is the runbook for the 7 Pro. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…round 1 (#484) The review of #484 found the order unsafe on development phones: push and flash build the init from the checkout, but omamobile-boot-success comes from the installed device package, and an old marker under the new guard never marks slot B, so the next flash would end in a fallback to slot A. - The new marker carries "# guard: partition flags (#252)". For a device whose package ships the marker (cheetah, raven, lynx), push reads the phone's marker over SSH and refuses images with the new guard unless the line is there (a missing marker too); flash can't read the phone, so it refuses those images unless OMAMOBILE_MARKER_CHECKED=1. A warning would scroll by, and the failure shows only three boots later. Images whose initramfs reads as the old guard skip the check; a missing or unreadable initramfs doesn't. tests/images-layout covers each case; eight mutations, seven caught (the survivor drops grep's "|| true", which still refuses, with another message). - STORAGE-GUARD-PLAN: R5 runs the marker's new write path on the 7 Pro (a flash that unmarks B, a devinfo copy before and after, rollback to the old-init set whose old-guard path marks B); R4 arms a detached relock; "after the first pass" with the new-partition window explained; the merge order, the owners' notice and the version collisions. - test/boot-success: the guard line, and a phone without devinfo. - 10-omamobile-storage.rules: the comment said udev would recreate /dev/sda; devtmpfs makes a node only in device_add. Comment only, the rule is unchanged, so felix, husky, panther and tegu aren't bumped. - husky UFS-PLAN: its future checks no longer expect sdb-sdd to read ro. Tested without a phone or a build: tests/storage-guard, tests/initramfs-steps, tests/images-layout (image part skipped), tests/modules-push, tests/boot-method, test/boot-success on all three markers, sh -n, tools/pr-check. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
An offer, since this is the step the 9a's modem and GNSS cells wait on (through #483) and you have a long queue: I can do the rebase and hand it to you as a branch to review, if that saves you time. It stays yours to decide and to boot on the 7 Pro. I tried the merge with today's main (6649b76) to see what it takes. The branch is 197 commits behind and conflicts in five files:
How I would put them together, unless you see it differently: every LUN's whole-disk node removed and its flag left clear, as here; the allowlist honoured on sda and on the descriptor's Say the word and I'll push it to my fork with the test run, or leave it with you if you'd rather do it yourself. |
|
A correction to my last line about the device packages: the ones on main that carry |
…and the NFS root Main gained two things in the guard since this branch: a LUN list beside sda (UFS_RW_LUNS, #530) and the NFS-root mode. Both are kept, on this branch's rule that every LUN loses its whole-disk node and keeps its disk flag clear. initramfs/init: every LUN is guarded alike; the allowlist is honoured on sda and on a listed LUN only; with an NFS root sda keeps main's disk-level read-only flag and the other LUNs are guarded by their partitions' own flags. tests/storage-guard keeps both sides' cases on the own-flag model (the late LUN is now sdf, since sde is the listed LUN's fixture). akita and oriole get the storage rule's new comment. Versions: device-cheetah 0.1.55, device-lynx 0.2.5, device-raven 0.1.37.
|
I had a quiet evening while a long sleep run went on the 9a, so I did the merge with main rather than only offering it. It's on my fork as What I decided where the two sides met, so you can overrule any of it:
Run here: |
On W4HO-ham's merge of 2026-11-14 (UFS_RW_LUNS and the NFS root). Main has since made the allowlist follow the slot the phone runs from (ACTIVE-SLOT-PLAN §4); the guard's pass merged without conflict, since the slot mapping happens where the list is loaded. tests/storage-guard keeps this branch's fake disks (every LUN, own flags) and gains main's slot argument and its slot-A cases. device-cheetah's version is main's: it is set after an image from this branch has booted on the 7 Pro. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
|
Brought up to date with main (
Still open before a merge: the 7 Pro boot; the akita and oriole packages, whose |
|
The busybox run, on 34328ec: |
Implements the maintainer's ruling on #252: guard the boot LUNs the way the main LUN is already guarded, so #483's window can be
devinfoalone.Never booted. Needs Derek's Pixel 7 Pro run before merge (runbook:
device/cheetah/STORAGE-GUARD-PLAN.md§2, including R5, which runs the marker's new write path for real). Blocks #483, which rebases onto it afterwards. After the merge, every device's boot files need restaging.Why
The kernel counts a partition read-only when its own flag or its disk's flag is set (
bdev_read_only()). The guard removed/dev/sdaand leftsda's flag clear, but set the boot LUNs' (sdb,sdc,sdd) disk flags and kept their whole-disk nodes. So writingdevinfomeant clearingsdd's flag, and while it was clear,/dev/sddreachedpinfo,blenvandmfg_datatoo.What changes
initramfs/init. Every LUN's whole-disk node is removed, and no disk's own flag is ever set. A node that won't go is retried and warned about. Every partition gets its own flag, except theUFS_RWallowlist, which still openssdapartitions only. The hand-over check also keeps the phone in the initramfs while any whole-disk node is still there.sda's partitions have always had this window, and nothing in the initramfs writes a boot-LUN partition.omamobile-boot-success(device-cheetah, raven and lynx): a cheetah change. The old marker ranblockdev --setrw /dev/sddfirst, so under the new guard it fails whenever slot B needs marking. The new marker reads the disk flag:devinfo's own flag alone, checks it, writes, and sets the flag again;It also carries the line
# guard: partition flags (#252), which push and flash look for.bin/omamobile pushandflash: the order on development phones.pushandflashbuild the init from the checkout, but the marker comes from the installed package. For a device whose package ships the marker:pushreads/usr/bin/omamobile-boot-successover SSH. It refuses images with the new guard when the guard line is missing, or the file itself is.flashcan't read the phone, so it refuses images with the new guard unlessOMAMOBILE_MARKER_CHECKED=1is set. I chose a refusal over a warning because a warning scrolls by, and a wrong marker shows only three boots later, as a fallback to slot A. The error message gives the one-line check to run on the phone.Docs.
CONTRIBUTING§3.2 and AGENTS §1 describe the new guard.10-omamobile-storage.rules: the wrong "udev would recreate /dev/sda" comment is fixed in all seven copies (devtmpfs makes a node only indevice_add). The rule itself is unchanged.device/husky/UFS-PLAN.md: its future checks no longer expectsdb-sddto readro.Unchanged, checked:
pushandomamobile-boot-updatewrite onlysdapartitions found byPARTNAME.nv-backup,phone-provision,omamobile-fpandphone-smokeread partitions byPARTNAMEand never open a whole-disk node.Merging this
versionfiles. raven 0.1.33 is free.pushbuilt frommainrefuses a phone with the old marker.pushorflashfrommain, install the new device package (tools/phone-install-package packages/omamobile-device-<codename>, oromarchy updateon the development channel). The new initramfs removes the boot LUN's whole-disk node, and the oldomamobile-boot-successopens that node first. With the old marker, slot B is never marked after aflash, and ABL falls back to slot A after three boots.pushnow refuses in that state. If you have already flashed: install the package within B's remaining tries, then runomamobile-boot-successonce by hand.tools/stage-boot-files) and release their device packages. Then omamobile-device-husky 0.1.19, omamobile-device-tegu 0.2.22: omamobile-bootctl marks slot B by hand (#252) #483 rebases onto this, with its windowdevinfoalone. The 8 Pro owner's offer on Marking slot B successful: the plan after #125's hold, and for the Pixel 8 Pro #252 (a Kioxia UFS 4.0 part) is worth taking before omamobile-device-husky 0.1.19, omamobile-device-tegu 0.2.22: omamobile-bootctl marks slot B by hand (#252) #483.Tested (no phone, no build)
tests/storage-guard. Its fake sysfsrofiles follow the own-or-disk rule, and theblockdevstub refuses a missing node. It covers:sda;devinfo's own flag openingdevinfoalone;tests/images-layout(the image-building part skipped): push and flash with the guard line present, the line missing, the marker file missing, and the override; an initramfs with the old guard, the new guard, and an unreadable one. Fastboot is never called before the refusal.Other tests:
tests/initramfs-steps,tests/modules-push,tests/boot-method,sh -n initramfs/init,tools/pr-check origin/main.packages/omamobile-device-cheetah/test/boot-success, run on all three markers. It covers:devinfothat isn't on a LUN, and a phone with nodevinfo;It fails against main's marker.
Mutations:
|| true; it still refuses, with a different message.Not run locally:
tests/packagesand the packagetest/allfiles, which compile C. CI runs them.Open questions
device_add. If it is ever widened, it should match the UFS host rather thansd[a-z], because USB drives also enumerate assd*.phone-smokecould flag "a LUN with its node present and its disk flag clear", which is unguarded under both the old and the new guard. That is a follow-up.device/flame/initramfs/init(Qualcomm) has its own guard and is untouched.🤖 Generated with Claude Code