Skip to content

initramfs: make development root protections descriptor-driven - #562

Merged
derekross merged 3 commits into
derekross:mainfrom
latentoperator:revision/initramfs-root-policy-20261109
Nov 12, 2026
Merged

derekross merged 3 commits into
derekross:mainfrom
latentoperator:revision/initramfs-root-policy-20261109

Conversation

@latentoperator

@latentoperator latentoperator commented Nov 9, 2026 •

Copy link
Copy Markdown
Contributor

Keep existing unlabeled development roots bootable while making root-label checks, persistent-development handover and RAM rescue explicit descriptor policies. No shipped descriptor opts in.

NFS retains priority and cannot fall through to userdata. Persistent handover creates its pending marker only after the final storage guard succeeds; a surviving marker holds every subsequent boot in RAM until explicitly cleared. RELEASES documents the matching ready-service prerequisite, exact recovery commands, slot-try limits and release-build refusal of development-only policies. The ready helper follows in #565.

Validation on main 6ee77fb: full tests/all and policy pass; focused tests exercise unchanged default packing, invalid/release policies, NFS isolation, final-guard refusal, stale/repeated holds, label/fsck cases and marker ordering. Independent review also verified identical packing outcomes for all 15 existing descriptors. No phone operation or revised-kernel qualification is claimed. Fresh published-head CI is tracked below.

Published-head validation: both Policy and Tests (tests/all, every package) passed on 63fa8bf63df9c5acba8ef8e68e1189a5f6e247d8. The complete combined local integration also passes tests/all and tests/packages with PYTHONUNBUFFERED unset, matching CI.

@derekross

Copy link
Copy Markdown
Owner

Thanks, Chris. This is what I hoped for: the label and fsck checks and the USB-recovery opt-out are now descriptor keys that nothing sets by default. I checked that every existing descriptor packs exactly the same initramfs files as before, so the Pixel 7 Pro's boot path is unchanged. Two small things when you take it out of draft: please add the three keys to the descriptor table in RELEASES §3, and note there that persistent-development needs the SSH-ready helper on the root to clear the pending marker, or every second boot stays in RAM.

@latentoperator
latentoperator force-pushed the revision/initramfs-root-policy-20261109 branch from fda1b83 to b35e5b2 Compare November 10, 2026 18:23
@latentoperator
latentoperator marked this pull request as ready for review November 10, 2026 18:32
@derekross

Copy link
Copy Markdown
Owner

Thanks, Chris. Both things I asked for are in, and I checked the two claims that matter most myself: every descriptor in the tree packs exactly the same initramfs files with this merged as without it, and every new line in the init sits behind a file that none of them packs, so no existing phone changes, the Pixel 7 Pro included. The storage guard is untouched, and with the label key set the init is stricter than today. I won't need a separate boot on my phone for this; its next routine push covers it.

Two things before I merge:

  1. It needs a rebase: initramfs: add guarded NFS root for bring-up #503 (the NFS root) landed today and changed the last lines of initramfs/init. Please keep main's if [ -s /etc/omamobile-nfsroot ] branch first and call boot_root in its else, so a requested NFS root still never falls through to userdata. I tried that resolution and your three tests, the storage-guard test and the grow test all pass on it.
  2. A correction to my own wording, sorry: I wrote "every second boot stays in RAM", and you put that in RELEASES as asked. It isn't what the code does. A held boot leaves the marker where it is, so without the helper the first boot hands over and every boot after it stays in RAM until the marker is removed by hand. That's the right behaviour, so please change the two sentences to say that, and add how to clear it from the RAM shell (mount userdata, remove /var/lib/omamobile/root-boot-pending, unmount). One more sentence would help: with USB recovery left on, each held boot without a USB host also spends a slot try.

Two smaller things, take them or leave them. The marker is written before the last "anything writable outside the allowlist" check, so if that check stops the boot, the next one reports "did not reach SSH" for what was a guard stop; writing the marker after that check would keep them apart. And since #503 refuses its NFS root for a --release initramfs, the same refusal for INITRAMFS_ROOT_MODE and INITRAMFS_USB_RECOVERY=no would fit.

I'll merge #565 after this one, since its helper clears this marker.

