Skip to content

device/dipper: add a RAM-only first-light build path - #505

Open
quatrixone wants to merge 4 commits into
derekross:mainfrom
quatrixone:dipper-device-support
Open

quatrixone wants to merge 4 commits into
derekross:mainfrom
quatrixone:dipper-device-support

Conversation

@quatrixone

@quatrixone quatrixone commented Nov 7, 2026 •

Copy link
Copy Markdown

Adds the Xiaomi Mi 8 as a WIP RAM-only bring-up target. The descriptor disables generic image installation, flash and push; the builder creates an Android v1 image for fastboot boot, and the initramfs keeps every UFS partition read-only. The runbook gates backup checksums, fastboot serial selection and RAM boot. The device remains under Wanted until notes PR #330 merges.

Kernel dependencies are public for review in linux-omarchy-mobile PRs #218–#221. The button recovery entry is in PR #499.

This is an initial first-light path, not a complete installable device port. Wi-Fi, per-device identity and persistent installation remain disabled; identity must use debugfs without mounting persist.

Checks: tests/dipper-probe and git diff --check passed. No kernel build or hardware probe was run.

The Mi 8 has one OS boot partition, so a failed persistent update has no
known-good OS slot to return to. Keep this first integration RAM-only:
the descriptor is non-installable, the builder emits an Android v1 image
for fastboot boot, and its storage allowlist is empty.

Add the Dipper kernel fragment, a bounded image packer, a read-only
initramfs build, recovery instructions, and a WIP device matrix row. Wi-Fi
identity, firmware and any persistent install path stay out until their
own safety gates are met.

Checks: git diff --check and bash -n passed. Kernel build and hardware
probe not run in this session.
@derekross

Copy link
Copy Markdown
Owner

Thank you for this. A RAM-only first-light path is the right way to start a phone with no second slot, and the descriptor does what you say. BOOT_METHOD=ram-only and the empty UFS_RW make bin/omamobile and the installer refuse it before any phone command, as they do for the Pixel 4. The image packs an empty allowlist, so the shared init leaves every partition read-only and never hands over to userdata. The guard code goes into the image unchanged, the watchdog is taken over and fed, panic=10 is on the command line, and nothing writes the phone. The identifier and blob checks pass, and the device-related suites pass on the branch (CI is waiting for my approval).

A few things before it can merge:

