Repository navigation
initramfs, omamobile-boot-update 0.2.0, omamobile-omarchy 0.1.48, phone-smoke: the storage guard and updates follow the running slot (ACTIVE-SLOT-PLAN §7 steps 2-4) - #847
Merged
Conversation
The guard's allowlist named slot B's images literally, so a release
booted from slot A would have left its own boot images read-only and
slot B writable: the wrong way round (docs/ACTIVE-SLOT-PLAN.md §0, §4).
The packed list stays in slot form (X_b). ufs_rw_load now reads the
running slot from androidboot.slot_suffix in /proc/bootconfig, else
/proc/cmdline, and maps each X_b to X of that slot, keeping userdata;
the other slot stays read-only. With no readable suffix (none, two that
disagree, anything but _a or _b) every boot partition stays read-only
and userdata alone is writable. On slot B the list, the log line and
the partitions left writable are exactly what they were.
bin/omamobile initramfs packs /etc/omamobile-ufs-rw-slot ("running"),
the marker a format-2 bundle is checked for; any other content in it
closes the guard. tests/storage-guard covers slot A and B from
bootconfig and the command line, bootconfig winning, no suffix, two
that disagree, a bad value, the marker absent or malformed, the
hand-over check on A and a second LUN on A.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…m it
A release installed on the slot it ran from (docs/ACTIVE-SLOT-PLAN.md
§2) updates its kernel in place on that slot. boot-update.conf gains
SLOT=a|b; absent means b, so every phone installed before this keeps
writing slot B exactly as before.
The tool refuses unless every androidboot.slot_suffix it finds in
/proc/bootconfig and /proc/cmdline is _$SLOT (a release on A that fell
back to a development system on B never writes B; two values that
disagree, or none, are refused), finds, checks and writes only
<image>_$SLOT, while the descriptor's allowlist stays in slot form
(<image>_b) as the storage guard reads it. For a SLOT other than b it
also refuses a device package whose initramfs lacks the running-slot
marker: an init from before it opens slot B's images whatever slot
boots. previous/ and current/ record their slot (none: b); a rollback
refuses a set saved from the other slot. Messages name the slot.
An older tool refuses a SLOT= line ("anything else is an error"), so a
format-2 phone with an old package fails closed. No device package
depends on this one with a version: the kernel package's plain depends
is enough, as an old tool on a SLOT=a phone refuses rather than writes.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…LOT= line omamobile-update reads boot-update.conf as omamobile-boot-update does, and took any line but AUTO_WRITE and AVB_KEY as unreadable, blocking the kernel update. omamobile-boot-update 0.2.0 adds SLOT=a|b (the slot a release installed on slot A updates in place, ACTIVE-SLOT-PLAN §2); this accepts it, and the test covers a SLOT=a config read with AUTO_WRITE=yes. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…ws; push and flash refuse slot A A release installed on the slot it ran from runs from slot A (docs/ACTIVE-SLOT-PLAN.md §2, §4), so the phone-side checks learn the slot instead of assuming B. tools/phone-smoke's boot row wants the slot boot-update.conf names (SLOT=, b when the file or the line is absent: development phones and every install so far), and its storage guard row allows userdata and the running slot's five boot images, userdata alone when no slot is named. --slot-from DIR (tests only) runs those two rows on a fake root; tests/phone-smoke covers B as before, A with SLOT=a, A without it, a SLOT=a phone that fell back to B, the other slot's images writable either way, and no slot named. bin/omamobile push reads the slot first (read only, the matched suffix alone) and refuses a phone on slot A: "this phone runs a release from slot A; push writes slot B, development only". flash reads fastboot's current-slot and refuses slot A too, since it writes slot B and makes it active. Fastboot can't tell a release on A from stock Android on A, and a development phone that fell back to stock (or that `omamobile fastboot` crashed into it) is flashed from there, so OMAMOBILE_FLASH_FROM_SLOT_A=yes names that case; the message says so. A phone on B, or one that names no slot, is unchanged. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
derekross
added a commit
that referenced
this pull request
Nov 16, 2026
The install link's patch checks that boot-update.conf ends with "AUTO_WRITE=yes\n" (found by the phone-side branch, #847), so a format 2 install writes SLOT=<target> on its own line before it. Format 1's file is unchanged; the test checks the order and the file's last line. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…lopment phone §7 step 2 asks for its own short runbook, since the init is in every image and in device-cheetah's boot files: a slot-B boot of the new guard with the partitions' ro values compared before and after, read-only steps first, before the device-cheetah version moves. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…ge-guard under busybox ash Review of #847: when /proc/bootconfig carries androidboot.slot_suffix at all, the guard now reads only it, so an empty or unquoted value there is unknown (boot partitions read-only) rather than a reason to fall back to the command line. tests/storage-guard gains those two cases and a "_?" suffix with a file _a in the current directory, in bootconfig and on the command line, which fails if set -f is removed; GUARD_SH runs the guard under another shell (busybox ash, as on the phone). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Review of #847: stage 2's storage guard now opens the boot images of the slot androidboot.slot_suffix names, and the chain forwards that suffix from bootconfig, chosen/bootargs or the packed OMAMOBILE_SLOT fallback. This chain boots slot B only, so any other value (slot A, a stray packed string) is logged and not forwarded, and stage 2 keeps every boot partition read-only. tests/boot-method runs the filter on _b, _a, a stray value and none. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…es the environment override Review of #847. push now requires the phone to name slot B before anything else, modules-push included: slot A, no slot named, or a failed read is refused. flash's override for a development phone that fell back to stock on slot A is an explicit flag, --from-slot-a, which prints a loud warning and waits 10 s before writing slot B and making it active; the OMAMOBILE_FLASH_FROM_SLOT_A variable is gone. CONTRIBUTING §3.4 step 5, KERNEL-UPDATE-PLAN's fastboot recovery and ACTIVE-SLOT-PLAN §6.1's rollbacks name the flag. The plan's risks gain one: a RAM boot with stock active on slot A now opens stock's _a boot images. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
… other slot's previous/ moved aside Review of #847. A boot-update.conf that names SLOT twice is refused by omamobile-boot-update, fails phone-smoke's boot row and is unreadable to omamobile-update, the same verdict everywhere. A previous/ saved from the other slot is no longer deleted before the next save: it is moved to previous.slot-<x>-<time>, intact. Tests for each. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
derekross
force-pushed
the
active-slot-phone
branch
from
November 16, 2026 16:08
8f64bbf to
74de60c
Compare
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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.
Steps 2-4 of ACTIVE-SLOT-PLAN §7: the phone-side half of "a release installs on the running slot". No descriptor sets
INSTALL_SLOTyet and no manifest is format 2, so no install changes. Nothing here was run on a phone.This changes what release phones boot.
initramfs/initis in device-cheetah's boot files. Per AGENTS, the maintainer sets the device-cheetah version only after an image built from this has booted on the 7 Pro, so device-cheetah is not bumped here. The short slot-B runbook for that boot is in the plan as §6.1 (G0-G3, read-only steps first).Step 5 (omamobile-modem) moved to its own draft, #850, after review. It changed every phone running today (modem_b instead of modem_a), and it only gates accepting
b.What changes
initramfs/init,bin/omamobile,tests/storage-guard). The packedUFS_RWstays in slot form (X_b).ufs_rw_loadreadsandroidboot.slot_suffixfrom/proc/bootconfig, and from/proc/cmdlineonly when bootconfig doesn't carry the key; an empty or unquoted value in bootconfig counts as unknown. It maps eachX_btoX_<running>, keepsuserdata, and leaves the other slot read-only. If no suffix can be read (none, two that disagree, or anything other than_a/_b), every boot partition stays read-only and onlyuserdatais writable.bin/omamobile initramfsnow packs/etc/omamobile-ufs-rw-slot=running, and any other content in that file closes the guard. On slot B, the list, theallowlist:log line and the writable partitions are exactly what they were. Changed behaviour: a boot that names no slot (for example afastboot bootRAM boot whose bootloader passes no suffix) now leaves the boot images read-only. Before,_bwas writable.boot-update.confgainsSLOT=a|b. When the line is absent the slot isb, so every existing phone works as before. The tool refuses unless every suffix it finds is_$SLOT. It finds, checks and writes only<image>_$SLOT, and the allowlist check stays in slot form. WhenSLOTis notb, it also refuses a device-package initramfs that lacks the running-slot marker, because an older init opens slot B whatever slot boots.previous/andcurrent/record their slot; when they don't, the slot isb. A rollback refuses a set saved from the other slot, and the next save moves such a set aside toprevious.slot-<x>-<time>instead of deleting it. A secondSLOT=line is refused, and phone-smoke and omamobile-update give the same verdict. Messages name the slot. Thedescriptor.shcomments, the example conf, the README, pkgdesc and the hook text are updated.omamobile-updateread everyboot-update.confline other thanAUTO_WRITE/AVB_KEYas "unreadable", which would have blocked kernel updates on aSLOT=phone. It now acceptsSLOT=a|b.optdepends, andlinux-omamobilehas a plaindepends. A versioned depends isn't needed, because 0.1.0 refuses aSLOT=line, so it fails closed.tools/phone-smoke, the boot row expects the slot thatboot-update.confnames (bwhen absent). The guard row allowsuserdataplus the running slot's five images, or onlyuserdatawhen no slot is named. A test-only--slot-from DIRruns both rows on a fake root.bin/omamobile pushreads the slot first, before anything else including modules-push. It requires_b, refuses slot A with "this phone runs a release from slot A; push writes slot B, development only", and also refuses a phone that names no slot or whose slot can't be read.bin/omamobile flashreadsgetvar current-slotand refusesa, unless--from-slot-ais given (see the note below).device/dodge: the chainload forwardsandroidboot.slot_suffixto stage 2 only when it is_b. Anything else is logged and dropped, so stage 2's guard keeps the boot partitions read-only.flashon slot A (the maintainer to confirm the flag)From fastboot, a release on slot A and stock Android on slot A look the same. A development phone that falls back to stock (or that
bin/omamobile fastbootcrashes into slot A) is normally re-flashed from that state. So a plain refusal would break the documented development recovery.flashtherefore refuses slot A by default, andbin/omamobile flash --from-slot-acovers that case: it prints a loud warning and waits 10 s before writing. CONTRIBUTING §3.4 step 5, KERNEL-UPDATE-PLAN's fastboot recovery and the plan's §6.1 rollbacks name the flag. The plan's risks also note that a RAM boot with stock active on A now opens stock's_aimages.Tests (all offline)
tests/storage-guard:_c;_?with a file_ain the current directory, in bootconfig and on the command line (this fails ifset -fis removed);It passes under the host's
shand under busybox ash (GUARD_SH=<busybox sh>, Alpine 3's busybox and musl). The reviewer's adversarial harness gives the expected results too.packages/omamobile-boot-update/test/all: a fullSLOT=awrite, save, status and rollback; a mismatch both ways; an initramfs without the marker; bad and repeatedSLOT=lines; per-slotprevious/andcurrent/, with the other slot's set moved aside; legacy sets counting as slot B.tests/phone-smoke(nine cases, including a repeatedSLOT=line),tests/images-layout(push on A, with no slot, or when the read fails; flash on A with and without--from-slot-a),tests/boot-method(dodge's_b-only forwarding), andpackages/omamobile-omarchy/test/update.sh.Results:
tests/packagespassed all 33 suites, andtools/pr-check origin/mainpassed. Also passing:storage-guard(sh and busybox),images-layout,phone-smoke,boot-update-parity,install-phone,install-phone-initramfs,make-bundle,stage-boot-files,initramfs-steps,initramfs-reproducible,boot-method,rootfs-placeholders,tools-help,pr-check,install-guided,nv-backup,phone-provision.🤖 Generated with Claude Code