derekross pushed a commit that referenced this pull request Nov 11, 2026
…encies (#561)

Records the Pixel 6a's persistent desktop on its development kernel, what can and can't be reproduced from published sources, the one slot-success write with its before and after bytes, and the hold on further marking. Lists the split pull requests (#562, #563, #565) and the kernel pull requests the port still waits on. Documentation only.

Co-Authored-By: OpenAI Codex <noreply@openai.com>
latentoperator and others added 3 commits November 11, 2026 12:01
Opt in to labelled-root identification and strict fsck handling without
changing old hand-installed roots. Pack neutral handover and USB-recovery
settings; keep unknown modes and incomplete development boots in RAM.

Exercise the actual shell functions and descriptor packer with isolated
fixtures, including legacy roots and failed filesystem checks.

Co-Authored-By: OpenAI Codex <noreply@openai.com>
List all three opt-in keys in the descriptor table. Require the matching SSH-ready service to be installed and enabled before persistent-development handover so its marker does not hold the following boot in RAM.

Co-Authored-By: OpenAI Codex <noreply@openai.com>
Write the development handover marker only after the final guard, keep every held boot in RAM until recovery clears the marker, and refuse local root policies in release images. Cover NFS failure isolation, guard refusals, persistent holds and release preflight.

Co-Authored-By: Codex <noreply@openai.com>
@latentoperator
latentoperator force-pushed the revision/initramfs-root-policy-20261109 branch from b35e5b2 to 63fa8bf Compare November 11, 2026 18:19
@derekross

Copy link
Copy Markdown
Owner

Thanks, Chris. Everything from last time is in, including the two optional ones.

  • The NFS branch stays first and boot_root runs only in its else; your policy test shows a failed NFS root never reaches userdata.
  • RELEASES now says what the code does (the first boot hands over, every later boot is held until the marker is removed), with the commands to clear it from the RAM shell and the note about slot tries.
  • The marker is written only after the last guard check, with a test for the guard-stop case, and --release refuses the two development settings before anything is downloaded.

I ran it merged onto today's main: tools/pr-check, your three tests, and the grow, storage-guard and initramfs-steps tests all pass, and every descriptor in the tree packs exactly the same initramfs files with and without this change, so no existing phone changes, the Pixel 7 Pro included.

Merging this now, then #565.

@derekross
derekross merged commit 0225677 into derekross:main Nov 12, 2026
2 checks passed
derekross pushed a commit that referenced this pull request Nov 12, 2026
…lled by nothing (#565)

The Pixel 6a's historical start-up helpers, units, overlays, probe tools and kernel config fragment live under `device/bluejay/bringup/` and `overlays/`; no package installs them, no unit is enabled, and the descriptor lists no overlay, so builds and images for bluejay are unchanged. They belong to the tested kernel `c934e316b` (`7.3.0-rc6-omamobile-bluejay-input-gated0`) and refuse any other. The ready helper clears the pending marker #562's `persistent-development` mode writes, once the USB address and sshd are up; the README carries the next-run gate and the install and undo commands for the check and ready pair, none of them executed yet.

Co-Authored-By: OpenAI Codex <noreply@openai.com>
Co-Authored-By: Codex <noreply@openai.com>
derekross added a commit that referenced this pull request Nov 12, 2026
…bers #403's reboot-to needs (#683)

#403 changed src/reboot-to.c in every device package, but four of them
had no new number on its branch: main had moved to the same one, or the
branch never bumped it. Without a new number the build keeps the old
package, so those phones would not get the reboot-to that notes a
deliberate restart.

Three of the four here. Their packages carry no boot image, so the bump
only rebuilds the binary.

device-cheetah stays at 0.1.51 on purpose. Its package carries the
Pixel 7 Pro's boot image, which release phones write to slot B at the
update, and the image's inputs have changed twice since the last one
that booted (#667): initramfs/init (#562) and reboot-to.c (#403). It
gets 0.1.52 once an image built from this tree has booted on the 7 Pro,
as 0.1.51 did.

Co-authored-by: Claude Fable 5.2 <noreply@anthropic.com>
derekross added a commit that referenced this pull request Nov 12, 2026
… and #562's init reaches installed phones (#691)

The Pixel 7 Pro's package carries its boot image, and release phones
write it to slot B at the update. Two of the image's inputs changed since
0.1.51: initramfs/init (#562: the optional root label check, development
handover and RAM rescue keys, all unset for this phone) and reboot-to.c
(#403: it notes a deliberate restart). 0.1.51 was held until an image
built from this tree had booted on the phone.

It has, on 2026-11-12, by the path a release phone takes: the package
built with boot files staged from main on the release kernel
(7.3.0-rc6-omamobile-g1a9d1d4e9289) and installed with pacman. Against
0.1.51's initramfs exactly two files differ, init and reboot-to; the dtbo
is the same. The hook found four of slot B's five images already there
and wrote vendor_kernel_boot_b, verified, with the previous slot B saved.
After a clean restart the phone booted it: system running, no failed
unit, /run 0755, the root filesystem mounted without recovery, no UFS
error-handler pass, the modem ONLINE, and tools/phone-smoke passing.

With this the 7 Pro's packaged reboot-to is #403's too.

Co-authored-by: Claude Fable 5.2 <noreply@anthropic.com>
robertzas pushed a commit to robertzas/omarchy-mobile that referenced this pull request Nov 14, 2026
…encies (derekross#561)

Records the Pixel 6a's persistent desktop on its development kernel, what can and can't be reproduced from published sources, the one slot-success write with its before and after bytes, and the hold on further marking. Lists the split pull requests (derekross#562, derekross#563, derekross#565) and the kernel pull requests the port still waits on. Documentation only.

Co-Authored-By: OpenAI Codex <noreply@openai.com>
robertzas pushed a commit to robertzas/omarchy-mobile that referenced this pull request Nov 14, 2026
…escriptor keys, off by default (derekross#562)

Three optional descriptor keys (`INITRAMFS_ROOT_LABEL`, `INITRAMFS_ROOT_MODE`, `INITRAMFS_USB_RECOVERY`) pack policy files that the shared init reads; no descriptor sets them, and every existing descriptor packs the same initramfs files as before, so no phone's boot changes. With the label key the init checks the ext4 label and the `e2fsck -p` status before it mounts userdata; `persistent-development` writes a pending marker after the final storage-guard check and holds every later boot in RAM until a ready helper (or the owner) removes it; a requested NFS root still never falls through to userdata, and `initramfs --release` refuses the development settings.

Co-Authored-By: OpenAI Codex <noreply@openai.com>
Co-Authored-By: Codex <noreply@openai.com>
robertzas pushed a commit to robertzas/omarchy-mobile that referenced this pull request Nov 14, 2026
…lled by nothing (derekross#565)

The Pixel 6a's historical start-up helpers, units, overlays, probe tools and kernel config fragment live under `device/bluejay/bringup/` and `overlays/`; no package installs them, no unit is enabled, and the descriptor lists no overlay, so builds and images for bluejay are unchanged. They belong to the tested kernel `c934e316b` (`7.3.0-rc6-omamobile-bluejay-input-gated0`) and refuse any other. The ready helper clears the pending marker derekross#562's `persistent-development` mode writes, once the USB address and sshd are up; the README carries the next-run gate and the install and undo commands for the check and ready pair, none of them executed yet.

Co-Authored-By: OpenAI Codex <noreply@openai.com>
Co-Authored-By: Codex <noreply@openai.com>
robertzas pushed a commit to robertzas/omarchy-mobile that referenced this pull request Nov 14, 2026
…bers derekross#403's reboot-to needs (derekross#683)

derekross#403 changed src/reboot-to.c in every device package, but four of them
had no new number on its branch: main had moved to the same one, or the
branch never bumped it. Without a new number the build keeps the old
package, so those phones would not get the reboot-to that notes a
deliberate restart.

Three of the four here. Their packages carry no boot image, so the bump
only rebuilds the binary.

device-cheetah stays at 0.1.51 on purpose. Its package carries the
Pixel 7 Pro's boot image, which release phones write to slot B at the
update, and the image's inputs have changed twice since the last one
that booted (derekross#667): initramfs/init (derekross#562) and reboot-to.c (derekross#403). It
gets 0.1.52 once an image built from this tree has booted on the 7 Pro,
as 0.1.51 did.

Co-authored-by: Claude Fable 5.2 <noreply@anthropic.com>
robertzas pushed a commit to robertzas/omarchy-mobile that referenced this pull request Nov 14, 2026
…reboot-to and derekross#562's init reaches installed phones (derekross#691)

The Pixel 7 Pro's package carries its boot image, and release phones
write it to slot B at the update. Two of the image's inputs changed since
0.1.51: initramfs/init (derekross#562: the optional root label check, development
handover and RAM rescue keys, all unset for this phone) and reboot-to.c
(derekross#403: it notes a deliberate restart). 0.1.51 was held until an image
built from this tree had booted on the phone.

It has, on 2026-11-12, by the path a release phone takes: the package
built with boot files staged from main on the release kernel
(7.3.0-rc6-omamobile-g1a9d1d4e9289) and installed with pacman. Against
0.1.51's initramfs exactly two files differ, init and reboot-to; the dtbo
is the same. The hook found four of slot B's five images already there
and wrote vendor_kernel_boot_b, verified, with the previous slot B saved.
After a clean restart the phone booted it: system running, no failed
unit, /run 0755, the root filesystem mounted without recovery, no UFS
error-handler pass, the modem ONLINE, and tools/phone-smoke passing.

With this the 7 Pro's packaged reboot-to is derekross#403's too.

Co-authored-by: Claude Fable 5.2 <noreply@anthropic.com>
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.

2 participants