1. The matrix row. DEVICES.md's matrix is for devices with merged notes, and the notes are still in review in #330. Until #330 merges, the Mi 8 belongs in the "Wanted" table, with a link to this PR and #330. Once #330 is in, a matrix row is welcome, with these changes:

  • the cells should say what they rest on. The 10-29 boot used an unpublished kernel (…-dirty) and a bring-up init that left logdump writable, so "testing (UFS read-only guard)" can't cite it. Until this builder's image has run, Storage, Display, Buttons and USB net are WIP, with the kernel PRs linked as other rows do ([kernel #218](https://github.com/derekross/linux-omarchy-mobile/pull/218)). A bare "device-dodge: follow-ups from #111 (fastboot refuse, install bind trap, park deliberate panic) #218" reads as a PR in this repository;
  • the row has 24 cells and the table has 25. The AoC column should be "-" (the phone has none), as on the Pixel 4;
  • please put it after the Pixel 4 and 4 XL pair rather than between them.

2. One run of this image. The description says no kernel build or phone probe ran for this PR. A device change needs a report from the phone. tools/phone-smoke is built around Pixels, so read-only checks will do. Please boot the image this builder makes once, attended, and record in the notes:

  • uname -r and the kernel PR heads it was built from;
  • the sha256 of boot.img;
  • grep . /sys/block/sd*/ro /sys/block/sd*/sd*/ro, every line 1, and the ufs-ro lines from dmesg;
  • the watchdog taking over and USB/SSH coming up;
  • what you didn't test.

3. The runbook in gated form. BRINGUP-M1 explains the recovery well. The phone steps need the usual shape, though: Expect/Pass, a stop condition, a rollback and a risk level for each step, read-only checks first. Also please pass -s <serial> on every fastboot command (getvar, boot), so nothing reaches another phone on the same computer. Please also add a step that confirms your backup's checksums before the boot.

Smaller things:

  • OUT defaults to ../out/dipper, outside the repository. Our builders write to the repository's gitignored out/<codename>/, so please use that.
  • modules_install runs on the host with LLVM=1, so it needs the host's llvm-strip. Everything else in the project builds in the container, and bin/omamobile modules already makes the modules tarball, so it could do this step too.
  • initramfs-inside.sh says "Adapted from tools/alioth/build-initramfs.sh", which is in no tracked file (it's in the open device-alioth: add experimental POCO F3 source build and guarded installer #25). Please drop it, or name the PR.
  • Patching the shared init by string replacement works, and the guard goes in untouched. The shared init already has a descriptor-driven module step (INITRAMFS_MODULES), though, and a watchdog step could be added the same way, so the image would run the checked-in init as it is. That doesn't have to happen now. In the meantime, a small test like tests/flame-probe would help: run build-boot.py on dummy inputs to check the header and the size limits, and run the patch step on initramfs/init to show the anchors still match.
  • FIRMWARE_DIR staging has no user in a RAM-only build. It could wait for the root filesystem PR.
  • device/dipper/kernel.config is right for bring-up. Most of what's in it (built-in PHYs, UFS glue) would break no other phone, though, and the release kernel is one build from the shared fragment. Given this ABL's 16 MiB kernel limit, I'd like the plan to say how a release kernel could ever fit. That's for later, not for this PR.
  • The PR description shows literal \n\n.

On order: this goes after #330, since its links and the matrix row need the notes. It builds only on linux-omarchy-mobile #218, because prune-modules.py and the vermagic check stop without the EA8074 module, and on #220 for the DTB. Its root compatible is xiaomi,dipper, which matches the descriptor. #219 adds touch, and #221 isn't needed for a RAM probe. The title is fine for the squash.

@derekross

Copy link
Copy Markdown
Owner

Thanks for working through the list. The Mi 8 now sits in the Wanted table with the right links. The runbook has a backup gate, a fastboot gate and a RAM boot gate, with -s on every fastboot command. OUT is out/dipper, the modules come from bin/omamobile modules, the alioth reference and FIRMWARE_DIR are gone, and there's a tests/dipper-probe. I ran it, tests/storage-guard and tests/device-overlays on the branch, and they pass.

What's still needed before merge:

1. One run of this image. This is the same request as last time, and the main one. Please boot the image this builder makes once, attended, and record in the notes:

  • uname -r and the kernel PR heads it was built from;
  • the sha256 of boot.img;
  • grep . /sys/block/sd*/ro /sys/block/sd*/sd*/ro, every line 1, and the ufs-ro lines from dmesg;
  • the watchdog taken over (qcom_wdt bound, the feeder running) and USB/SSH up;
  • grep -i -E 'reserved|System RAM' /proc/iomem (see the kernel [Device support request] Samsung Galaxy S22 Ultra #220 thread for why);
  • what you didn't test.

One expectation to put in that step: with kernel #220 as it stands, the screen will most likely go dark about 30 seconds after boot. I've explained why on #220. If the screen does go dark there, that's the regulator cleanup, not a hang.

2. The RAM boot gate's Pass. "USB/SSH checks succeed" should name the checks above, the read-only flags first, with "any partition reads 0" as a stop condition. The rollback ("power-cycle to the installed boot image") also needs the forced-restart combination, which I've asked for on #499.

3. Order. This branch now also carries #503's init change (your 4f7bc1f3 is #503's tree). That's fine, but it means #505 merges after #503. If #503 changes again, after #484, please carry the same version here, or rebase onto main once #503 is in.

Smaller things:

  • The builder's closing hint still says fastboot boot boot.img. Please make it fastboot -s <serial> boot boot.img, as the runbook has it.
  • The initramfs loads panel-samsung-ea8074, but [Device support request] Samsung Galaxy S22 Ultra #220's DTB keeps the panel disabled and gives its node no compatible, so the module can't bind. Leaving it out until the panel is enabled would also drop this PR's build dependency on kernel device-dodge: follow-ups from #111 (fastboot refuse, install bind trap, park deliberate panic) #218.
  • tests/dipper-probe checks that the patcher contains its anchors, not that initramfs/init does. The patcher's own asserts stop the build if they drift, so nothing breaks silently. Running the patch step on initramfs/init in the test would show the drift before a build, though.

The title is fine for the squash.

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