Repository navigation
Conversation
…e-bootctl marks slot B by hand (#252) The maintainer's decision on #252: on the Pixel 8 Pro and the Pixel 9a, slot B is marked successful by hand, attended, once per install of slot B's images and only after they pass tools/phone-smoke, with a device-aware omamobile-bootctl whose read-write window is reviewed first. This is that tool. Nothing runs it: no unit, hook or installer calls it, and both packages' tests check that. The source is new, one file shared byte for byte by the two packages (test/all compares them); the per-phone values are in src/bootctl-device.h: codename, board compatible and the devinfo layout recorded for that phone (3.15 on both: husky BATTERY-NOTES and #252, tegu NOTES 2026-10-22). The 7 Pro's omamobile-bootctl and omamobile-boot-success are untouched. It finds devinfo by PARTNAME, refuses another board or layout, a boot from slot A, an inactive or unbootable slot B, a mounted or held devinfo, another process with the LUN open for writing, and a storage guard that isn't holding. Dry run by default; --write needs the dry run's eight slot bytes (--expect) and the codename. It writes one byte (0x35, OR 0x02), reads the whole partition back past the page cache, restores the original on a mismatch, and prints only the version and the slot bytes 0x30-0x37. The window can't be devinfo alone: bdev_read_only() is the partition's own flag OR its disk's (include/linux/blkdev.h), and the write path, BLKROGET and sysfs ro all use it, so the boot LUN's flag has to be cleared too. The tool clears it only for the one byte, checks right after that every sibling partition keeps its own flag (the only moment that can be read), blocks ^C, SIGTERM and SIGHUP, and forks a relock child that sets both flags back if the tool dies, stops or hangs. Tested offline only, never on a phone: test/bootctl builds a test variant that reads a fake /sys, /proc and /dev with file-backed flags following the kernel's rule, and covers the refusals, a dry run that writes nothing, a write that flips bit 0x02 of 0x35 alone, a read-back mismatch that restores and fails, a failed write, kills before and after the write, a hung tool and ignored signals; 18 mutations of the key guards are each caught. Runbooks: husky and tegu BRINGUP-M1. The 9a's hold in AGENTS.md stands until the maintainer lifts it. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…review round 1 (#483) The review of #483 found that bin/omamobile's initramfs builder compiles any device package's src/omamobile-bootctl.c into the boot image against Alpine's musl sysroot. With the first head that broke husky's and tegu's initramfs builds (<linux/fs.h> isn't in that sysroot) and would have put the devinfo tool into every boot image. The source and its header move to bootctl/, the ioctls come from <sys/mount.h>, and test/all now fails on any file where the builder or tools/stage-boot-files look. husky's initramfs built from this tree and from main is byte-identical; tegu's descriptor doesn't build an initramfs on main either (SOC_IDS), and the builder's probe no longer matches there. The relock child timed out once, from the fork: a tool stopped for 10 s before the window opened would then open it unwatched. It now waits untimed until the tool says the window is opening, then relocks every 10 s for as long as the tool lives, and once more when the pipe closes. The tool checks the child is alive before each step that opens more. The guard, writer and holder checks run again after the codename prompt, right before the window; holders are checked on the disk and every sibling as well as devinfo; and step 1 checks that the disk flag actually cleared. Tests: new cases for versions 3.16 and 4.15, each sibling clear in turn, a sibling flag that can't be read, a disk flag that won't clear, devinfo changing inside the window, writers and holders on devinfo, a sibling or the disk, a restore that doesn't read back, a devinfo flag that won't set again, a failed or missing relock child, a stop longer than the timeout before and after the child is armed, and changes made while the prompt waits. Every recovery case asserts the window opened before it asserts the flags came back. 35 mutations are each caught. The CONTRIBUTING bullet describing the disk-level window is withdrawn until the maintainer rules on it. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
Ruling on the window, from #252: this waits for a separate PR that guards the boot LUNs the way the main LUN is guarded (whole-disk node removed, each partition's own flag set). That PR gets a Pixel 7 Pro boot first. Then this tool is rebased so its window clears |
… slot B Line 55 and the open question now say what you decided on derekross#252: marking is a manual, attended step, and nothing marks slot B on the 8 Pro until the boot LUN guard change and derekross#483 are in. Line 55 also carries the same dated record as line 16 and the DEVICES Boot cell, as you asked. Signed-off-by: Lef <me@lefteros.com>
|
Following your ruling above ("this tool is rebased so its window clears What the last commit changes in
Run here: One thing I was unsure of and decided the strict way: a whole-disk node at mode 0000 on a boot LUN is refused, although the udev rule would leave |
Calls, texts and mobile data work from the device package's boot unit once the owner enables it; the cell already says why it is not on by default (marking slot B is on hold, derekross#483) and names the two gaps (the far end's echo on the speakerphone, no earpiece route). That is the state the 9a's fingerprint cell calls works (opt-in).
Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
This is the tool behind #252's decision: a device-aware
omamobile-bootctlfor the Pixel 8 Pro (husky) and the Pixel 9a (tegu). The phone's owner runs it by hand from the device plan's runbook, once per install of slot B's images, aftertools/phone-smokepasses. No unit, hook or installer calls it, and both packages' tests check that.The read-write window exposes the whole boot LUN while it is open
The kernel won't write a partition of a read-only disk. In
include/linux/blkdev.h,bdev_read_only()is the partition's ownBD_READ_ONLYflag OR the disk's (part0's). That OR is whatblkdev_write_iter()checks before it returns-EPERM, and it is also whatBLKROGETand sysfsroreport.BLKROSETchanges only the node it is called on. Sodevinfocan't be made writable whilesddstays read-only, and the tool has to clear the LUN's flag too.While that flag is clear, the whole-disk node
/dev/sddis writable. Raw writes through it reach every byte of the LUN, including the other partitions on it:pinfo,blenvandmfg_dataon husky; tegu'ssddholdsmfg_data, and the rest isn't recorded. Those partitions' own flags guard only their own nodes.The tool keeps the window as short as it can (it opens and closes it itself, no
blockdevfrom a shell):devinfo, the LUN or a sibling is mounted or held, or open for writing by any other process. These checks run again right before the window, after the codename prompt.devinfo's own flag. This is the only moment a partition's own flag can be read; any flag that is clear or unreadable closes the window.devinfo's flag. Read the partition again and compare it with what the checks saw.0x35 |= 0x02withO_DSYNC.O_DIRECT. On a mismatch, write the original back, read it back, and exit 3 (or 4 if that read-back fails).devinforead-only and check it, then the disk.^C, SIGTERM and SIGHUP are blocked during the window. A relock child waits, without a timeout, until the tool says the window is opening. From then on it sets both flags back every 10 s for as long as the tool lives (so a stopped or hung tool can't leave the window open), and once more the moment the tool exits or is killed. The tool also checks that the child is alive before each step that opens anything further.
Recommendation to the maintainer: guard the boot LUNs the way the main LUN is guarded (whole-disk node removed, each partition's own flag set) in a separate PR tested on the 7 Pro, because it changes the shared
initramfs/initand udev rule. With that in place, this tool's window becomesdevinfo's flag alone, the disk flag never changes, and the code here simplifies to that. Other options: (a) accept the disk-level window as is; (c) a raw SCSI write throughSG_IO; (d) a kernel change. Please rule on #252 before this merges.What the tool checks
bootctl/bootctl-device.h: 3.15 on both (husky BATTERY-NOTES and Marking slot B successful: the plan after #125's hold, and for the Pixel 8 Pro #252; tegu NOTES 2026-10-22). Any other major or minor is refused.devinfofound exactly once by PARTNAME, on a boot LUN.--writeneeds--expect "<the dry run's eight bytes>"and the codename, passed or typed.Structure
bootctl/omamobile-bootctl.c,bootctl/bootctl-device.handtest/bootctl. The source and the test are byte-identical in the two packages (test/allchecks), and the header is checked againstdevice.conf. The license is Apache-2.0, withLICENSE.Apache-2.0.src/:bin/omamobile initramfscompiles any device package'ssrc/omamobile-bootctl.cinto the boot image against musl (bin/omamobile:703-716). This PR's first head did that, and it broke both phones' builds on<linux/fs.h>.test/allfail on any file where the builder ortools/stage-boot-fileswould look.<sys/mount.h>; the file also compiles against the Alpine musl sysroot.if [[ -f $ROOT/packages/$DEV_PACKAGE/src/omamobile-bootctl.c ]]; then(bin/omamobile:703). The source is now atpackages/omamobile-device-{husky,tegu}/bootctl/omamobile-bootctl.c, so the probe is false for both phones, and the builder takes the same no-bootctl branch as on main.b8fe1b34…, same Android clang on PATH). tegu's descriptor doesn't build an initramfs on main either (SOC_IDS is missing).initramfs/,bin/ortools/. Cheetah's binary is unchanged.Tests (offline, no phone)
test/bootctlbuilds a-DBOOTCTL_TESTvariant against a fake/sys,/procand/dev. The read-only flags are files that follow the kernel's own-or-disk rule, and every flag change is logged, so recovery cases can show the window really opened before they check that it closed. The production build is compiled too, and checked to contain no test hooks. 53 cases:--expect, codename, no tty, an unbootable or inactive B, mounted devinfo, holders on devinfo, the LUN or a sibling, writers on the LUN, devinfo or a sibling, a duplicate or missing devinfo, the guard not holding, an unreadable sibling flag.devinfoflag that won't set again (5); a failed relock child (5); no relock child, in which case no flag changes at all.35 mutations of the guards are each caught. These include every one the review found surviving: the version major ignored, a newer minor accepted, the first or last sibling skipped, an unreadable sibling accepted, the disk flag left unchecked, the step-4 compare removed, writers on devinfo or a sibling missed, holders checked on devinfo only, the re-check after the prompt removed, the relock read-back, the restore read-back, the child's status or start failure ignored, the child never armed, a one-shot child, and a child that times out from the fork.
Run:
packages/omamobile-device-husky/test/all(which runstest/bootctl --mutations, about 3 minutes) andpackages/omamobile-device-tegu/test/all(the cases only): both pass.tools/pr-check origin/main: passes.Docs
BRINGUP-M1.md("Slot B marked successful by hand") and teguBRINGUP-M1.md§6. Each step has a risk, Expect/Pass, Stop and Rollback, and thefastbootlines pin the serial.omamobile-boot-success"opens exactlydevinfo" isn't accurate. It runsblockdev --setrwon the whole boot LUN, then on the partition (lines 30-31), so it opens the same disk-level window.Versions
husky 0.1.10 and tegu 0.2.13. Open PRs claim husky 0.1.8 and 0.1.9, and tegu 0.2.9, 0.2.10 and 0.2.12. Set them at merge.
Open questions
sd*disk is writable, a USB stick included. Is that intended?🤖 Generated with Claude Code