From 5739866a406aab94d0349d29c6a6959f3bd93f97 Mon Sep 17 00:00:00 2001 From: quatrixone Date: Sun, 8 Nov 2026 00:16:30 +0100 Subject: [PATCH 01/22] device/dipper: add a RAM-only first-light build path 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. --- device/dipper/BRINGUP-M1.md | 63 +++++++++++++ device/dipper/device.conf | 11 +++ device/dipper/kernel.config | 88 ++++++++++++++++++ docs/DEVICES.md | 1 + tools/dipper/build | 97 ++++++++++++++++++++ tools/dipper/build-boot.py | 153 +++++++++++++++++++++++++++++++ tools/dipper/initramfs-inside.sh | 129 ++++++++++++++++++++++++++ tools/dipper/prune-modules.py | 72 +++++++++++++++ 8 files changed, 614 insertions(+) create mode 100644 device/dipper/BRINGUP-M1.md create mode 100644 device/dipper/device.conf create mode 100644 device/dipper/kernel.config create mode 100755 tools/dipper/build create mode 100755 tools/dipper/build-boot.py create mode 100755 tools/dipper/initramfs-inside.sh create mode 100755 tools/dipper/prune-modules.py diff --git a/device/dipper/BRINGUP-M1.md b/device/dipper/BRINGUP-M1.md new file mode 100644 index 000000000..30bd6d277 --- /dev/null +++ b/device/dipper/BRINGUP-M1.md @@ -0,0 +1,63 @@ + +# Xiaomi Mi 8 (dipper): RAM-only first light + +**Status (2026-11-08):** first-light results are recorded in [the notes PR #330]. +Kernel support is public for review in [panel #218], [touch #219], +[DTS #220] and [ath10k #221]. These PRs are not merged yet. The direct EA8074 +panel driver and FTS5 touchscreen path still need testing on the current kernel. + +This is a RAM-only bring-up. Dipper has one OS `boot` partition and no alternate +OS slot. The descriptor sets `BOOT_METHOD=ram-only`, the builder makes only a +`fastboot boot` image, and the initramfs keeps every UFS partition read-only. +There is no supported flash, push, installer or persistent update path here. + +## Recovery and safe boot + +- Enter fastboot with **Volume Down + Power**. The device's §3.1 recovery entry + is in [PR #499](https://github.com/derekross/omarchy-mobile/pull/499). +- Check the bootloader's unlocked state with `fastboot getvar unlocked`. +- Boot the generated image with `fastboot boot boot.img`. Do not use + `fastboot flash`, `bin/omamobile flash`, `bin/omamobile push`, or the installer. +- Because the image is loaded into RAM and does not write UFS, a power cycle + returns to the boot image already installed on the phone. Keep the phone and + a USB cable present during every probe. +- If the USB host never configures, the shared initramfs waits, shows its log, + then panics after 20 seconds. On this RAM-only path that does not alter the + installed `boot`; use the buttons to return to fastboot if the phone does not + resume stock Android by itself. + +## Build and probe + +Build a kernel checkout containing the Dipper kernel PRs with +`device/dipper/kernel.config` merged after the shared Omarchy Mobile fragment. +Set `DEVICE=dipper`, `KERNEL_DIR` (source), and `KERNEL_OUT` (build output), then +run `bin/omamobile kernel`. The output must include `Image`, `Image.gz`, +`arch/arm64/boot/dts/qcom/sdm845-xiaomi-dipper.dtb`, and modules from that same +kernel release. Then set `SSH_PUBKEY` to an OpenSSH public key and run +`tools/dipper/build` with the same `KERNEL_DIR` and `KERNEL_OUT`. The builder +requires Docker with arm64 emulation; it writes its output outside the source +tree by default. Do not commit the key or generated images. + +The initramfs provides USB networking, SSH and a rescue shell. It does not +mount `persist`, read or embed per-phone identifiers, start Wi-Fi, or install a +root filesystem. The network daemon binds only to the IPv4 address assigned to +`usb0`. No Wi-Fi credentials, MAC addresses or private keys belong in the +repository; the SSH public key and generated host key stay in the local output. + +## What remains + +- Do not flash until there is a reviewed, device-specific recovery plan and a + verified stock backup. This PR deliberately adds no persistent writer. +- The initramfs has no Arch root yet. A later NFS-root path must remain in the + rescue shell when the host or export is unavailable; it must not fall through + to the phone's writable userdata. +- Wi-Fi needs firmware and the phone's own WLAN address. Read identity files + from `persist` with `debugfs` (read-only) before enabling that service; never + mount `persist`. +- Test the panel and FTS5 changes on the phone before marking them supported. + +[panel #218]: https://github.com/derekross/linux-omarchy-mobile/pull/218 +[touch #219]: https://github.com/derekross/linux-omarchy-mobile/pull/219 +[DTS #220]: https://github.com/derekross/linux-omarchy-mobile/pull/220 +[ath10k #221]: https://github.com/derekross/linux-omarchy-mobile/pull/221 +[the notes PR #330]: https://github.com/derekross/omarchy-mobile/pull/330 diff --git a/device/dipper/device.conf b/device/dipper/device.conf new file mode 100644 index 000000000..22f7407ab --- /dev/null +++ b/device/dipper/device.conf @@ -0,0 +1,11 @@ +# SPDX-License-Identifier: MIT +# RAM-only first-light descriptor for Xiaomi Mi 8 (dipper). +# Persistent install/update is disabled: the phone has one OS boot partition. +CODENAME=dipper +NAME="Xiaomi Mi 8" +SOC=sdm845 +COMPATIBLE="xiaomi,dipper" +BOOT_METHOD=ram-only +BOOT_IMAGES="" +UFS_RW="" +PANEL_SIZE=1080x2248 diff --git a/device/dipper/kernel.config b/device/dipper/kernel.config new file mode 100644 index 000000000..0041943af --- /dev/null +++ b/device/dipper/kernel.config @@ -0,0 +1,88 @@ +# SPDX-License-Identifier: MIT +# dipper's kernel fragment, merged after kernel/configs/omamobile.config. +# +# Everything the phone needs to reach a shell is built in, not a module. The +# first boot proved why: arm64 defconfig makes the Qualcomm PHY drivers and the +# UFS glue modules, while dwc3 and ufshcd are built in. So they probed, found no +# PHY, and gave up -- the kernel logged +# platform a600000.usb: deferred probe pending: dwc3: failed to initialize core +# gcc-sdm845 100000.clock-controller: sync_state() pending due to 88e8000.phy +# and the initramfs never got USB or storage. Modules in the initramfs do not +# help when nothing loads them before the devices probe. + +# USB and UFS PHYs. Without these, both the USB gadget and storage are dead. +CONFIG_PHY_QCOM_QMP=y +CONFIG_PHY_QCOM_QMP_COMBO=y +CONFIG_PHY_QCOM_QMP_UFS=y +CONFIG_PHY_QCOM_QUSB2=y + +# Storage: the core is already built in, the Qualcomm glue was not. +CONFIG_SCSI_UFS_QCOM=y + +# The Type-C port manager on the PMIC, for the role switch and VBUS detection. +CONFIG_TYPEC_QCOM_PMIC=y + +# The kernel's simple-framebuffer is the first-light console. Keep the DSI +# panel driver modular so the probe can try it without growing the built-in +# kernel past this bootloader's size limit. +CONFIG_DRM_PANEL_SAMSUNG_EA8074=m + +# Touch, so a working panel is usable without waiting for userspace. +CONFIG_TOUCHSCREEN_STMFTS=y + +# Console log into the stock ramoops region: the only way to read an early hang +# on a phone with no serial header. +CONFIG_PSTORE=y +CONFIG_PSTORE_RAM=y +CONFIG_PSTORE_CONSOLE=y + +# --- the same lesson, applied to everything first light touches --------------- +# Devices probe once, early. A driver that only turns up later as a module never +# gets a second chance: the device is left unbound and not even on the deferred +# list. The first boot proved it for the PHYs; the second proved it again for +# i2c (geni_i2c loaded by hand bound to nothing, and `bind` by hand failed). +# So everything needed to reach a usable system is built in. + +# i2c: the touchscreen lives on i2c14, and nothing on that bus exists without it. +CONFIG_I2C_QCOM_GENI=y +CONFIG_QCOM_GPI_DMA=y +# Nothing of ours is on SPI, so it stays a module: every built-in byte counts +# against the ABL kernel limit below. +CONFIG_SPI_QCOM_GENI=m + +# Display comes from the bootloader's framebuffer through simpledrm, not from +# the MSM display driver, so DRM_MSM stays a module. Built in it pushed the +# kernel past about 16 MiB, which this ABL refuses outright: +# Booting FAILED (remote: 'Failed to load/authenticate boot image: 00000050') +# Nothing loads it; the panel path is open work (see NOTES.md). +CONFIG_DRM_MSM=m +CONFIG_DRM_SIMPLEDRM=y +CONFIG_SYSFB_SIMPLEFB=y + +# The remoteprocs Wi-Fi depends on (the modem hosts the WLAN firmware) stay +# modules. Built in they pushed the kernel past what this ABL will load: a +# kernel+dtb of 16,247,767 bytes boots and 16,376,528 does not, with only +# Booting FAILED (remote: 'Failed to load/authenticate boot image: 00000050') +# to go on. In the root filesystem udev loads them; the bring-up initramfs does +# not need the modem. +CONFIG_QCOM_RPROC_COMMON=m +CONFIG_QCOM_Q6V5_PAS=m +CONFIG_QCOM_Q6V5_MSS=m +CONFIG_QCOM_SYSMON=m +CONFIG_RPMSG_QCOM_GLINK_SMEM=m + +# Left as modules with DRM_MSM: pinning them only mattered to allow DRM_MSM=y, +# which the ABL size limit ruled out. +CONFIG_QCOM_OCMEM=m +CONFIG_QCOM_LLCC=m + +# This phone's ABL refuses a boot image whose kernel is too large, saying only +# Booting FAILED (remote: 'Failed to load/authenticate boot image: 00000050') +# Measured: kernel+dtb of 16,247,767 bytes boots, 16,343,459 does not. The +# boundary sits at 0xF80000 = 16,252,928, which tools/dipper/build-boot.py now +# refuses to cross so the failure is ours and explained, not the bootloader's +# and silent. + +# The DSI core can be a module: the panel driver that needs it is one too, and +# the display comes from simpledrm over the bootloader's framebuffer. +CONFIG_DRM_MIPI_DSI=m diff --git a/docs/DEVICES.md b/docs/DEVICES.md index d8de37503..ebdf60c5b 100644 --- a/docs/DEVICES.md +++ b/docs/DEVICES.md @@ -24,6 +24,7 @@ The status of each device, as verified on real hardware. Rows in the matrix have | Pixel 7a ([notes](../device/lynx/NOTES.md)) | lynx | gs201 (Tensor G2) | WIP ([#36](https://github.com/derekross/omarchy-mobile/issues/36): Arch root on `userdata` from slot B, SSH; the device package marks the slot successful) | WIP (UFS behind the read-only guard, in the published kernel, [kernel #91](https://github.com/derekross/linux-omarchy-mobile/pull/91); [notes](../device/lynx/NOTES.md#2026-10-24-on-screen-console-and-ufs)) | WIP (simpledrm console only, [notes](../device/lynx/NOTES.md)) | no | WIP (GT9895 touches in the session, in the published kernel, [kernel #93](https://github.com/derekross/linux-omarchy-mobile/pull/93); [notes](../device/lynx/NOTES.md#2026-10-24-touchscreen-rtc-and-slot-retries)) | no | works | no (parked at the chip's boot ROM; [plan](../device/lynx/WIFI-PLAN.md)) | WIP (same chip as Wi-Fi; scans through its own UART; the device tree is merged, [kernel #98](https://github.com/derekross/linux-omarchy-mobile/pull/98), and the package side is in review, [#98](https://github.com/derekross/omarchy-mobile/pull/98); [plan](../device/lynx/WIFI-PLAN.md)) | no | no | no | no | no | no | no | no | no | no | no | no | no | | Pixel 6 | oriole | gs101 (Tensor G1) | WIP ([unpublished kernel/packages](../device/oriole/NOTES.md#2026-10-31-build-provenance-and-recovery-limits); native test image on one phone; slot B marked successful and `vbmeta_b` verification turned off, both without project approval; see notes) | WIP ([unpublished kernel/packages](../device/oriole/NOTES.md#2026-10-31-build-provenance-and-recovery-limits); guarded `userdata` root on test image) | WIP ([unpublished kernel/packages](../device/oriole/NOTES.md#2026-10-31-build-provenance-and-recovery-limits); connected output on test image) | WIP ([unpublished kernel/packages](../device/oriole/NOTES.md#2026-10-31-build-provenance-and-recovery-limits); Panfrost render node present) | WIP ([unpublished kernel/packages](../device/oriole/NOTES.md#2026-10-31-build-provenance-and-recovery-limits); touchscreen detected; input not checked by smoke) | WIP ([unpublished kernel/packages](../device/oriole/NOTES.md#2026-10-31-build-provenance-and-recovery-limits); gpio-keys detected; input not checked by smoke) | WIP ([unpublished kernel/packages](../device/oriole/NOTES.md#2026-10-31-build-provenance-and-recovery-limits); USB network and SSH on test image) | WIP ([unpublished kernel/packages](../device/oriole/NOTES.md#2026-10-31-build-provenance-and-recovery-limits); link up; traffic not checked by smoke) | WIP ([unpublished kernel/packages](../device/oriole/NOTES.md#2026-10-31-build-provenance-and-recovery-limits); controller powered; pairing not checked) | WIP ([unpublished kernel/packages](../device/oriole/NOTES.md#2026-10-31-build-provenance-and-recovery-limits); charge and temperature reported) | WIP ([unpublished kernel/packages](../device/oriole/NOTES.md#2026-10-31-build-provenance-and-recovery-limits); charging reported; control not checked) | no | no | no | no | no | no | no | no | no | no | no | | Pixel 4 | flame | SM8150 (Snapdragon 855) | testing (temporary RAM boot; [notes](../device/flame/BRINGUP-M1.md)) | testing (RAM probe; all UFS read-only) | testing (1080x2280 console; software desktop in separate Arch payload) | testing (separate Arch payload; FD640 contexts, llvmpipe desktop) | testing (separate Arch payload; events and PIN unlock verified) | no | testing (NCM + ACM + SSH; sustained transfers can disconnect) | testing (guarded RAM scan; association untested) | no | no | no | no | no | no | - | no | no | no | no | no | no | - | +| Xiaomi Mi 8 ([notes PR #330](https://github.com/derekross/omarchy-mobile/pull/330)) | dipper | SDM845 (Snapdragon 845) | WIP (RAM-only first light; [runbook](../device/dipper/BRINGUP-M1.md); kernel PRs #218–#221) | testing (UFS read-only guard) | testing (simple-framebuffer console; EA8074 driver not yet tested) | no | WIP (FTS5 driver in review; not yet tested on this kernel) | testing (power and volume keys) | testing (USB NCM + SSH) | no | no | no | no | no | no | no | no | no | no | no | no | no | no | | Pixel 4 XL ([notes](../device/coral/NOTES.md)) | coral | SM8150 (Snapdragon 855) | WIP (direct ABL v2 boot on the test handset's slot A; slot-B install and §3.1 entry pending; [notes](../device/coral/BRINGUP-M1.md)) | testing (read-only `blockdev` guard + RAM `overlayfs`) | testing (1440x3040@60Hz S6E3HC2 DSC 1.1 KMS, DPMS, brightness) | testing (Adreno 640 / FD640 Mesa Freedreno, Hyprland) | testing (FTS SPI multitouch + read-only flash guard) | testing (power via `qcom-pon` + volume via `gpio-keys`) | testing (CDC ECM + ACM + SSH; stays up with host USB switched off) | testing (`WCN3990` `ath10k_snoc` + `rmtfs -r`, WPA2/DHCP/HTTPS; radio sessions ran before the modem baseline) | WIP (`WCN3990` `hci_qca` `hci0` up + BLE scan; audio/pairing open) | WIP (PM8150B ADC `VBAT_SNS` voltage + FG temp; aftermarket pack on test unit: no reply from `1-0036`) | testing (PM8150B SMB5 charger with `4.20 V` / `500 mA` kernel clamp) | testing (`CS40L25A` I2C click waveform) | testing (PM8150L flash LEDs + quick-settings tile) | no | - | testing (QDSP6 + dual `CS35L36` amps capped at `-26 dB` + `IA8508` SPI mic DSP) | testing (`SLPI` + `fastrpc` + RAM-backed `hexagonrpcd` + QMI SSC: 7 sensors + Soli radar) | WIP (`MPSS` boots with `rmtfs -r` + patched `tqftpserv`, SIM detected; no IPA/voice yet; radio sessions ran before the modem baseline) | no | testing (`CAMSS` + `IMX363`, `IMX481`, `IMX520`, dual `OV7251` NIR; `libcamera` softISP) | no | - | | Pixel 9a ([notes](../device/tegu/NOTES.md)) | tegu | zumapro (Tensor G4) | works ([#28](https://github.com/derekross/omarchy-mobile/issues/28): native boot from slot B, the Arch root on `userdata`, `omamobile-device-tegu`; slot B was marked successful by hand on 2026-10-28 with the `devinfo` write approved on 2026-10-22, now on hold ([#125](https://github.com/derekross/omarchy-mobile/pull/125)), unmarked by the 10-31 fastboot recovery and marked again on 2026-10-31 during the hold ([record](../device/tegu/NOTES.md#2026-10-31-a-fastboot-flash-of-slot-b-cleared-its-successful-mark-and-b-was-marked-again)), and the package does not mark it; unpublished kernel: the SoC and board device tree is [kernel #81](https://github.com/derekross/linux-omarchy-mobile/pull/81), merged; [record](../device/tegu/NOTES.md#2026-10-29-the-device-package-boot-and-what-this-row-rests-on)) | works (UFS behind the read-only guard; unpublished kernel; [record](../device/tegu/NOTES.md#2026-10-29-the-device-package-boot-and-what-this-row-rests-on)) | works (120 Hz through gs-decon; the panel driver [kernel #89](https://github.com/derekross/linux-omarchy-mobile/pull/89), 120 Hz [kernel #88](https://github.com/derekross/linux-omarchy-mobile/pull/88), merged, the display DT, merged with [kernel #96](https://github.com/derekross/linux-omarchy-mobile/pull/96); brightness, DPMS off and on and the 60/120 Hz switch on the boot of [kernel #125](https://github.com/derekross/linux-omarchy-mobile/pull/125), merged, which also checks the panel's ID; [record](../device/tegu/NOTES.md#2026-10-29-the-device-package-boot-and-what-this-row-rests-on), [brightness record](../device/tegu/NOTES.md#2026-11-01-afternoon-and-evening-wi-fi-from-the-package-the-wake-and-the-replug-storage-idle-the-panel-id)) | works (Panthor, the desktop renders, runtime suspend when idle; this boot runs at a fixed 160 MHz; the GPU's levels and its thermal zone are merged with [kernel #96](https://github.com/derekross/linux-omarchy-mobile/pull/96) ([kernel #85](https://github.com/derekross/linux-omarchy-mobile/pull/85) and [kernel #87](https://github.com/derekross/linux-omarchy-mobile/pull/87) landed through it), not yet run from it; [record](../device/tegu/NOTES.md#2026-10-29-the-device-package-boot-and-what-this-row-rests-on)) | works (Synaptics S3908 over SPI, [kernel #81](https://github.com/derekross/linux-omarchy-mobile/pull/81), merged; survives sleep, [kernel #82](https://github.com/derekross/linux-omarchy-mobile/pull/82), merged; [record](../device/tegu/NOTES.md#2026-10-29-the-device-package-boot-and-what-this-row-rests-on)) | works (gpio-keys: power and volume; the power key wakes from sleep; unpublished kernel; [record](../device/tegu/NOTES.md#2026-10-29-the-device-package-boot-and-what-this-row-rests-on)) | works (CDC NCM and SSH; reconnects after a replug, `omamobile-tegu-usb-rescue`, also after a replug the gadget didn't see ([#280](https://github.com/derekross/omarchy-mobile/pull/280); [the replug record](../device/tegu/NOTES.md#2026-10-28-what-the-device-tables-claims-rest-on)); [record](../device/tegu/NOTES.md#2026-10-29-the-device-package-boot-and-what-this-row-rests-on)) | works (BCM4383 on PCIe channel 1 through the shared gs201 host and zuma PHY, [kernel #178](https://github.com/derekross/linux-omarchy-mobile/pull/178) on [kernel #156](https://github.com/derekross/linux-omarchy-mobile/pull/156), in review, and brcmfmac, [kernel #56](https://github.com/derekross/linux-omarchy-mobile/pull/56) in review; started at boot by `omamobile-device-tegu` 0.2.4 ([#238](https://github.com/derekross/omarchy-mobile/pull/238)) with the extractor's firmware; WPA2 with iwd, kept loaded across sleep by the package's sleep hook; [record](../device/tegu/NOTES.md#2026-11-01-afternoon-and-evening-wi-fi-from-the-package-the-wake-and-the-replug-storage-idle-the-panel-id)) | works (hci_uart on the bootloader's address, BlueZ, A2DP; [kernel #94](https://github.com/derekross/linux-omarchy-mobile/pull/94); unpublished kernel; [record](../device/tegu/NOTES.md#2026-10-29-the-device-package-boot-and-what-this-row-rests-on)) | works (MAX77779 gauge with temperature, current and time estimates through UPower; [kernel #66](https://github.com/derekross/linux-omarchy-mobile/pull/66); unpublished kernel; [record](../device/tegu/NOTES.md#2026-10-29-the-device-package-boot-and-what-this-row-rests-on)) | works (the MAX77779 charger binds from the device tree, [kernel #161](https://github.com/derekross/linux-omarchy-mobile/pull/161), merged, built by [#227](https://github.com/derekross/omarchy-mobile/pull/227); the charge limit in `omamobile-device-tegu` 0.2.3 holds charging off at the limit through `charge_behaviour` and lets it run again 5 below; [record](../device/tegu/NOTES.md#2026-10-31-and-11-01-every-testing-row-on-a-published-style-kernel)) | works (CS40L26A through feedbackd, with brownout prevention, [kernel #95](https://github.com/derekross/linux-omarchy-mobile/pull/95); its DT [kernel #96](https://github.com/derekross/linux-omarchy-mobile/pull/96), merged; [record](../device/tegu/NOTES.md#2026-10-29-the-device-package-boot-and-what-this-row-rests-on)) | works (LM3644, 25 steps to 75 mA, quick-settings tile; its DT [kernel #96](https://github.com/derekross/linux-omarchy-mobile/pull/96), merged; [record](../device/tegu/NOTES.md#2026-10-29-the-device-package-boot-and-what-this-row-rests-on)) | testing (Omarchy's Location switch serves fixes from GPS, Galileo, BeiDou and GLONASS through the modem's Kepler once the modem is up; `omamobile-device-tegu`'s boot unit, opt-in ([#372](https://github.com/derekross/omarchy-mobile/pull/372)), starts gnssd with the modem: on 2026-11-03, after a reboot with nothing started by hand, a session through the switch's socket had 133 of 135 GGA sentences fixed, first fix 48 s after the client connected, 18 satellites; on 2026-11-09 the same from the in-tree drivers (the GNSS link driver, [kernel #185](https://github.com/derekross/linux-omarchy-mobile/pull/185), and the 9a's GNSS nodes, [kernel #237](https://github.com/derekross/linux-omarchy-mobile/pull/237), the `modem-cpif` overlay with the driver's config line, [#594](https://github.com/derekross/omarchy-mobile/pull/594), and the PCIe PHY's config line, [#274](https://github.com/derekross/omarchy-mobile/pull/274), all merged): four 150 s sessions, 497 of 507 GGA sentences fixed, up to 24 satellites; a 30-minute session on 2026-11-01 (omamobile-gnss 0.2.5's start, by hand, the modem link left to cycle) had 1763 of 1765, first fix 37 s, and a session in a moving car from [#114](https://github.com/derekross/omarchy-mobile/pull/114)'s package build fixed 145 of 153 times; needs [kernel #150](https://github.com/derekross/linux-omarchy-mobile/pull/150) and the PERIC0 clock fix [kernel #172](https://github.com/derekross/linux-omarchy-mobile/pull/172), both merged (without the latter the modem link hung the palmtop within minutes); not on by default because the modem isn't (the Modem cell); [plan](../device/tegu/MODEM-PLAN.md), [record](../device/tegu/TELEPHONY-PLAN.md), record with [#202](https://github.com/derekross/omarchy-mobile/pull/202)) | works (audio and sensor DSP through the GSA and Trusty, 93 services, started at boot by `omamobile-device-tegu` 0.2.3 from the device tree, [kernel #162](https://github.com/derekross/linux-omarchy-mobile/pull/162) in review; [record](../device/tegu/NOTES.md#2026-10-31-and-11-01-every-testing-row-on-a-published-style-kernel)) | works (the TAS2572 amplifiers and the microphone through the AoC card and PipeWire, at boot with the AoC: a tone from the speaker, the microphone at -32 dBFS; speakers at a -10 dB ceiling; [record](../device/tegu/NOTES.md#2026-10-31-and-11-01-every-testing-row-on-a-published-style-kernel)) | works (accelerometer, light, proximity, compass and gyroscope through the AoC and the sensor proxy, at boot with the AoC; [record](../device/tegu/NOTES.md#2026-10-31-and-11-01-every-testing-row-on-a-published-style-kernel)) | testing (calls in and out on the speakerphone, texts both ways, mobile data over the device `omamobile-sit-data` finds, with the Phone and Messages apps on the bridge ([#356](https://github.com/derekross/omarchy-mobile/pull/356), [#364](https://github.com/derekross/omarchy-mobile/pull/364), [#367](https://github.com/derekross/omarchy-mobile/pull/367), [#371](https://github.com/derekross/omarchy-mobile/pull/371)); `omamobile-device-tegu`'s boot unit starts the modem, the phone service and the bridge at boot when the owner enables it ([#372](https://github.com/derekross/omarchy-mobile/pull/372)), and is skipped on a phone that isn't provisioned or has no CP drivers; opt-in, not on by default, while marking slot B on the 9a is on hold ([#483](https://github.com/derekross/omarchy-mobile/pull/483)): with B unmarked a reset spends one of ABL's three tries, and the unit can't tell; it ran by itself on the owner's palmtop over a day of reboots on 2026-11-09 with 42 of 43 stops confirmed, one unexplained ([record](../device/tegu/TELEPHONY-PLAN.md#29-the-in-tree-drivers-through-the-starter-on-the-published-tip-plus-four-open-changes-2026-11-09)), and the NV partitions unchanged, on the owner's kernel with the bring-up modules, and on the in-tree drivers ([kernel #187](https://github.com/derekross/linux-omarchy-mobile/pull/187) and [kernel #162](https://github.com/derekross/linux-omarchy-mobile/pull/162), merged), which need the `modem-cpif` overlay and the GNSS link driver's config line ([#594](https://github.com/derekross/omarchy-mobile/pull/594)) and the PCIe PHY's config line ([#274](https://github.com/derekross/omarchy-mobile/pull/274)), all merged; the far end still hears an echo on the speakerphone ([#378](https://github.com/derekross/omarchy-mobile/pull/378)) and there's no earpiece route yet; [plan](../device/tegu/MODEM-PLAN.md), [record](../device/tegu/MODEM-PLAN.md#sim-test-results-2026-11-02-730-rc6-omamobile-tegu-s2mpg15-m1-g991042e2eff3-dirty)) | works (NXP ST54L through nxp-nci, its clock pad from the PMU ([kernel #104](https://github.com/derekross/linux-omarchy-mobile/pull/104) and [kernel #105](https://github.com/derekross/linux-omarchy-mobile/pull/105), merged, with [kernel #131](https://github.com/derekross/linux-omarchy-mobile/pull/131), merged), loaded at boot by `omamobile-device-tegu` 0.2.3 with neard and the link opener: polls with no I2C errors and read a payment card; polling stops before sleep; [record](../device/tegu/NOTES.md#2026-10-31-and-11-01-every-testing-row-on-a-published-style-kernel)) | works (main, ultrawide and front from the device tree, [kernel #164](https://github.com/derekross/linux-omarchy-mobile/pull/164) in review, with [kernel #63](https://github.com/derekross/linux-omarchy-mobile/pull/63) and [kernel #103](https://github.com/derekross/linux-omarchy-mobile/pull/103) in review: their drivers load at boot with nothing by hand, libcamera lists all three, and each streams, main at 19 fps and the others at 30 fps at 1280x960; basic picture quality through libcamera's software ISP; [record](../device/tegu/NOTES.md#2026-10-31-and-11-01-every-testing-row-on-a-published-style-kernel); the main camera's contrast autofocus through its LC898129 ([kernel #213](https://github.com/derekross/linux-omarchy-mobile/pull/213) in review, and a lens node on top of kernel #164, not yet in a pull request; libcamera 0.7.2-4.23), close subjects checked, the far end not yet ([notes](../device/tegu/NOTES.md#2026-11-07-the-main-cameras-autofocus-lc898129))) | testing (s2idle when asked for, or through the shell's auto-sleep with the `omamobile-sleep` toggle on, which ships off; the power key lights the lock screen on the first press ([#268](https://github.com/derekross/omarchy-mobile/pull/268), [#275](https://github.com/derekross/omarchy-mobile/pull/275)), and the RTC wakes it; on 2026-11-01 thirty attended 120 s sleeps ([plan](../device/tegu/SLEEP-PLAN.md) S1) and a day of real use with auto-sleep on ([record](../device/tegu/NOTES.md#2026-11-01-afternoon-and-evening-wi-fi-from-the-package-the-wake-and-the-replug-storage-idle-the-panel-id)) all woke, but six test sleeps since 10-28 did not (one in 21 on the clock-fix kernel on 11-01, and one in 127 in an overnight series of 120 s sleeps on 11-01 to 11-02), so sleep tests stay attended ([plan](../device/tegu/SLEEP-PLAN.md) S1); two causes are known: dead storage after a wake (the UFS pads came back as plain inputs on about one wake in a hundred; [kernel #224](https://github.com/derekross/linux-omarchy-mobile/pull/224), in review, re-applies the pin state at resume), and a silent no-wake with C2 entered through s2idle's own path: with C2 disabled for the sleep (#96) or left to the ordinary idle path (#98) the RTC alarm woke the palmtop 300 of 300 times each, then 15 of 15 on the everyday path, twelve of them half-hour auto-sleeps (2026-11-07 and 11-08, [#409](https://github.com/derekross/omarchy-mobile/pull/409)); [#591](https://github.com/derekross/omarchy-mobile/pull/591) is the sleep hook for it; open: on the published kernel, which has no idle states, a sleep still fails to wake now and then: one in 22 on 2026-11-09 (a boot without modules), none in two re-runs of 36, and one in 213 overnight on 2026-11-10 on the newest tip with the fixes, where the console shows the kernel alive and CPU 7 not answering from just after the device suspend ([plan](../device/tegu/SLEEP-PLAN.md) S1, failure 3); the RTC alarm on the published kernel came with [kernel #236](https://github.com/derekross/linux-omarchy-mobile/pull/236), merged 2026-11-10 (a kernel from before it has none, and a sleep there ends only on a key); works once that no-wake is found and fixed and kernel #224 is merged and has run from the published kernel; the drain is about 300 mA asleep, the same as awake with the screen off, because nothing below the CPUs sleeps yet; [record](../device/tegu/NOTES.md#2026-10-29-the-device-package-boot-and-what-this-row-rests-on)) | works (opt-in) (enrolls, matches, refuses other fingers and unlocks the lock screen through Trusty and `omamobile-fingerprint`, 2026-10-29; the sensor binds from the device tree, [kernel #165](https://github.com/derekross/linux-omarchy-mobile/pull/165) in review, with [kernel #126](https://github.com/derekross/linux-omarchy-mobile/pull/126), merged; opt-in as on the 7 Pro, because the service's first run writes Trusty's secure storage; [plan](../device/tegu/FINGERPRINT-PLAN.md), [record](../device/tegu/NOTES.md#2026-10-31-and-11-01-every-testing-row-on-a-published-style-kernel)) | | Pixel 8 Pro ([notes](../device/husky/NOTES.md)) | husky | zuma (Tensor G3) | WIP ([#1](https://github.com/derekross/omarchy-mobile/issues/1): slot B; from 2026-11-01 to 2026-11-07 a local unit marked slot B on Lef's phone; stopped pending [#252](https://github.com/derekross/omarchy-mobile/issues/252); Omarchy's image from the signed repository boots to the lock screen; the zuma device tree is merged ([kernel #13](https://github.com/derekross/linux-omarchy-mobile/pull/13), [#53](https://github.com/derekross/linux-omarchy-mobile/pull/53))) | testing (UFS at HS-G4 behind the read-only guard; Arch on `userdata`; [UFS-PLAN](../device/husky/UFS-PLAN.md)) | WIP (simple-framebuffer with the panel's size, [kernel #154](https://github.com/derekross/linux-omarchy-mobile/pull/154): console and Omarchy's lock screen; 120 Hz with brightness on a test kernel, [kernel #160](https://github.com/derekross/linux-omarchy-mobile/pull/160), started by the device package, [#228](https://github.com/derekross/omarchy-mobile/pull/228)) | testing (panthor on the Mali-G715 on a test kernel, [kernel #157](https://github.com/derekross/linux-omarchy-mobile/pull/157); [ROADMAP](../device/husky/ROADMAP.md)) | works (ST FTM5 over SPI, merged, [kernel #153](https://github.com/derekross/linux-omarchy-mobile/pull/153); verified on both phones, [notes](../device/husky/NOTES.md#2026-10-31-the-touchscreen)) | works (power and volume through `gpio-keys`, merged, [kernel #148](https://github.com/derekross/linux-omarchy-mobile/pull/148); verified on both phones, [notes](../device/husky/NOTES.md#2026-10-30-the-buttons)) | testing (USB and SSH) | testing (BCM4398 on a test kernel, [kernel #156](https://github.com/derekross/linux-omarchy-mobile/pull/156); firmware from the owner's image, [#214](https://github.com/derekross/omarchy-mobile/pull/214); [NOTES](../device/husky/NOTES.md)) | testing (BCM4398D0 on the APM UART, pairing and A2DP, on a test kernel, [kernel #199](https://github.com/derekross/linux-omarchy-mobile/pull/199); firmware from the owner's image; [ROADMAP](../device/husky/ROADMAP.md)) | testing (gauge with Google's ATL model through a bring-up overlay, temperature, MFD, pack EEPROM, [kernel #163](https://github.com/derekross/linux-omarchy-mobile/pull/163) and [#175](https://github.com/derekross/linux-omarchy-mobile/pull/175); the bus on by default waits for [kernel #205](https://github.com/derekross/linux-omarchy-mobile/pull/205); [notes](../device/husky/BATTERY-NOTES.md)) | testing (the charger driver and `tcpci_maxim` as a sink, by hand under a dead-man tool: sink at the Type-C 3 A level (input limit 0xc2 0x13 to 0x77); +1.5 A measured from a 30 W charger without the driver (1.485 A is the device-tree cap); no host mode, [#282](https://github.com/derekross/omarchy-mobile/pull/282); [notes](../device/husky/BATTERY-NOTES.md), [#1](https://github.com/derekross/omarchy-mobile/issues/1#issuecomment-6562547503)) | testing (CS40L26 on a test kernel, [kernel #200](https://github.com/derekross/linux-omarchy-mobile/pull/200)) | testing (LM3644, 50 mA cap, on a test kernel, [kernel #200](https://github.com/derekross/linux-omarchy-mobile/pull/200)) | no (first steps as drafts: [kernel #210](https://github.com/derekross/linux-omarchy-mobile/pull/210), [#211](https://github.com/derekross/linux-omarchy-mobile/pull/211)) | testing (loads and runs through the GSA and Trusty on a test kernel; plan and results [AOC-PLAN](../device/husky/AOC-PLAN.md)) | testing (stereo speakers and one microphone through UCM2 and PipeWire on a test kernel, [kernel #203](https://github.com/derekross/linux-omarchy-mobile/pull/203), [#204](https://github.com/derekross/linux-omarchy-mobile/pull/204), package [#453](https://github.com/derekross/omarchy-mobile/pull/453)) | no | no | testing (a test kernel reads tags; [kernel #208](https://github.com/derekross/linux-omarchy-mobile/pull/208), [#209](https://github.com/derekross/linux-omarchy-mobile/pull/209)) | no | no | no | diff --git a/tools/dipper/build b/tools/dipper/build new file mode 100755 index 000000000..2ac52d6a2 --- /dev/null +++ b/tools/dipper/build @@ -0,0 +1,97 @@ +#!/usr/bin/env bash +# SPDX-License-Identifier: MIT +# Build a RAM-only Dipper probe: an initramfs (in an aarch64 container), then +# an Android v1 boot image with the DTB appended to the kernel. This tool does +# not flash or push anything to a phone. +# +# Needs: the kernel already built in $KERNEL_SRC (Image.gz, the dipper DTB and +# modules), docker with arm64 emulation registered, zopfli, and SSH_PUBKEY. +set -euo pipefail + +here=$(cd "$(dirname "$0")" && pwd) +repo=$(cd "$here/../.." && pwd) + +KERNEL_DIR=${KERNEL_DIR:-$repo/../linux} +KERNEL_OUT=${KERNEL_OUT:-$KERNEL_DIR} +OUT=${OUT:-$repo/../out/dipper} +: "${SSH_PUBKEY:?set SSH_PUBKEY to your authorized public key}" +ALPINE=${ALPINE:-alpine:3.22} + +die() { echo "error: $*" >&2; exit 1; } + +[[ -d $KERNEL_DIR && -d $KERNEL_OUT ]] || die "set KERNEL_DIR and KERNEL_OUT to the kernel source and build directories" +image=$KERNEL_OUT/arch/arm64/boot/Image.gz +dtb=$KERNEL_OUT/arch/arm64/boot/dts/qcom/sdm845-xiaomi-dipper.dtb +[[ -f $image ]] || die "no $image -- build the kernel first" +[[ -f $dtb ]] || die "no $dtb -- build qcom/sdm845-xiaomi-dipper.dtb first" +[[ -r $SSH_PUBKEY ]] || die "no SSH public key at $SSH_PUBKEY (set SSH_PUBKEY)" +grep -q '^ssh-' "$SSH_PUBKEY" || die "$SSH_PUBKEY is not an OpenSSH public key" +command -v docker >/dev/null || die "docker is needed for the aarch64 initramfs" + +release=$(cat "$KERNEL_OUT/include/config/kernel.release") +echo "kernel release: $release" + +umask 077 +mkdir -p "$OUT"; chmod 700 "$OUT" +mods=$OUT/modules +echo "installing modules into $mods" +rm -rf "$mods/lib/modules/$release" +make -C "$KERNEL_DIR" ARCH=arm64 LLVM=1 O="$KERNEL_OUT" \ + INSTALL_MOD_PATH="$mods" INSTALL_MOD_STRIP=1 modules_install >/dev/null +mkdir -p "$OUT/include/config" +cp "$KERNEL_OUT/include/config/kernel.release" "$OUT/include/config/kernel.release" +tar -C "$mods/lib/modules" --owner=0 --group=0 --numeric-owner -cf - "$release" \ + | zstd -q -19 -T0 -f -o "$OUT/modules-$release.tar.zst" + +echo "building the initramfs in $ALPINE (linux/arm64)" +docker run --rm --platform linux/arm64 \ + -v "$repo:/src:ro" -v "$mods:/modules:ro" -v "$SSH_PUBKEY:/input/key.pub:ro" \ + -v "$OUT:/out" \ + -e "KERNEL_RELEASE=$release" -e "OUT_UID=$(id -u)" -e "OUT_GID=$(id -g)" \ + "$ALPINE" sh /src/tools/dipper/initramfs-inside.sh + +# Pack a copy of the DTB so nothing we do can dirty the kernel tree. +packdtb=$OUT/sdm845-xiaomi-dipper.dtb +cp "$dtb" "$packdtb" +kernel_image=$image +if command -v zopfli >/dev/null; then + echo "compressing the kernel with zopfli for dipper's ABL size limit" + zopfli -c --i1 "$KERNEL_OUT/arch/arm64/boot/Image" > "$OUT/Image.gz" + kernel_image=$OUT/Image.gz +fi +# A failed size check must not leave an older boot.img under the current name. +rm -f "$OUT/images/boot.img" "$OUT/images/BOOT-MANIFEST.json" +"$here/build-boot.py" --kernel "$kernel_image" --dtb "$packdtb" \ + --ramdisk "$OUT/initramfs.cpio.gz" --out "$OUT/images" + +# Firmware and the Wi-Fi fix-ups are not part of the boot image; they go into the +# root filesystem. Collect them beside it so one directory holds everything. +if [[ -n ${FIRMWARE_DIR:-} ]]; then + fw=$FIRMWARE_DIR + [[ -d $fw ]] || die "FIRMWARE_DIR does not exist: $fw" + mkdir -p "$OUT/firmware" + # The blobs come off the phone mode 400, so a plain cp cannot overwrite them + # on a rebuild. Copy without preserving the mode and make them readable. + for d in qcom ath10k; do + [[ -d $fw/$d ]] || continue + rm -rf "$OUT/firmware/$d" + cp -r --no-preserve=mode "$fw/$d" "$OUT/firmware/" + done + chmod -R u+rwX "$OUT/firmware" + echo "firmware staged in $OUT/firmware" +else + echo "note: FIRMWARE_DIR is unset; firmware-dependent Wi-Fi will not come up" +fi + +echo +echo "artefacts in $OUT/images:" +ls -l "$OUT/images" +cat <<'NOTE' + +To try it without writing to the phone (nothing persists): + + fastboot boot boot.img + +Do not flash this image. Dipper has no second OS slot and this RAM-only path +has no persistent update or recovery flow. +NOTE diff --git a/tools/dipper/build-boot.py b/tools/dipper/build-boot.py new file mode 100755 index 000000000..d1210b2e8 --- /dev/null +++ b/tools/dipper/build-boot.py @@ -0,0 +1,153 @@ +#!/usr/bin/env python3 +# SPDX-License-Identifier: MIT +"""Pack dipper's kernel + appended DTB and the initramfs into an Android v1 boot image. + +Every offset here was read off the phone's own stock boot image (header v1, +page 4096, kernel 0x8000, ramdisk 0x1000000, tags 0x100, base 0), so the image +we hand ABL has the same geometry as the one it already boots. The DTB is +appended to the kernel because dipper's stock image carries its FDTs that way +(two concatenated FDTs at the end of the kernel blob, selected by msm-id). + +No mkbootimg dependency: the v1 header is 1648 bytes of fixed layout and we +verify what we wrote before returning. +""" +import argparse, hashlib, json, struct, sys +from pathlib import Path + +PAGE = 4096 +BASE = 0x00000000 +KERNEL_OFF = 0x00008000 +# Stock's own value, and the only one seen to boot on this phone. It leaves +# 16 MiB - 32 KiB for the kernel; check_layout() refuses anything larger rather +# than letting ABL answer with +# Failed to load/authenticate boot image: 00000050 +# which it does with no kernel output and no clue. +RAMDISK_OFF = 0x01000000 +SECOND_OFF = 0x00f00000 +TAGS_OFF = 0x00000100 +HDR_VERSION = 1 +HDR_SIZE = 1648 +# From the phone: console on the framebuffer, early console on the SoC's UART +# (stock passes earlycon=msm_geni_serial,0xA84000), then the shared init. +CMDLINE = ("console=tty0 earlycon=msm_geni_serial,0xa84000 rdinit=/init " + "panic=10 printk.devkmsg=on rootwait") +# dipper's boot partition, measured: 65536 blocks of 1 KiB. +BOOT_PARTITION_BYTES = 64 * 1024 * 1024 +# This ABL refuses a larger kernel with only +# Booting FAILED (remote: 'Failed to load/authenticate boot image: 00000050') +# Measured on the phone: 16,247,767 bytes boots, 16,343,459 does not. +KERNEL_MAX = 0xF80000 + + +def pad(b: bytes) -> bytes: + r = len(b) % PAGE + return b + (b"\0" * (PAGE - r) if r else b"") + + +def check_layout(kernel: bytes, ramdisk: bytes) -> None: + """The kernel must end before the ramdisk begins, or ABL rejects the image.""" + if len(kernel) > KERNEL_MAX: + raise SystemExit( + f"kernel+dtb is {len(kernel)} bytes; this phone's ABL refuses more " + f"than {KERNEL_MAX} ({KERNEL_MAX / 1048576:.2f} MiB) and says only " + "'Failed to load/authenticate boot image: 00000050'. Move drivers " + "to modules.") + room = RAMDISK_OFF - KERNEL_OFF + if len(kernel) > room: + raise SystemExit( + f"kernel+dtb is {len(kernel)} bytes but only {room} fit between " + f"kernel_offset {KERNEL_OFF:#x} and ramdisk_offset {RAMDISK_OFF:#x}; " + "raise RAMDISK_OFF or shrink the kernel") + end = RAMDISK_OFF + len(ramdisk) + if end > BOOT_PARTITION_BYTES * 4: + raise SystemExit(f"the loaded image would reach {end:#x}, which is implausible") + + +def build_header(kernel: bytes, ramdisk: bytes, cmdline: str) -> bytes: + cmd = cmdline.encode() + if len(cmd) > 511: + raise SystemExit(f"cmdline is {len(cmd)} bytes; the v1 header holds 512 with its NUL") + h = bytearray(PAGE) + h[0:8] = b"ANDROID!" + struct.pack_into("<10I", h, 8, + len(kernel), BASE + KERNEL_OFF, + len(ramdisk), BASE + RAMDISK_OFF, + 0, BASE + SECOND_OFF, # no second stage: the DTB is appended + BASE + TAGS_OFF, PAGE, HDR_VERSION, 0) + h[48:64] = b"\0" * 16 # product name: stock leaves it empty too + h[64:64 + len(cmd)] = cmd + # id[32] at 576 and extra_cmdline[1024] at 608 stay zero. + struct.pack_into(" None: + """Re-read what we wrote: a wrong header silently bricks a boot attempt.""" + if img[:8] != b"ANDROID!": + raise SystemExit("bad magic in the image we just built") + ks, ka, rs, ra, ss, sa, tags, ps, hv, _ = struct.unpack_from("<10I", img, 8) + if (ks, rs, ss) != (len(kernel), len(ramdisk), 0): + raise SystemExit(f"sizes disagree: {(ks, rs, ss)}") + if (ka, ra, tags, ps, hv) != (BASE + KERNEL_OFF, BASE + RAMDISK_OFF, BASE + TAGS_OFF, PAGE, HDR_VERSION): + raise SystemExit(f"geometry disagrees with the stock image: {(ka, ra, tags, ps, hv)}") + if struct.unpack_from(" int: + ap = argparse.ArgumentParser() + ap.add_argument("--kernel", type=Path, required=True, help="Image.gz") + ap.add_argument("--dtb", type=Path, required=True, help="sdm845-xiaomi-dipper.dtb") + ap.add_argument("--ramdisk", type=Path, required=True, help="initramfs.cpio.gz") + ap.add_argument("--out", type=Path, required=True, help="output directory") + ap.add_argument("--cmdline", default=CMDLINE) + a = ap.parse_args() + + a.out.mkdir(parents=True, exist_ok=True) + kernel = a.kernel.read_bytes() + a.dtb.read_bytes() # Image.gz-dtb + ramdisk = a.ramdisk.read_bytes() + (a.out / "Image.gz-dtb").write_bytes(kernel) + + check_layout(kernel, ramdisk) + img = build_header(kernel, ramdisk, a.cmdline) + pad(kernel) + pad(ramdisk) + verify(img, kernel, ramdisk, a.cmdline) + if len(img) > BOOT_PARTITION_BYTES: + raise SystemExit(f"image is {len(img)} bytes; dipper's boot partition holds " + f"{BOOT_PARTITION_BYTES}") + + out = a.out / "boot.img" + out.write_bytes(img) + manifest = { + "device": "dipper", + "header_version": HDR_VERSION, + "pagesize": PAGE, + "cmdline": a.cmdline, + "kernel_bytes": len(kernel), + "dtb_bytes": a.dtb.stat().st_size, + "ramdisk_bytes": len(ramdisk), + "boot_bytes": len(img), + "boot_partition_bytes": BOOT_PARTITION_BYTES, + "headroom_bytes": BOOT_PARTITION_BYTES - len(img), + "kernel_sha256": hashlib.sha256(kernel).hexdigest(), + "ramdisk_sha256": hashlib.sha256(ramdisk).hexdigest(), + "boot_sha256": hashlib.sha256(img).hexdigest(), + "hardware_boot_tested": False, + } + (a.out / "BOOT-MANIFEST.json").write_text(json.dumps(manifest, indent=2) + "\n") + print(f"packed {out} ({len(img)} bytes, {manifest['headroom_bytes']} spare in the partition)") + return 0 + + +if __name__ == "__main__": + sys.exit(main()) diff --git a/tools/dipper/initramfs-inside.sh b/tools/dipper/initramfs-inside.sh new file mode 100755 index 000000000..81b5ec498 --- /dev/null +++ b/tools/dipper/initramfs-inside.sh @@ -0,0 +1,129 @@ +#!/bin/sh +# SPDX-License-Identifier: MIT +# Runs inside an aarch64 Alpine container. Only files under /out change. +# Adapted from tools/alioth/build-initramfs.sh: same class of device (non-A/B +# Qualcomm, appended DTB), different panel, watchdog name and descriptor values. +set -eu + +: "${KERNEL_RELEASE:?KERNEL_RELEASE must be passed in}" + +apk add --no-cache cpio gcc musl-dev gzip kmod python3 dropbear + +stage=/tmp/dipper-initramfs +mkdir -p "$stage" +apk --root "$stage" --initdb --no-cache \ + --repositories-file /etc/apk/repositories --keys-dir /etc/apk/keys add \ + alpine-baselayout busybox busybox-extras dropbear iproute2 util-linux \ + e2fsprogs e2fsprogs-extra kmod + +mkdir -p "$stage/proc" "$stage/sys" "$stage/dev" "$stage/run" "$stage/root/.ssh" \ + "$stage/usr/lib/modules" "$stage/usr/lib/firmware" "$stage/etc/dropbear" "$stage/usr/local/bin" +# Alpine is not usr-merged; kmod and the kernel look below /lib. +ln -s ../usr/lib/modules "$stage/lib/modules" +ln -s ../usr/lib/firmware "$stage/lib/firmware" + +cp /input/key.pub "$stage/root/.ssh/authorized_keys" +chmod 700 "$stage/root/.ssh" +chmod 600 "$stage/root/.ssh/authorized_keys" + +# Keep the rescue server's host key stable across rebuilds, so the laptop's +# known_hosts does not change under us. Private key stays in local output. +hostkey=/out/dropbear_ed25519_host_key +if [ ! -s "$hostkey" ]; then + umask 077 + dropbearkey -t ed25519 -f "$hostkey" >/dev/null 2>&1 +fi +cp "$hostkey" "$stage/etc/dropbear/dropbear_ed25519_host_key" +chmod 600 "$stage/etc/dropbear/dropbear_ed25519_host_key" +chown "${OUT_UID:-0}:${OUT_GID:-0}" "$hostkey" + +cp -a "/modules/lib/modules/$KERNEL_RELEASE" "$stage/usr/lib/modules/" +# The build tree symlinks point at the builder's paths; they are useless here. +rm -f "$stage/usr/lib/modules/$KERNEL_RELEASE/build" \ + "$stage/usr/lib/modules/$KERNEL_RELEASE/source" +depmod -b "$stage" "$KERNEL_RELEASE" + +# Keep only the modules this initramfs actually loads, with their dependencies. +# The full tree is ~1764 modules and dominates the image: with the PHYs, UFS, +# i2c and simpledrm built in, almost none of it is reachable here, and ABL +# refuses a boot image that grows too large. Everything else belongs in the +# root filesystem, not here. The pruner reads modules.dep and fails loudly +# rather than silently emptying the tree. +python3 /src/tools/dipper/prune-modules.py \ + "$stage/usr/lib/modules/$KERNEL_RELEASE" qcom_wdt panel-samsung-ea8074 +depmod -b "$stage" "$KERNEL_RELEASE" + +# The modules the init loads must exist AND match this kernel exactly, or the +# phone boots to a black screen with no watchdog taken over. +for module in qcom_wdt panel-samsung-ea8074; do + path=$(modinfo -b "$stage" -k "$KERNEL_RELEASE" -n "$module") + [ "$(modinfo -F vermagic "$path" | cut -d ' ' -f1)" = "$KERNEL_RELEASE" ] || { + echo "module $module does not match $KERNEL_RELEASE" >&2; exit 1; } +done + +cp /src/initramfs/init "$stage/init" +python3 - "$stage/init" <<'PY' +from pathlib import Path +import sys +p = Path(sys.argv[1]); s = p.read_text() + +# SDM845 leaves the cluster watchdogs running; take them over early. +needle = 'hostname omamobile\n' +assert s.count(needle) == 1, "shared init changed: hostname anchor" +s = s.replace(needle, '''# SDM845's watchdogs keep running until a driver claims them. +modprobe qcom_wdt || echo "omamobile: qcom watchdog module failed" >/dev/kmsg +if [ -c /dev/watchdog0 ]; then + watchdog -t 5 -T 30 /dev/watchdog0 +fi +modprobe panel-samsung-ea8074 || echo "omamobile: panel module failed" >/dev/kmsg +hostname omamobile +''') + +# Bind the rescue sshd to the USB interface address only, never to Wi-Fi. +needle = 'dropbear -R -E -p 22' +assert s.count(needle) == 1, "shared init changed: dropbear anchor" +s = s.replace(needle, '''usb_addr=$(ip -o -4 addr show dev usb0 scope global | awk '{ sub(/\\/.*/, "", $4); print $4; exit }') +if [ -n "$usb_addr" ]; then + dropbear -R -E -s -p "$usb_addr:22" +fi''') +p.write_text(s) +PY +chmod 755 "$stage/init" + +echo xiaomi,dipper > "$stage/etc/omamobile-compatible" +: > "$stage/etc/omamobile-ufs-rw" + +# ABL has no alternate OS slot on Dipper. Keep the shared init's timeout, but +# describe the RAM-only recovery path accurately in its on-screen message. +python3 - "$stage/init" <<'PY' +from pathlib import Path +import sys +p = Path(sys.argv[1]); s = p.read_text() +old = 'no USB host, crashing in 20 s so ABL falls back to slot A' +new = 'no USB host; RAM-only probe will reboot in 20 s' +assert s.count(old) == 1, "shared init changed: no-USB recovery message" +p.write_text(s.replace(old, new)) +PY +echo 'Xiaomi Mi 8 Omarchy' > "$stage/etc/omamobile-usb-product" + +gcc -Os -static -o "$stage/usr/local/bin/reboot-to" \ + /src/packages/omamobile-device-cheetah/src/reboot-to.c + +# Prove the packaged userspace actually runs on ARM before shipping it. +chroot "$stage" /bin/busybox true +chroot "$stage" /usr/sbin/dropbear -h >/tmp/dropbear-help 2>&1 || [ "$?" = 1 ] +grep -q 'Dropbear' /tmp/dropbear-help + +# Reproducible archive: fixed mtimes, sorted, no owners. +python3 - "$stage" <<'PY' +import os, sys +from pathlib import Path +root = Path(sys.argv[1]) +for path in list(root.rglob('*')) + [root]: + os.utime(path, (1790636353, 1790636353), follow_symlinks=False) +PY +(cd "$stage" && find . -print0 | sort -z | cpio --null --quiet -o -H newc --owner=0:0 --reproducible) \ + | gzip -n -9 > /out/initramfs.cpio.gz +cp /tmp/dropbear-help /out/dropbear-help.txt +chown "${OUT_UID:-0}:${OUT_GID:-0}" /out/initramfs.cpio.gz /out/dropbear-help.txt +echo "dipper initramfs built for $KERNEL_RELEASE; all UFS partitions stay read-only" diff --git a/tools/dipper/prune-modules.py b/tools/dipper/prune-modules.py new file mode 100755 index 000000000..cc737b13f --- /dev/null +++ b/tools/dipper/prune-modules.py @@ -0,0 +1,72 @@ +#!/usr/bin/env python3 +# SPDX-License-Identifier: MIT +"""Keep only the named modules and their dependencies in a staged module tree. + +Reads modules.dep directly rather than asking modprobe: its -d/-b/-S flags are +easy to get wrong (-b is --use-blacklist, not a base directory), and a silent +mis-resolution deletes the whole tree. + + prune-modules.py [name ...] +""" +import sys +from pathlib import Path + + +def basename(path: str) -> str: + n = Path(path).name + for suffix in (".ko.zst", ".ko.xz", ".ko.gz", ".ko"): + if n.endswith(suffix): + return n[: -len(suffix)] + return n + + +def main() -> int: + moddir = Path(sys.argv[1]) + wanted = {n.replace("-", "_") for n in sys.argv[2:]} + dep = moddir / "modules.dep" + if not dep.is_file(): + raise SystemExit(f"no {dep}") + + deps, by_name = {}, {} + for line in dep.read_text().splitlines(): + if ":" not in line: + continue + target, rest = line.split(":", 1) + target = target.strip() + deps[target] = rest.split() + by_name[basename(target).replace("-", "_")] = target + + missing = wanted - set(by_name) + if missing: + raise SystemExit(f"not in modules.dep: {', '.join(sorted(missing))}") + + keep, queue = set(), [by_name[n] for n in wanted] + while queue: + cur = queue.pop() + if cur in keep: + continue + keep.add(cur) + queue.extend(deps.get(cur, [])) + + kept_paths = {(moddir / k).resolve() for k in keep} + before = removed = 0 + for f in moddir.rglob("*"): + if not f.is_file() or ".ko" not in f.name: + continue + before += 1 + if f.resolve() not in kept_paths: + f.unlink() + removed += 1 + for d in sorted(moddir.rglob("*"), key=lambda p: -len(p.parts)): + if d.is_dir() and not any(d.iterdir()): + d.rmdir() + + print(f"kept {len(keep)} of {before} modules: " + f"{', '.join(sorted(basename(k) for k in keep))}") + if len(keep) < len(wanted): + raise SystemExit("fewer modules kept than asked for") + return 0 + + +if __name__ == "__main__": + sys.exit(main()) From e6c1dc259be47a7590dc5f606104f5992f6b8715 Mon Sep 17 00:00:00 2001 From: quatrixone Date: Sun, 8 Nov 2026 09:11:17 +0100 Subject: [PATCH 02/22] device/dipper: tighten RAM-only probe runbook --- device/dipper/BRINGUP-M1.md | 47 ++++++++++++++++++++++---------- docs/DEVICES.md | 2 +- tests/dipper-probe | 41 ++++++++++++++++++++++++++++ tools/dipper/build | 34 ++++------------------- tools/dipper/initramfs-inside.sh | 2 -- 5 files changed, 80 insertions(+), 46 deletions(-) create mode 100644 tests/dipper-probe diff --git a/device/dipper/BRINGUP-M1.md b/device/dipper/BRINGUP-M1.md index 30bd6d277..bd716d967 100644 --- a/device/dipper/BRINGUP-M1.md +++ b/device/dipper/BRINGUP-M1.md @@ -13,18 +13,34 @@ There is no supported flash, push, installer or persistent update path here. ## Recovery and safe boot -- Enter fastboot with **Volume Down + Power**. The device's §3.1 recovery entry - is in [PR #499](https://github.com/derekross/omarchy-mobile/pull/499). -- Check the bootloader's unlocked state with `fastboot getvar unlocked`. -- Boot the generated image with `fastboot boot boot.img`. Do not use - `fastboot flash`, `bin/omamobile flash`, `bin/omamobile push`, or the installer. -- Because the image is loaded into RAM and does not write UFS, a power cycle - returns to the boot image already installed on the phone. Keep the phone and - a USB cable present during every probe. -- If the USB host never configures, the shared initramfs waits, shows its log, - then panics after 20 seconds. On this RAM-only path that does not alter the - installed `boot`; use the buttons to return to fastboot if the phone does not - resume stock Android by itself. +Each gate below must pass before proceeding. Set `FASTBOOT_SERIAL` to the +intended handset's serial and `BACKUP_CHECKSUMS` to the locally held stock +backup checksum manifest. Do not boot if the manifest is missing or fails. + +1. **Backup gate** — Expect: the verified stock backup and checksum manifest + are available off-device. Pass: `sha256sum -c "$BACKUP_CHECKSUMS"` reports + every entry OK. Stop: any missing or mismatched entry. Rollback: restore the + verified stock backup using the device recovery procedure. Risk: an + unverified backup cannot recover a damaged single-slot phone. +2. **Fastboot gate** — Enter fastboot with **Volume Down + Power**; the §3.1 + entry is in [PR #499](https://github.com/derekross/omarchy-mobile/pull/499). + Run `fastboot -s "$FASTBOOT_SERIAL" getvar unlocked`. Expect `yes`. Pass: + the serial identifies the intended phone and the bootloader is unlocked. + Stop: absent/ambiguous serial or locked bootloader. Rollback: leave fastboot + without writing. Risk: this device has no alternate OS slot. +3. **RAM boot gate** — Run + `fastboot -s "$FASTBOOT_SERIAL" boot boot.img`. Expect: the image starts + without changing UFS. Pass: the phone reaches the rescue environment and + USB/SSH checks succeed. Stop: unexpected output, USB failure, or any request + to flash. Rollback: power-cycle to the installed boot image; if recovery is + needed, use the verified backup. Risk: a USB host that never configures still + reaches the shared 20-second watcher panic; this RAM probe does not change + the installed boot image. The exact forced-restart hold duration is not + recorded here; do not guess it. + +The current recorded first light used the stock `dtbo` untouched. The image is +RAM-only; never use `fastboot flash`, `bin/omamobile flash`, `bin/omamobile +push`, or the installer. Keep the phone and USB cable present during a probe. ## Build and probe @@ -48,9 +64,10 @@ repository; the SSH public key and generated host key stay in the local output. - Do not flash until there is a reviewed, device-specific recovery plan and a verified stock backup. This PR deliberately adds no persistent writer. -- The initramfs has no Arch root yet. A later NFS-root path must remain in the - rescue shell when the host or export is unavailable; it must not fall through - to the phone's writable userdata. +- The initramfs has no Arch root yet. A later hard NFS-root mount can freeze the + root session if the host drops; use it only for a RAM-only probe. NFS-root + needs `RuntimeWatchdogSec=60s`, because `kill -9 -1` kills the userspace + watchdog feeder. It must never fall through to writable userdata. - Wi-Fi needs firmware and the phone's own WLAN address. Read identity files from `persist` with `debugfs` (read-only) before enabling that service; never mount `persist`. diff --git a/docs/DEVICES.md b/docs/DEVICES.md index ebdf60c5b..921c17dbe 100644 --- a/docs/DEVICES.md +++ b/docs/DEVICES.md @@ -24,7 +24,6 @@ The status of each device, as verified on real hardware. Rows in the matrix have | Pixel 7a ([notes](../device/lynx/NOTES.md)) | lynx | gs201 (Tensor G2) | WIP ([#36](https://github.com/derekross/omarchy-mobile/issues/36): Arch root on `userdata` from slot B, SSH; the device package marks the slot successful) | WIP (UFS behind the read-only guard, in the published kernel, [kernel #91](https://github.com/derekross/linux-omarchy-mobile/pull/91); [notes](../device/lynx/NOTES.md#2026-10-24-on-screen-console-and-ufs)) | WIP (simpledrm console only, [notes](../device/lynx/NOTES.md)) | no | WIP (GT9895 touches in the session, in the published kernel, [kernel #93](https://github.com/derekross/linux-omarchy-mobile/pull/93); [notes](../device/lynx/NOTES.md#2026-10-24-touchscreen-rtc-and-slot-retries)) | no | works | no (parked at the chip's boot ROM; [plan](../device/lynx/WIFI-PLAN.md)) | WIP (same chip as Wi-Fi; scans through its own UART; the device tree is merged, [kernel #98](https://github.com/derekross/linux-omarchy-mobile/pull/98), and the package side is in review, [#98](https://github.com/derekross/omarchy-mobile/pull/98); [plan](../device/lynx/WIFI-PLAN.md)) | no | no | no | no | no | no | no | no | no | no | no | no | no | | Pixel 6 | oriole | gs101 (Tensor G1) | WIP ([unpublished kernel/packages](../device/oriole/NOTES.md#2026-10-31-build-provenance-and-recovery-limits); native test image on one phone; slot B marked successful and `vbmeta_b` verification turned off, both without project approval; see notes) | WIP ([unpublished kernel/packages](../device/oriole/NOTES.md#2026-10-31-build-provenance-and-recovery-limits); guarded `userdata` root on test image) | WIP ([unpublished kernel/packages](../device/oriole/NOTES.md#2026-10-31-build-provenance-and-recovery-limits); connected output on test image) | WIP ([unpublished kernel/packages](../device/oriole/NOTES.md#2026-10-31-build-provenance-and-recovery-limits); Panfrost render node present) | WIP ([unpublished kernel/packages](../device/oriole/NOTES.md#2026-10-31-build-provenance-and-recovery-limits); touchscreen detected; input not checked by smoke) | WIP ([unpublished kernel/packages](../device/oriole/NOTES.md#2026-10-31-build-provenance-and-recovery-limits); gpio-keys detected; input not checked by smoke) | WIP ([unpublished kernel/packages](../device/oriole/NOTES.md#2026-10-31-build-provenance-and-recovery-limits); USB network and SSH on test image) | WIP ([unpublished kernel/packages](../device/oriole/NOTES.md#2026-10-31-build-provenance-and-recovery-limits); link up; traffic not checked by smoke) | WIP ([unpublished kernel/packages](../device/oriole/NOTES.md#2026-10-31-build-provenance-and-recovery-limits); controller powered; pairing not checked) | WIP ([unpublished kernel/packages](../device/oriole/NOTES.md#2026-10-31-build-provenance-and-recovery-limits); charge and temperature reported) | WIP ([unpublished kernel/packages](../device/oriole/NOTES.md#2026-10-31-build-provenance-and-recovery-limits); charging reported; control not checked) | no | no | no | no | no | no | no | no | no | no | no | | Pixel 4 | flame | SM8150 (Snapdragon 855) | testing (temporary RAM boot; [notes](../device/flame/BRINGUP-M1.md)) | testing (RAM probe; all UFS read-only) | testing (1080x2280 console; software desktop in separate Arch payload) | testing (separate Arch payload; FD640 contexts, llvmpipe desktop) | testing (separate Arch payload; events and PIN unlock verified) | no | testing (NCM + ACM + SSH; sustained transfers can disconnect) | testing (guarded RAM scan; association untested) | no | no | no | no | no | no | - | no | no | no | no | no | no | - | -| Xiaomi Mi 8 ([notes PR #330](https://github.com/derekross/omarchy-mobile/pull/330)) | dipper | SDM845 (Snapdragon 845) | WIP (RAM-only first light; [runbook](../device/dipper/BRINGUP-M1.md); kernel PRs #218–#221) | testing (UFS read-only guard) | testing (simple-framebuffer console; EA8074 driver not yet tested) | no | WIP (FTS5 driver in review; not yet tested on this kernel) | testing (power and volume keys) | testing (USB NCM + SSH) | no | no | no | no | no | no | no | no | no | no | no | no | no | no | | Pixel 4 XL ([notes](../device/coral/NOTES.md)) | coral | SM8150 (Snapdragon 855) | WIP (direct ABL v2 boot on the test handset's slot A; slot-B install and §3.1 entry pending; [notes](../device/coral/BRINGUP-M1.md)) | testing (read-only `blockdev` guard + RAM `overlayfs`) | testing (1440x3040@60Hz S6E3HC2 DSC 1.1 KMS, DPMS, brightness) | testing (Adreno 640 / FD640 Mesa Freedreno, Hyprland) | testing (FTS SPI multitouch + read-only flash guard) | testing (power via `qcom-pon` + volume via `gpio-keys`) | testing (CDC ECM + ACM + SSH; stays up with host USB switched off) | testing (`WCN3990` `ath10k_snoc` + `rmtfs -r`, WPA2/DHCP/HTTPS; radio sessions ran before the modem baseline) | WIP (`WCN3990` `hci_qca` `hci0` up + BLE scan; audio/pairing open) | WIP (PM8150B ADC `VBAT_SNS` voltage + FG temp; aftermarket pack on test unit: no reply from `1-0036`) | testing (PM8150B SMB5 charger with `4.20 V` / `500 mA` kernel clamp) | testing (`CS40L25A` I2C click waveform) | testing (PM8150L flash LEDs + quick-settings tile) | no | - | testing (QDSP6 + dual `CS35L36` amps capped at `-26 dB` + `IA8508` SPI mic DSP) | testing (`SLPI` + `fastrpc` + RAM-backed `hexagonrpcd` + QMI SSC: 7 sensors + Soli radar) | WIP (`MPSS` boots with `rmtfs -r` + patched `tqftpserv`, SIM detected; no IPA/voice yet; radio sessions ran before the modem baseline) | no | testing (`CAMSS` + `IMX363`, `IMX481`, `IMX520`, dual `OV7251` NIR; `libcamera` softISP) | no | - | | Pixel 9a ([notes](../device/tegu/NOTES.md)) | tegu | zumapro (Tensor G4) | works ([#28](https://github.com/derekross/omarchy-mobile/issues/28): native boot from slot B, the Arch root on `userdata`, `omamobile-device-tegu`; slot B was marked successful by hand on 2026-10-28 with the `devinfo` write approved on 2026-10-22, now on hold ([#125](https://github.com/derekross/omarchy-mobile/pull/125)), unmarked by the 10-31 fastboot recovery and marked again on 2026-10-31 during the hold ([record](../device/tegu/NOTES.md#2026-10-31-a-fastboot-flash-of-slot-b-cleared-its-successful-mark-and-b-was-marked-again)), and the package does not mark it; unpublished kernel: the SoC and board device tree is [kernel #81](https://github.com/derekross/linux-omarchy-mobile/pull/81), merged; [record](../device/tegu/NOTES.md#2026-10-29-the-device-package-boot-and-what-this-row-rests-on)) | works (UFS behind the read-only guard; unpublished kernel; [record](../device/tegu/NOTES.md#2026-10-29-the-device-package-boot-and-what-this-row-rests-on)) | works (120 Hz through gs-decon; the panel driver [kernel #89](https://github.com/derekross/linux-omarchy-mobile/pull/89), 120 Hz [kernel #88](https://github.com/derekross/linux-omarchy-mobile/pull/88), merged, the display DT, merged with [kernel #96](https://github.com/derekross/linux-omarchy-mobile/pull/96); brightness, DPMS off and on and the 60/120 Hz switch on the boot of [kernel #125](https://github.com/derekross/linux-omarchy-mobile/pull/125), merged, which also checks the panel's ID; [record](../device/tegu/NOTES.md#2026-10-29-the-device-package-boot-and-what-this-row-rests-on), [brightness record](../device/tegu/NOTES.md#2026-11-01-afternoon-and-evening-wi-fi-from-the-package-the-wake-and-the-replug-storage-idle-the-panel-id)) | works (Panthor, the desktop renders, runtime suspend when idle; this boot runs at a fixed 160 MHz; the GPU's levels and its thermal zone are merged with [kernel #96](https://github.com/derekross/linux-omarchy-mobile/pull/96) ([kernel #85](https://github.com/derekross/linux-omarchy-mobile/pull/85) and [kernel #87](https://github.com/derekross/linux-omarchy-mobile/pull/87) landed through it), not yet run from it; [record](../device/tegu/NOTES.md#2026-10-29-the-device-package-boot-and-what-this-row-rests-on)) | works (Synaptics S3908 over SPI, [kernel #81](https://github.com/derekross/linux-omarchy-mobile/pull/81), merged; survives sleep, [kernel #82](https://github.com/derekross/linux-omarchy-mobile/pull/82), merged; [record](../device/tegu/NOTES.md#2026-10-29-the-device-package-boot-and-what-this-row-rests-on)) | works (gpio-keys: power and volume; the power key wakes from sleep; unpublished kernel; [record](../device/tegu/NOTES.md#2026-10-29-the-device-package-boot-and-what-this-row-rests-on)) | works (CDC NCM and SSH; reconnects after a replug, `omamobile-tegu-usb-rescue`, also after a replug the gadget didn't see ([#280](https://github.com/derekross/omarchy-mobile/pull/280); [the replug record](../device/tegu/NOTES.md#2026-10-28-what-the-device-tables-claims-rest-on)); [record](../device/tegu/NOTES.md#2026-10-29-the-device-package-boot-and-what-this-row-rests-on)) | works (BCM4383 on PCIe channel 1 through the shared gs201 host and zuma PHY, [kernel #178](https://github.com/derekross/linux-omarchy-mobile/pull/178) on [kernel #156](https://github.com/derekross/linux-omarchy-mobile/pull/156), in review, and brcmfmac, [kernel #56](https://github.com/derekross/linux-omarchy-mobile/pull/56) in review; started at boot by `omamobile-device-tegu` 0.2.4 ([#238](https://github.com/derekross/omarchy-mobile/pull/238)) with the extractor's firmware; WPA2 with iwd, kept loaded across sleep by the package's sleep hook; [record](../device/tegu/NOTES.md#2026-11-01-afternoon-and-evening-wi-fi-from-the-package-the-wake-and-the-replug-storage-idle-the-panel-id)) | works (hci_uart on the bootloader's address, BlueZ, A2DP; [kernel #94](https://github.com/derekross/linux-omarchy-mobile/pull/94); unpublished kernel; [record](../device/tegu/NOTES.md#2026-10-29-the-device-package-boot-and-what-this-row-rests-on)) | works (MAX77779 gauge with temperature, current and time estimates through UPower; [kernel #66](https://github.com/derekross/linux-omarchy-mobile/pull/66); unpublished kernel; [record](../device/tegu/NOTES.md#2026-10-29-the-device-package-boot-and-what-this-row-rests-on)) | works (the MAX77779 charger binds from the device tree, [kernel #161](https://github.com/derekross/linux-omarchy-mobile/pull/161), merged, built by [#227](https://github.com/derekross/omarchy-mobile/pull/227); the charge limit in `omamobile-device-tegu` 0.2.3 holds charging off at the limit through `charge_behaviour` and lets it run again 5 below; [record](../device/tegu/NOTES.md#2026-10-31-and-11-01-every-testing-row-on-a-published-style-kernel)) | works (CS40L26A through feedbackd, with brownout prevention, [kernel #95](https://github.com/derekross/linux-omarchy-mobile/pull/95); its DT [kernel #96](https://github.com/derekross/linux-omarchy-mobile/pull/96), merged; [record](../device/tegu/NOTES.md#2026-10-29-the-device-package-boot-and-what-this-row-rests-on)) | works (LM3644, 25 steps to 75 mA, quick-settings tile; its DT [kernel #96](https://github.com/derekross/linux-omarchy-mobile/pull/96), merged; [record](../device/tegu/NOTES.md#2026-10-29-the-device-package-boot-and-what-this-row-rests-on)) | testing (Omarchy's Location switch serves fixes from GPS, Galileo, BeiDou and GLONASS through the modem's Kepler once the modem is up; `omamobile-device-tegu`'s boot unit, opt-in ([#372](https://github.com/derekross/omarchy-mobile/pull/372)), starts gnssd with the modem: on 2026-11-03, after a reboot with nothing started by hand, a session through the switch's socket had 133 of 135 GGA sentences fixed, first fix 48 s after the client connected, 18 satellites; on 2026-11-09 the same from the in-tree drivers (the GNSS link driver, [kernel #185](https://github.com/derekross/linux-omarchy-mobile/pull/185), and the 9a's GNSS nodes, [kernel #237](https://github.com/derekross/linux-omarchy-mobile/pull/237), the `modem-cpif` overlay with the driver's config line, [#594](https://github.com/derekross/omarchy-mobile/pull/594), and the PCIe PHY's config line, [#274](https://github.com/derekross/omarchy-mobile/pull/274), all merged): four 150 s sessions, 497 of 507 GGA sentences fixed, up to 24 satellites; a 30-minute session on 2026-11-01 (omamobile-gnss 0.2.5's start, by hand, the modem link left to cycle) had 1763 of 1765, first fix 37 s, and a session in a moving car from [#114](https://github.com/derekross/omarchy-mobile/pull/114)'s package build fixed 145 of 153 times; needs [kernel #150](https://github.com/derekross/linux-omarchy-mobile/pull/150) and the PERIC0 clock fix [kernel #172](https://github.com/derekross/linux-omarchy-mobile/pull/172), both merged (without the latter the modem link hung the palmtop within minutes); not on by default because the modem isn't (the Modem cell); [plan](../device/tegu/MODEM-PLAN.md), [record](../device/tegu/TELEPHONY-PLAN.md), record with [#202](https://github.com/derekross/omarchy-mobile/pull/202)) | works (audio and sensor DSP through the GSA and Trusty, 93 services, started at boot by `omamobile-device-tegu` 0.2.3 from the device tree, [kernel #162](https://github.com/derekross/linux-omarchy-mobile/pull/162) in review; [record](../device/tegu/NOTES.md#2026-10-31-and-11-01-every-testing-row-on-a-published-style-kernel)) | works (the TAS2572 amplifiers and the microphone through the AoC card and PipeWire, at boot with the AoC: a tone from the speaker, the microphone at -32 dBFS; speakers at a -10 dB ceiling; [record](../device/tegu/NOTES.md#2026-10-31-and-11-01-every-testing-row-on-a-published-style-kernel)) | works (accelerometer, light, proximity, compass and gyroscope through the AoC and the sensor proxy, at boot with the AoC; [record](../device/tegu/NOTES.md#2026-10-31-and-11-01-every-testing-row-on-a-published-style-kernel)) | testing (calls in and out on the speakerphone, texts both ways, mobile data over the device `omamobile-sit-data` finds, with the Phone and Messages apps on the bridge ([#356](https://github.com/derekross/omarchy-mobile/pull/356), [#364](https://github.com/derekross/omarchy-mobile/pull/364), [#367](https://github.com/derekross/omarchy-mobile/pull/367), [#371](https://github.com/derekross/omarchy-mobile/pull/371)); `omamobile-device-tegu`'s boot unit starts the modem, the phone service and the bridge at boot when the owner enables it ([#372](https://github.com/derekross/omarchy-mobile/pull/372)), and is skipped on a phone that isn't provisioned or has no CP drivers; opt-in, not on by default, while marking slot B on the 9a is on hold ([#483](https://github.com/derekross/omarchy-mobile/pull/483)): with B unmarked a reset spends one of ABL's three tries, and the unit can't tell; it ran by itself on the owner's palmtop over a day of reboots on 2026-11-09 with 42 of 43 stops confirmed, one unexplained ([record](../device/tegu/TELEPHONY-PLAN.md#29-the-in-tree-drivers-through-the-starter-on-the-published-tip-plus-four-open-changes-2026-11-09)), and the NV partitions unchanged, on the owner's kernel with the bring-up modules, and on the in-tree drivers ([kernel #187](https://github.com/derekross/linux-omarchy-mobile/pull/187) and [kernel #162](https://github.com/derekross/linux-omarchy-mobile/pull/162), merged), which need the `modem-cpif` overlay and the GNSS link driver's config line ([#594](https://github.com/derekross/omarchy-mobile/pull/594)) and the PCIe PHY's config line ([#274](https://github.com/derekross/omarchy-mobile/pull/274)), all merged; the far end still hears an echo on the speakerphone ([#378](https://github.com/derekross/omarchy-mobile/pull/378)) and there's no earpiece route yet; [plan](../device/tegu/MODEM-PLAN.md), [record](../device/tegu/MODEM-PLAN.md#sim-test-results-2026-11-02-730-rc6-omamobile-tegu-s2mpg15-m1-g991042e2eff3-dirty)) | works (NXP ST54L through nxp-nci, its clock pad from the PMU ([kernel #104](https://github.com/derekross/linux-omarchy-mobile/pull/104) and [kernel #105](https://github.com/derekross/linux-omarchy-mobile/pull/105), merged, with [kernel #131](https://github.com/derekross/linux-omarchy-mobile/pull/131), merged), loaded at boot by `omamobile-device-tegu` 0.2.3 with neard and the link opener: polls with no I2C errors and read a payment card; polling stops before sleep; [record](../device/tegu/NOTES.md#2026-10-31-and-11-01-every-testing-row-on-a-published-style-kernel)) | works (main, ultrawide and front from the device tree, [kernel #164](https://github.com/derekross/linux-omarchy-mobile/pull/164) in review, with [kernel #63](https://github.com/derekross/linux-omarchy-mobile/pull/63) and [kernel #103](https://github.com/derekross/linux-omarchy-mobile/pull/103) in review: their drivers load at boot with nothing by hand, libcamera lists all three, and each streams, main at 19 fps and the others at 30 fps at 1280x960; basic picture quality through libcamera's software ISP; [record](../device/tegu/NOTES.md#2026-10-31-and-11-01-every-testing-row-on-a-published-style-kernel); the main camera's contrast autofocus through its LC898129 ([kernel #213](https://github.com/derekross/linux-omarchy-mobile/pull/213) in review, and a lens node on top of kernel #164, not yet in a pull request; libcamera 0.7.2-4.23), close subjects checked, the far end not yet ([notes](../device/tegu/NOTES.md#2026-11-07-the-main-cameras-autofocus-lc898129))) | testing (s2idle when asked for, or through the shell's auto-sleep with the `omamobile-sleep` toggle on, which ships off; the power key lights the lock screen on the first press ([#268](https://github.com/derekross/omarchy-mobile/pull/268), [#275](https://github.com/derekross/omarchy-mobile/pull/275)), and the RTC wakes it; on 2026-11-01 thirty attended 120 s sleeps ([plan](../device/tegu/SLEEP-PLAN.md) S1) and a day of real use with auto-sleep on ([record](../device/tegu/NOTES.md#2026-11-01-afternoon-and-evening-wi-fi-from-the-package-the-wake-and-the-replug-storage-idle-the-panel-id)) all woke, but six test sleeps since 10-28 did not (one in 21 on the clock-fix kernel on 11-01, and one in 127 in an overnight series of 120 s sleeps on 11-01 to 11-02), so sleep tests stay attended ([plan](../device/tegu/SLEEP-PLAN.md) S1); two causes are known: dead storage after a wake (the UFS pads came back as plain inputs on about one wake in a hundred; [kernel #224](https://github.com/derekross/linux-omarchy-mobile/pull/224), in review, re-applies the pin state at resume), and a silent no-wake with C2 entered through s2idle's own path: with C2 disabled for the sleep (#96) or left to the ordinary idle path (#98) the RTC alarm woke the palmtop 300 of 300 times each, then 15 of 15 on the everyday path, twelve of them half-hour auto-sleeps (2026-11-07 and 11-08, [#409](https://github.com/derekross/omarchy-mobile/pull/409)); [#591](https://github.com/derekross/omarchy-mobile/pull/591) is the sleep hook for it; open: on the published kernel, which has no idle states, a sleep still fails to wake now and then: one in 22 on 2026-11-09 (a boot without modules), none in two re-runs of 36, and one in 213 overnight on 2026-11-10 on the newest tip with the fixes, where the console shows the kernel alive and CPU 7 not answering from just after the device suspend ([plan](../device/tegu/SLEEP-PLAN.md) S1, failure 3); the RTC alarm on the published kernel came with [kernel #236](https://github.com/derekross/linux-omarchy-mobile/pull/236), merged 2026-11-10 (a kernel from before it has none, and a sleep there ends only on a key); works once that no-wake is found and fixed and kernel #224 is merged and has run from the published kernel; the drain is about 300 mA asleep, the same as awake with the screen off, because nothing below the CPUs sleeps yet; [record](../device/tegu/NOTES.md#2026-10-29-the-device-package-boot-and-what-this-row-rests-on)) | works (opt-in) (enrolls, matches, refuses other fingers and unlocks the lock screen through Trusty and `omamobile-fingerprint`, 2026-10-29; the sensor binds from the device tree, [kernel #165](https://github.com/derekross/linux-omarchy-mobile/pull/165) in review, with [kernel #126](https://github.com/derekross/linux-omarchy-mobile/pull/126), merged; opt-in as on the 7 Pro, because the service's first run writes Trusty's secure storage; [plan](../device/tegu/FINGERPRINT-PLAN.md), [record](../device/tegu/NOTES.md#2026-10-31-and-11-01-every-testing-row-on-a-published-style-kernel)) | | Pixel 8 Pro ([notes](../device/husky/NOTES.md)) | husky | zuma (Tensor G3) | WIP ([#1](https://github.com/derekross/omarchy-mobile/issues/1): slot B; from 2026-11-01 to 2026-11-07 a local unit marked slot B on Lef's phone; stopped pending [#252](https://github.com/derekross/omarchy-mobile/issues/252); Omarchy's image from the signed repository boots to the lock screen; the zuma device tree is merged ([kernel #13](https://github.com/derekross/linux-omarchy-mobile/pull/13), [#53](https://github.com/derekross/linux-omarchy-mobile/pull/53))) | testing (UFS at HS-G4 behind the read-only guard; Arch on `userdata`; [UFS-PLAN](../device/husky/UFS-PLAN.md)) | WIP (simple-framebuffer with the panel's size, [kernel #154](https://github.com/derekross/linux-omarchy-mobile/pull/154): console and Omarchy's lock screen; 120 Hz with brightness on a test kernel, [kernel #160](https://github.com/derekross/linux-omarchy-mobile/pull/160), started by the device package, [#228](https://github.com/derekross/omarchy-mobile/pull/228)) | testing (panthor on the Mali-G715 on a test kernel, [kernel #157](https://github.com/derekross/linux-omarchy-mobile/pull/157); [ROADMAP](../device/husky/ROADMAP.md)) | works (ST FTM5 over SPI, merged, [kernel #153](https://github.com/derekross/linux-omarchy-mobile/pull/153); verified on both phones, [notes](../device/husky/NOTES.md#2026-10-31-the-touchscreen)) | works (power and volume through `gpio-keys`, merged, [kernel #148](https://github.com/derekross/linux-omarchy-mobile/pull/148); verified on both phones, [notes](../device/husky/NOTES.md#2026-10-30-the-buttons)) | testing (USB and SSH) | testing (BCM4398 on a test kernel, [kernel #156](https://github.com/derekross/linux-omarchy-mobile/pull/156); firmware from the owner's image, [#214](https://github.com/derekross/omarchy-mobile/pull/214); [NOTES](../device/husky/NOTES.md)) | testing (BCM4398D0 on the APM UART, pairing and A2DP, on a test kernel, [kernel #199](https://github.com/derekross/linux-omarchy-mobile/pull/199); firmware from the owner's image; [ROADMAP](../device/husky/ROADMAP.md)) | testing (gauge with Google's ATL model through a bring-up overlay, temperature, MFD, pack EEPROM, [kernel #163](https://github.com/derekross/linux-omarchy-mobile/pull/163) and [#175](https://github.com/derekross/linux-omarchy-mobile/pull/175); the bus on by default waits for [kernel #205](https://github.com/derekross/linux-omarchy-mobile/pull/205); [notes](../device/husky/BATTERY-NOTES.md)) | testing (the charger driver and `tcpci_maxim` as a sink, by hand under a dead-man tool: sink at the Type-C 3 A level (input limit 0xc2 0x13 to 0x77); +1.5 A measured from a 30 W charger without the driver (1.485 A is the device-tree cap); no host mode, [#282](https://github.com/derekross/omarchy-mobile/pull/282); [notes](../device/husky/BATTERY-NOTES.md), [#1](https://github.com/derekross/omarchy-mobile/issues/1#issuecomment-6562547503)) | testing (CS40L26 on a test kernel, [kernel #200](https://github.com/derekross/linux-omarchy-mobile/pull/200)) | testing (LM3644, 50 mA cap, on a test kernel, [kernel #200](https://github.com/derekross/linux-omarchy-mobile/pull/200)) | no (first steps as drafts: [kernel #210](https://github.com/derekross/linux-omarchy-mobile/pull/210), [#211](https://github.com/derekross/linux-omarchy-mobile/pull/211)) | testing (loads and runs through the GSA and Trusty on a test kernel; plan and results [AOC-PLAN](../device/husky/AOC-PLAN.md)) | testing (stereo speakers and one microphone through UCM2 and PipeWire on a test kernel, [kernel #203](https://github.com/derekross/linux-omarchy-mobile/pull/203), [#204](https://github.com/derekross/linux-omarchy-mobile/pull/204), package [#453](https://github.com/derekross/omarchy-mobile/pull/453)) | no | no | testing (a test kernel reads tags; [kernel #208](https://github.com/derekross/linux-omarchy-mobile/pull/208), [#209](https://github.com/derekross/linux-omarchy-mobile/pull/209)) | no | no | no | @@ -79,6 +78,7 @@ Devices we'd like to support, with the closest starting point. Open an issue to | Pixel 11 Pro, 11 Pro XL, 11 Pro Fold | grizzly, kodiak, yogi | malibu (Tensor G6) | stock facts, contributors welcome: 11 Pro ([#26](https://github.com/derekross/omarchy-mobile/issues/26)), 11 Pro XL ([#199](https://github.com/derekross/omarchy-mobile/issues/199), [notes](../device/kodiak/NOTES.md)), 11 Pro Fold ([#40](https://github.com/derekross/omarchy-mobile/issues/40)) | | Pixel 4 | flame | SM8150 (Snapdragon 855) | **WIP, community port**, in the matrix above: the RAM-only first-light probe is merged ([BRINGUP-M1](../device/flame/BRINGUP-M1.md)); the native install is in review, split out of [#17](https://github.com/derekross/omarchy-mobile/pull/17) into [#55](https://github.com/derekross/omarchy-mobile/pull/55), [#56](https://github.com/derekross/omarchy-mobile/pull/56), [#58](https://github.com/derekross/omarchy-mobile/pull/58) and [#59](https://github.com/derekross/omarchy-mobile/pull/59) | | Pixel 4 XL | coral | SM8150 (Snapdragon 855) | **WIP, community port**, in the matrix above: bring-up notes merged ([#52](https://github.com/derekross/omarchy-mobile/pull/52): [BRINGUP-M1](../device/coral/BRINGUP-M1.md), [NOTES](../device/coral/NOTES.md)), with companion kernel/userspace sources ([omarchy-mobile-coral v0.2.3](https://github.com/HemangKumawat/omarchy-mobile-coral/tree/v0.2.3)); slot-B installer and `CONTRIBUTING.md` §3.1 entry still to land | +| Xiaomi Mi 8 | dipper | SDM845 | **WIP, RAM-only probe under review:** [#505](https://github.com/derekross/omarchy-mobile/pull/505); notes await [#330](https://github.com/derekross/omarchy-mobile/pull/330). Kernel series: [#218](https://github.com/derekross/linux-omarchy-mobile/pull/218), [#219](https://github.com/derekross/linux-omarchy-mobile/pull/219), [#220](https://github.com/derekross/linux-omarchy-mobile/pull/220) | | POCO F3 | alioth | SM8250 (Snapdragon 870) | the first non-Pixel port: a guarded installer and root image in review ([#25](https://github.com/derekross/omarchy-mobile/pull/25)) | | OnePlus 13 | dodge | SM8750 (Snapdragon 8 Elite) | **WIP, community port**, in the matrix above: device files, notes and the qcom-abl boot images merged ([#111](https://github.com/derekross/omarchy-mobile/pull/111)); its kernel stays in the contributor's fork ([mrlund/linux-omarchy-mobile `dodge-v3-20261101`](https://github.com/mrlund/linux-omarchy-mobile/tree/dodge-v3-20261101); [kernel #115](https://github.com/derekross/linux-omarchy-mobile/pull/115) closed: the SoC series is out of this tree's scope); the guarded installer follows in a later pull request | | OnePlus 6 | enchilada | SDM845 (Snapdragon 845) | **WIP, community port: [#432](https://github.com/derekross/omarchy-mobile/issues/432)**, in the matrix above: descriptor and notes; RAM-only (`fastboot boot`) until the slot-B install and its CONTRIBUTING.md §3.1 entry are agreed; `omamobile images` packs its header-v0 boot image, and its `UFS_RW_LUNS=sde` (the guard's second-LUN list, #530) comes with the slot-B install | diff --git a/tests/dipper-probe b/tests/dipper-probe new file mode 100644 index 000000000..6e4333221 --- /dev/null +++ b/tests/dipper-probe @@ -0,0 +1,41 @@ +#!/bin/bash +# SPDX-License-Identifier: MIT +set -euo pipefail +cd -- "$(dirname -- "${BASH_SOURCE[0]}")/.." + +bash -n tools/dipper/build +sh -n tools/dipper/initramfs-inside.sh +python3 - <<'PY' +from pathlib import Path + +script = Path('tools/dipper/initramfs-inside.sh').read_text() +assert "hostname omamobile\\n" in script +assert "dropbear -R -E -p 22" in script +assert "no USB host, crashing in 20 s so ABL falls back to slot A" in script +builder = Path('tools/dipper/build').read_text() +assert 'OUT=${OUT:-$repo/out/dipper}' in builder +assert 'modules_install' not in builder +assert 'FIRMWARE_DIR' not in builder +print('ok - Dipper initramfs patch anchors and RAM-only builder inputs') +PY + +python3 - <<'PY' +import json +from pathlib import Path +import subprocess +import tempfile + +with tempfile.TemporaryDirectory() as tmp: + root = Path(tmp) + kernel, dtb, ramdisk, out = (root / n for n in ('Image.gz', 'dipper.dtb', 'initramfs.gz', 'out')) + kernel.write_bytes(b'kernel') + dtb.write_bytes(b'\xd0\x0d\xfe\xed' + b'dtb') + ramdisk.write_bytes(b'ramdisk') + subprocess.run(['python3', 'tools/dipper/build-boot.py', '--kernel', str(kernel), + '--dtb', str(dtb), '--ramdisk', str(ramdisk), '--out', str(out)], + check=True, capture_output=True, text=True) + manifest = json.loads((out / 'BOOT-MANIFEST.json').read_text()) + assert manifest['hardware_boot_tested'] is False + assert (out / 'boot.img').read_bytes().startswith(b'ANDROID!') +print('ok - Dipper boot image header, appended DTB, and manifest') +PY diff --git a/tools/dipper/build b/tools/dipper/build index 2ac52d6a2..315caed4e 100755 --- a/tools/dipper/build +++ b/tools/dipper/build @@ -13,7 +13,7 @@ repo=$(cd "$here/../.." && pwd) KERNEL_DIR=${KERNEL_DIR:-$repo/../linux} KERNEL_OUT=${KERNEL_OUT:-$KERNEL_DIR} -OUT=${OUT:-$repo/../out/dipper} +OUT=${OUT:-$repo/out/dipper} : "${SSH_PUBKEY:?set SSH_PUBKEY to your authorized public key}" ALPINE=${ALPINE:-alpine:3.22} @@ -34,14 +34,11 @@ echo "kernel release: $release" umask 077 mkdir -p "$OUT"; chmod 700 "$OUT" mods=$OUT/modules -echo "installing modules into $mods" -rm -rf "$mods/lib/modules/$release" -make -C "$KERNEL_DIR" ARCH=arm64 LLVM=1 O="$KERNEL_OUT" \ - INSTALL_MOD_PATH="$mods" INSTALL_MOD_STRIP=1 modules_install >/dev/null -mkdir -p "$OUT/include/config" -cp "$KERNEL_OUT/include/config/kernel.release" "$OUT/include/config/kernel.release" -tar -C "$mods/lib/modules" --owner=0 --group=0 --numeric-owner -cf - "$release" \ - | zstd -q -19 -T0 -f -o "$OUT/modules-$release.tar.zst" +rm -rf "$mods" "$KERNEL_OUT/modules-staging" +DEVICE=dipper KERNEL_DIR="$KERNEL_DIR" KERNEL_OUT="$KERNEL_OUT" \ + "$repo/bin/omamobile" modules +mkdir -p "$mods/lib/modules" +tar --zstd -xf "$KERNEL_OUT/modules-$release.tar.zst" -C "$mods/lib/modules" echo "building the initramfs in $ALPINE (linux/arm64)" docker run --rm --platform linux/arm64 \ @@ -64,25 +61,6 @@ rm -f "$OUT/images/boot.img" "$OUT/images/BOOT-MANIFEST.json" "$here/build-boot.py" --kernel "$kernel_image" --dtb "$packdtb" \ --ramdisk "$OUT/initramfs.cpio.gz" --out "$OUT/images" -# Firmware and the Wi-Fi fix-ups are not part of the boot image; they go into the -# root filesystem. Collect them beside it so one directory holds everything. -if [[ -n ${FIRMWARE_DIR:-} ]]; then - fw=$FIRMWARE_DIR - [[ -d $fw ]] || die "FIRMWARE_DIR does not exist: $fw" - mkdir -p "$OUT/firmware" - # The blobs come off the phone mode 400, so a plain cp cannot overwrite them - # on a rebuild. Copy without preserving the mode and make them readable. - for d in qcom ath10k; do - [[ -d $fw/$d ]] || continue - rm -rf "$OUT/firmware/$d" - cp -r --no-preserve=mode "$fw/$d" "$OUT/firmware/" - done - chmod -R u+rwX "$OUT/firmware" - echo "firmware staged in $OUT/firmware" -else - echo "note: FIRMWARE_DIR is unset; firmware-dependent Wi-Fi will not come up" -fi - echo echo "artefacts in $OUT/images:" ls -l "$OUT/images" diff --git a/tools/dipper/initramfs-inside.sh b/tools/dipper/initramfs-inside.sh index 81b5ec498..4251b8d08 100755 --- a/tools/dipper/initramfs-inside.sh +++ b/tools/dipper/initramfs-inside.sh @@ -1,8 +1,6 @@ #!/bin/sh # SPDX-License-Identifier: MIT # Runs inside an aarch64 Alpine container. Only files under /out change. -# Adapted from tools/alioth/build-initramfs.sh: same class of device (non-A/B -# Qualcomm, appended DTB), different panel, watchdog name and descriptor values. set -eu : "${KERNEL_RELEASE:?KERNEL_RELEASE must be passed in}" From 6801b35645db5d8e53661b251cce83b4ffbbfc8c Mon Sep 17 00:00:00 2001 From: quatrixone Date: Sun, 8 Nov 2026 09:31:38 +0100 Subject: [PATCH 03/22] device/dipper: expose guarded NFS-root probe input --- device/dipper/BRINGUP-M1.md | 12 +++++++----- tests/dipper-probe | 9 ++++++++- tools/dipper/build | 8 ++++++-- tools/dipper/initramfs-inside.sh | 7 +++++++ 4 files changed, 28 insertions(+), 8 deletions(-) diff --git a/device/dipper/BRINGUP-M1.md b/device/dipper/BRINGUP-M1.md index bd716d967..3d5cd2816 100644 --- a/device/dipper/BRINGUP-M1.md +++ b/device/dipper/BRINGUP-M1.md @@ -34,8 +34,8 @@ backup checksum manifest. Do not boot if the manifest is missing or fails. USB/SSH checks succeed. Stop: unexpected output, USB failure, or any request to flash. Rollback: power-cycle to the installed boot image; if recovery is needed, use the verified backup. Risk: a USB host that never configures still - reaches the shared 20-second watcher panic; this RAM probe does not change - the installed boot image. The exact forced-restart hold duration is not + reaches the existing watcher panic after about 65 seconds; the RAM boot then + returns to the installed boot image. The exact forced-restart hold duration is not recorded here; do not guess it. The current recorded first light used the stock `dtbo` untouched. The image is @@ -50,9 +50,11 @@ Set `DEVICE=dipper`, `KERNEL_DIR` (source), and `KERNEL_OUT` (build output), the run `bin/omamobile kernel`. The output must include `Image`, `Image.gz`, `arch/arm64/boot/dts/qcom/sdm845-xiaomi-dipper.dtb`, and modules from that same kernel release. Then set `SSH_PUBKEY` to an OpenSSH public key and run -`tools/dipper/build` with the same `KERNEL_DIR` and `KERNEL_OUT`. The builder -requires Docker with arm64 emulation; it writes its output outside the source -tree by default. Do not commit the key or generated images. +`tools/dipper/build` with the same `KERNEL_DIR` and `KERNEL_OUT`. For a local +NFS-root probe, pass `OMAMOBILE_NFSROOT=:/` to the builder; the +host and export are build inputs, never descriptor values. The builder requires +Docker with arm64 emulation; it writes its output inside `out/dipper` by +default. Do not commit the key or generated images. The initramfs provides USB networking, SSH and a rescue shell. It does not mount `persist`, read or embed per-phone identifiers, start Wi-Fi, or install a diff --git a/tests/dipper-probe b/tests/dipper-probe index 6e4333221..48c3abf57 100644 --- a/tests/dipper-probe +++ b/tests/dipper-probe @@ -12,6 +12,8 @@ script = Path('tools/dipper/initramfs-inside.sh').read_text() assert "hostname omamobile\\n" in script assert "dropbear -R -E -p 22" in script assert "no USB host, crashing in 20 s so ABL falls back to slot A" in script +assert 'OMAMOBILE_NFSROOT' in Path('tools/dipper/build').read_text() +assert 'omamobile-nfsroot' in script builder = Path('tools/dipper/build').read_text() assert 'OUT=${OUT:-$repo/out/dipper}' in builder assert 'modules_install' not in builder @@ -37,5 +39,10 @@ with tempfile.TemporaryDirectory() as tmp: manifest = json.loads((out / 'BOOT-MANIFEST.json').read_text()) assert manifest['hardware_boot_tested'] is False assert (out / 'boot.img').read_bytes().startswith(b'ANDROID!') -print('ok - Dipper boot image header, appended DTB, and manifest') + kernel.write_bytes(b'k' * 0xF80001) + result = subprocess.run(['python3', 'tools/dipper/build-boot.py', '--kernel', str(kernel), + '--dtb', str(dtb), '--ramdisk', str(ramdisk), '--out', str(out)], + capture_output=True, text=True) + assert result.returncode != 0 and 'ABL refuses' in result.stderr +print('ok - Dipper boot image header, size refusal, appended DTB, and manifest') PY diff --git a/tools/dipper/build b/tools/dipper/build index 315caed4e..69fa82351 100755 --- a/tools/dipper/build +++ b/tools/dipper/build @@ -14,10 +14,13 @@ repo=$(cd "$here/../.." && pwd) KERNEL_DIR=${KERNEL_DIR:-$repo/../linux} KERNEL_OUT=${KERNEL_OUT:-$KERNEL_DIR} OUT=${OUT:-$repo/out/dipper} +die() { echo "error: $*" >&2; exit 1; } : "${SSH_PUBKEY:?set SSH_PUBKEY to your authorized public key}" ALPINE=${ALPINE:-alpine:3.22} - -die() { echo "error: $*" >&2; exit 1; } +if [[ -n ${OMAMOBILE_NFSROOT:-} ]]; then + [[ $OMAMOBILE_NFSROOT =~ ^[A-Za-z0-9.-]+:/[A-Za-z0-9._/-]+$ && $OMAMOBILE_NFSROOT != *..* && $OMAMOBILE_NFSROOT != *//* ]] || + die "OMAMOBILE_NFSROOT must be a host and absolute export path, for example 172.16.42.2:/srv/nfs/dipper" +fi [[ -d $KERNEL_DIR && -d $KERNEL_OUT ]] || die "set KERNEL_DIR and KERNEL_OUT to the kernel source and build directories" image=$KERNEL_OUT/arch/arm64/boot/Image.gz @@ -45,6 +48,7 @@ docker run --rm --platform linux/arm64 \ -v "$repo:/src:ro" -v "$mods:/modules:ro" -v "$SSH_PUBKEY:/input/key.pub:ro" \ -v "$OUT:/out" \ -e "KERNEL_RELEASE=$release" -e "OUT_UID=$(id -u)" -e "OUT_GID=$(id -g)" \ + -e "OMAMOBILE_NFSROOT=${OMAMOBILE_NFSROOT:-}" \ "$ALPINE" sh /src/tools/dipper/initramfs-inside.sh # Pack a copy of the DTB so nothing we do can dirty the kernel tree. diff --git a/tools/dipper/initramfs-inside.sh b/tools/dipper/initramfs-inside.sh index 4251b8d08..b7af3204e 100755 --- a/tools/dipper/initramfs-inside.sh +++ b/tools/dipper/initramfs-inside.sh @@ -90,6 +90,13 @@ chmod 755 "$stage/init" echo xiaomi,dipper > "$stage/etc/omamobile-compatible" : > "$stage/etc/omamobile-ufs-rw" +if [ -n "${OMAMOBILE_NFSROOT:-}" ]; then + case "$OMAMOBILE_NFSROOT" in + *[!A-Za-z0-9.:/_-]*|*..*|*//*|:*:*) echo "invalid OMAMOBILE_NFSROOT" >&2; exit 1 ;; + esac + case "$OMAMOBILE_NFSROOT" in *:/*) ;; *) echo "invalid OMAMOBILE_NFSROOT" >&2; exit 1 ;; esac + printf '%s\n' "$OMAMOBILE_NFSROOT" > "$stage/etc/omamobile-nfsroot" +fi # ABL has no alternate OS slot on Dipper. Keep the shared init's timeout, but # describe the RAM-only recovery path accurately in its on-screen message. From 683d321ed9580e20e1fa5206809c0f59365440df Mon Sep 17 00:00:00 2001 From: quatrixone Date: Mon, 9 Nov 2026 09:52:24 +0100 Subject: [PATCH 04/22] device/dipper: require verified recovery before RAM boot --- device/dipper/BRINGUP-M1.md | 36 +++++++++++++++++++-------- tests/dipper-probe | 23 ++++++++++++++--- tools/dipper/build | 2 +- tools/dipper/initramfs-inside.sh | 42 +++----------------------------- tools/dipper/patch-init.py | 29 ++++++++++++++++++++++ 5 files changed, 79 insertions(+), 53 deletions(-) create mode 100644 tools/dipper/patch-init.py diff --git a/device/dipper/BRINGUP-M1.md b/device/dipper/BRINGUP-M1.md index 3d5cd2816..f732f4120 100644 --- a/device/dipper/BRINGUP-M1.md +++ b/device/dipper/BRINGUP-M1.md @@ -28,15 +28,30 @@ backup checksum manifest. Do not boot if the manifest is missing or fails. the serial identifies the intended phone and the bootloader is unlocked. Stop: absent/ambiguous serial or locked bootloader. Rollback: leave fastboot without writing. Risk: this device has no alternate OS slot. -3. **RAM boot gate** — Run +3. **Recovery gate** — Confirm the handset's forced-restart buttons and hold + duration on the device, then record them in this runbook. Fastboot entry + with **Volume Down + Power** is separate from a forced restart. Stop if the + forced-restart procedure has not been verified; do not infer it from another + phone. Expect: an attended forced restart returns the handset to a state + where fastboot can be entered. Pass: that recovery path has been exercised + and recorded. Rollback: do not start a RAM boot until it passes. Risk: a + single-slot phone with no verified forced restart may be unrecoverable after + a hang. +4. **RAM boot gate** — Run `fastboot -s "$FASTBOOT_SERIAL" boot boot.img`. Expect: the image starts - without changing UFS. Pass: the phone reaches the rescue environment and - USB/SSH checks succeed. Stop: unexpected output, USB failure, or any request - to flash. Rollback: power-cycle to the installed boot image; if recovery is - needed, use the verified backup. Risk: a USB host that never configures still - reaches the existing watcher panic after about 65 seconds; the RAM boot then - returns to the installed boot image. The exact forced-restart hold duration is not - recorded here; do not guess it. + without changing UFS. The screen may go dark about 30 seconds after boot + because the panel regulator is not enabled; that alone is not a hang. + Pass only when `uname -r`, the `boot.img` sha256, all `ro` values from + `grep . /sys/block/sd*/ro /sys/block/sd*/sd*/ro`, the `ufs-ro` lines from + `dmesg`, the reserved-memory lines from + `grep -i -E 'reserved|System RAM' /proc/iomem`, the bound `qcom_wdt` + driver, its running watchdog feeder, and USB/SSH are recorded and correct. + Stop if any partition has `ro=0`, the watchdog is not fed, USB/SSH fails, + or anything asks to flash. Rollback: use the verified forced-restart + procedure from step 3, then recover from the verified backup if needed. + Risk: a USB host that never configures still reaches the existing watcher + panic after about 65 seconds; on this single-slot phone, recovery depends on + the tested procedure from step 3. The current recorded first light used the stock `dtbo` untouched. The image is RAM-only; never use `fastboot flash`, `bin/omamobile flash`, `bin/omamobile @@ -68,8 +83,9 @@ repository; the SSH public key and generated host key stay in the local output. verified stock backup. This PR deliberately adds no persistent writer. - The initramfs has no Arch root yet. A later hard NFS-root mount can freeze the root session if the host drops; use it only for a RAM-only probe. NFS-root - needs `RuntimeWatchdogSec=60s`, because `kill -9 -1` kills the userspace - watchdog feeder. It must never fall through to writable userdata. + needs a root with `RuntimeWatchdogSec=60s`, because `kill -9 -1` stops the + userspace feeder before systemd can take over. It must never fall through to + writable userdata. - Wi-Fi needs firmware and the phone's own WLAN address. Read identity files from `persist` with `debugfs` (read-only) before enabling that service; never mount `persist`. diff --git a/tests/dipper-probe b/tests/dipper-probe index 48c3abf57..20c59a792 100644 --- a/tests/dipper-probe +++ b/tests/dipper-probe @@ -9,18 +9,35 @@ python3 - <<'PY' from pathlib import Path script = Path('tools/dipper/initramfs-inside.sh').read_text() -assert "hostname omamobile\\n" in script -assert "dropbear -R -E -p 22" in script -assert "no USB host, crashing in 20 s so ABL falls back to slot A" in script +assert 'patch-init.py "$stage/init"' in script assert 'OMAMOBILE_NFSROOT' in Path('tools/dipper/build').read_text() assert 'omamobile-nfsroot' in script builder = Path('tools/dipper/build').read_text() assert 'OUT=${OUT:-$repo/out/dipper}' in builder assert 'modules_install' not in builder assert 'FIRMWARE_DIR' not in builder +assert 'fastboot -s boot boot.img' in builder +assert 'panel-samsung-ea8074' not in script print('ok - Dipper initramfs patch anchors and RAM-only builder inputs') PY +python3 - <<'PY' +from pathlib import Path +import subprocess +import tempfile + +with tempfile.TemporaryDirectory() as tmp: + init = Path(tmp) / 'init' + init.write_bytes(Path('initramfs/init').read_bytes()) + subprocess.run(['python3', 'tools/dipper/patch-init.py', str(init)], check=True) + patched = init.read_text() + assert 'modprobe qcom_wdt' in patched + assert 'watchdog -t 5 -T 30 /dev/watchdog0' in patched + assert 'dropbear -R -E -s -p "$usb_addr:22"' in patched + assert 'no USB host; RAM-only probe will reboot in 20 s' in patched +print('ok - Dipper patch step applies to the checked-in shared init') +PY + python3 - <<'PY' import json from pathlib import Path diff --git a/tools/dipper/build b/tools/dipper/build index 69fa82351..823581c1f 100755 --- a/tools/dipper/build +++ b/tools/dipper/build @@ -72,7 +72,7 @@ cat <<'NOTE' To try it without writing to the phone (nothing persists): - fastboot boot boot.img + fastboot -s boot boot.img Do not flash this image. Dipper has no second OS slot and this RAM-only path has no persistent update or recovery flow. diff --git a/tools/dipper/initramfs-inside.sh b/tools/dipper/initramfs-inside.sh index b7af3204e..51ee3f1d5 100755 --- a/tools/dipper/initramfs-inside.sh +++ b/tools/dipper/initramfs-inside.sh @@ -48,44 +48,19 @@ depmod -b "$stage" "$KERNEL_RELEASE" # root filesystem, not here. The pruner reads modules.dep and fails loudly # rather than silently emptying the tree. python3 /src/tools/dipper/prune-modules.py \ - "$stage/usr/lib/modules/$KERNEL_RELEASE" qcom_wdt panel-samsung-ea8074 + "$stage/usr/lib/modules/$KERNEL_RELEASE" qcom_wdt depmod -b "$stage" "$KERNEL_RELEASE" # The modules the init loads must exist AND match this kernel exactly, or the # phone boots to a black screen with no watchdog taken over. -for module in qcom_wdt panel-samsung-ea8074; do +for module in qcom_wdt; do path=$(modinfo -b "$stage" -k "$KERNEL_RELEASE" -n "$module") [ "$(modinfo -F vermagic "$path" | cut -d ' ' -f1)" = "$KERNEL_RELEASE" ] || { echo "module $module does not match $KERNEL_RELEASE" >&2; exit 1; } done cp /src/initramfs/init "$stage/init" -python3 - "$stage/init" <<'PY' -from pathlib import Path -import sys -p = Path(sys.argv[1]); s = p.read_text() - -# SDM845 leaves the cluster watchdogs running; take them over early. -needle = 'hostname omamobile\n' -assert s.count(needle) == 1, "shared init changed: hostname anchor" -s = s.replace(needle, '''# SDM845's watchdogs keep running until a driver claims them. -modprobe qcom_wdt || echo "omamobile: qcom watchdog module failed" >/dev/kmsg -if [ -c /dev/watchdog0 ]; then - watchdog -t 5 -T 30 /dev/watchdog0 -fi -modprobe panel-samsung-ea8074 || echo "omamobile: panel module failed" >/dev/kmsg -hostname omamobile -''') - -# Bind the rescue sshd to the USB interface address only, never to Wi-Fi. -needle = 'dropbear -R -E -p 22' -assert s.count(needle) == 1, "shared init changed: dropbear anchor" -s = s.replace(needle, '''usb_addr=$(ip -o -4 addr show dev usb0 scope global | awk '{ sub(/\\/.*/, "", $4); print $4; exit }') -if [ -n "$usb_addr" ]; then - dropbear -R -E -s -p "$usb_addr:22" -fi''') -p.write_text(s) -PY +python3 /src/tools/dipper/patch-init.py "$stage/init" chmod 755 "$stage/init" echo xiaomi,dipper > "$stage/etc/omamobile-compatible" @@ -98,17 +73,6 @@ if [ -n "${OMAMOBILE_NFSROOT:-}" ]; then printf '%s\n' "$OMAMOBILE_NFSROOT" > "$stage/etc/omamobile-nfsroot" fi -# ABL has no alternate OS slot on Dipper. Keep the shared init's timeout, but -# describe the RAM-only recovery path accurately in its on-screen message. -python3 - "$stage/init" <<'PY' -from pathlib import Path -import sys -p = Path(sys.argv[1]); s = p.read_text() -old = 'no USB host, crashing in 20 s so ABL falls back to slot A' -new = 'no USB host; RAM-only probe will reboot in 20 s' -assert s.count(old) == 1, "shared init changed: no-USB recovery message" -p.write_text(s.replace(old, new)) -PY echo 'Xiaomi Mi 8 Omarchy' > "$stage/etc/omamobile-usb-product" gcc -Os -static -o "$stage/usr/local/bin/reboot-to" \ diff --git a/tools/dipper/patch-init.py b/tools/dipper/patch-init.py new file mode 100644 index 000000000..49328a750 --- /dev/null +++ b/tools/dipper/patch-init.py @@ -0,0 +1,29 @@ +#!/usr/bin/env python3 +# SPDX-License-Identifier: MIT +from pathlib import Path +import sys + +p = Path(sys.argv[1]) +s = p.read_text() +patches = ( + ("hostname omamobile\n", + """# SDM845's watchdogs keep running until a driver claims them. +modprobe qcom_wdt || echo "omamobile: qcom watchdog module failed" >/dev/kmsg +if [ -c /dev/watchdog0 ]; then + watchdog -t 5 -T 30 /dev/watchdog0 +fi +hostname omamobile +""", "hostname anchor"), + ("dropbear -R -E -p 22", + """usb_addr=$(ip -o -4 addr show dev usb0 scope global | awk '{ sub(/\\/.*/, "", $4); print $4; exit }') +if [ -n "$usb_addr" ]; then + dropbear -R -E -s -p "$usb_addr:22" +fi""", "dropbear anchor"), + ("no USB host, crashing in 20 s so ABL falls back to slot A", + "no USB host; RAM-only probe will reboot in 20 s", + "no-USB recovery message"), +) +for old, new, name in patches: + assert s.count(old) == 1, f"shared init changed: {name}" + s = s.replace(old, new) +p.write_text(s) From ad55e47560b866710c92d7c52c00f9a7c385fc6c Mon Sep 17 00:00:00 2001 From: quatrixone Date: Mon, 9 Nov 2026 16:37:52 +0100 Subject: [PATCH 05/22] device/dipper: record verified restart and backup gates --- device/dipper/BRINGUP-M1.md | 46 ++++++++++++++++++++++--------------- 1 file changed, 27 insertions(+), 19 deletions(-) diff --git a/device/dipper/BRINGUP-M1.md b/device/dipper/BRINGUP-M1.md index f732f4120..b4919b285 100644 --- a/device/dipper/BRINGUP-M1.md +++ b/device/dipper/BRINGUP-M1.md @@ -14,29 +14,37 @@ There is no supported flash, push, installer or persistent update path here. ## Recovery and safe boot Each gate below must pass before proceeding. Set `FASTBOOT_SERIAL` to the -intended handset's serial and `BACKUP_CHECKSUMS` to the locally held stock -backup checksum manifest. Do not boot if the manifest is missing or fails. +intended handset's serial, `BACKUP_CHECKSUMS` to the locally held stock +partition manifest, and `USERDATA_BACKUP_CHECKSUMS` to the private userdata +archive's checksum file. Do not boot if either backup is missing or fails. 1. **Backup gate** — Expect: the verified stock backup and checksum manifest - are available off-device. Pass: `sha256sum -c "$BACKUP_CHECKSUMS"` reports - every entry OK. Stop: any missing or mismatched entry. Rollback: restore the - verified stock backup using the device recovery procedure. Risk: an - unverified backup cannot recover a damaged single-slot phone. + and the userdata archive are available off-device. Pass: both + `sha256sum -c "$BACKUP_CHECKSUMS"` and + `sha256sum -c "$USERDATA_BACKUP_CHECKSUMS"` report every entry OK (run each + from the directory containing its manifest). The userdata archive is a live + file-level copy, not a raw partition image or an atomic snapshot. Stop: any + missing or mismatched entry. Rollback: restore the verified stock backup + using the device recovery procedure. Risk: an unverified backup cannot + recover a damaged single-slot phone. 2. **Fastboot gate** — Enter fastboot with **Volume Down + Power**; the §3.1 entry is in [PR #499](https://github.com/derekross/omarchy-mobile/pull/499). - Run `fastboot -s "$FASTBOOT_SERIAL" getvar unlocked`. Expect `yes`. Pass: - the serial identifies the intended phone and the bootloader is unlocked. - Stop: absent/ambiguous serial or locked bootloader. Rollback: leave fastboot - without writing. Risk: this device has no alternate OS slot. -3. **Recovery gate** — Confirm the handset's forced-restart buttons and hold - duration on the device, then record them in this runbook. Fastboot entry - with **Volume Down + Power** is separate from a forced restart. Stop if the - forced-restart procedure has not been verified; do not infer it from another - phone. Expect: an attended forced restart returns the handset to a state - where fastboot can be entered. Pass: that recovery path has been exercised - and recorded. Rollback: do not start a RAM boot until it passes. Risk: a - single-slot phone with no verified forced restart may be unrecoverable after - a hang. + Run `fastboot -s "$FASTBOOT_SERIAL" getvar product` and + `fastboot -s "$FASTBOOT_SERIAL" getvar unlocked`. Expect `dipper` and `yes`. + Pass: exactly one device is listed, both values match, and the serial pins + every fastboot command. Stop: absent/ambiguous device, wrong product or + locked bootloader. Rollback: leave fastboot without writing. Risk: this + device has no alternate OS slot. +3. **Recovery gate** — Fastboot entry uses **Volume Down + Power**; the forced + restart is separate. On 2026-11-09, an attended test on this handset found + that holding **Power alone for more than 10 seconds** restarted it, then + Volume Down + Power entered fastboot. This was tested from the running + system, not by simulating a kernel hang. Expect: the Power-only hold + restarts the phone. Pass: the observed procedure above is recorded and the + phone can enter fastboot. Stop if Power alone does not restart it. Rollback: + do not start a RAM boot until this gate passes. Risk: a hard kernel hang has + not been simulated; recovery from one still depends on the hardware button + reset working. 4. **RAM boot gate** — Run `fastboot -s "$FASTBOOT_SERIAL" boot boot.img`. Expect: the image starts without changing UFS. The screen may go dark about 30 seconds after boot From 16f28af06e45a0d37b0c8864f8d98acb72c4f83b Mon Sep 17 00:00:00 2001 From: quatrixone Date: Mon, 9 Nov 2026 17:26:23 +0100 Subject: [PATCH 06/22] device/dipper: match read-only gate to main LUN guard --- device/dipper/BRINGUP-M1.md | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/device/dipper/BRINGUP-M1.md b/device/dipper/BRINGUP-M1.md index b4919b285..8cdc85239 100644 --- a/device/dipper/BRINGUP-M1.md +++ b/device/dipper/BRINGUP-M1.md @@ -49,12 +49,17 @@ archive's checksum file. Do not boot if either backup is missing or fails. `fastboot -s "$FASTBOOT_SERIAL" boot boot.img`. Expect: the image starts without changing UFS. The screen may go dark about 30 seconds after boot because the panel regulator is not enabled; that alone is not a hang. - Pass only when `uname -r`, the `boot.img` sha256, all `ro` values from - `grep . /sys/block/sd*/ro /sys/block/sd*/sd*/ro`, the `ufs-ro` lines from - `dmesg`, the reserved-memory lines from + Pass only when `uname -r`, the `boot.img` sha256, all partition `ro` + values, every whole-disk `ro` value except `sda`, and the `ufs-ro` lines + from `dmesg` are recorded and correct. Dipper's main LUN is the exception: + `/sys/block/sda/ro` remains `0`, but the guard removes `/dev/sda` so only + individually guarded partition nodes are available. Verify `/dev/sda` is + absent and every `/sys/block/sda/sda*/ro` is `1`; fail if the node exists. + Also record the reserved-memory lines from `grep -i -E 'reserved|System RAM' /proc/iomem`, the bound `qcom_wdt` driver, its running watchdog feeder, and USB/SSH are recorded and correct. - Stop if any partition has `ro=0`, the watchdog is not fed, USB/SSH fails, + Stop if any partition has `ro=0`, another whole-disk node has `ro=0`, + `/dev/sda` exists, the watchdog is not fed, USB/SSH fails, or anything asks to flash. Rollback: use the verified forced-restart procedure from step 3, then recover from the verified backup if needed. Risk: a USB host that never configures still reaches the existing watcher From 680059539f1ee806f0d29ab11eb1616dfd88875a Mon Sep 17 00:00:00 2001 From: quatrixone Date: Mon, 9 Nov 2026 17:28:38 +0100 Subject: [PATCH 07/22] device/dipper: record RAM boot gate results --- device/dipper/BRINGUP-M1.md | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/device/dipper/BRINGUP-M1.md b/device/dipper/BRINGUP-M1.md index 8cdc85239..6524707b5 100644 --- a/device/dipper/BRINGUP-M1.md +++ b/device/dipper/BRINGUP-M1.md @@ -1,10 +1,12 @@ # Xiaomi Mi 8 (dipper): RAM-only first light -**Status (2026-11-08):** first-light results are recorded in [the notes PR #330]. +**Status (2026-11-09):** this PR's image booted by RAM on a Xiaomi Mi 8; the +owner saw the console, USB/SSH and the read-only storage gate passed, and the +watchdog feeder ran. Results and the image hash are in [the notes PR #330]. Kernel support is public for review in [panel #218], [touch #219], -[DTS #220] and [ath10k #221]. These PRs are not merged yet. The direct EA8074 -panel driver and FTS5 touchscreen path still need testing on the current kernel. +[DTS #220] and [ath10k #221]. These PRs are not merged yet. The EA8074 panel +driver and FTS5 touchscreen still need separate hardware tests. This is a RAM-only bring-up. Dipper has one OS `boot` partition and no alternate OS slot. The descriptor sets `BOOT_METHOD=ram-only`, the builder makes only a From b9a35756b2090396d6bfd02e49785ad4f1197eec Mon Sep 17 00:00:00 2001 From: quatrixone Date: Mon, 9 Nov 2026 18:02:52 +0100 Subject: [PATCH 08/22] device/dipper: enable PMIC key inputs at boot --- device/dipper/BRINGUP-M1.md | 5 +++-- device/dipper/kernel.config | 3 +++ 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/device/dipper/BRINGUP-M1.md b/device/dipper/BRINGUP-M1.md index 6524707b5..397d6219a 100644 --- a/device/dipper/BRINGUP-M1.md +++ b/device/dipper/BRINGUP-M1.md @@ -2,8 +2,9 @@ # Xiaomi Mi 8 (dipper): RAM-only first light **Status (2026-11-09):** this PR's image booted by RAM on a Xiaomi Mi 8; the -owner saw the console, USB/SSH and the read-only storage gate passed, and the -watchdog feeder ran. Results and the image hash are in [the notes PR #330]. +owner saw the console, USB/SSH and read-only storage gate passed, the watchdog +feeder ran, and Volume Down generated `KEY_VOLUMEDOWN`. Results and the final +image hash are in [the notes PR #330]. Kernel support is public for review in [panel #218], [touch #219], [DTS #220] and [ath10k #221]. These PRs are not merged yet. The EA8074 panel driver and FTS5 touchscreen still need separate hardware tests. diff --git a/device/dipper/kernel.config b/device/dipper/kernel.config index 0041943af..142ee75a0 100644 --- a/device/dipper/kernel.config +++ b/device/dipper/kernel.config @@ -22,6 +22,9 @@ CONFIG_SCSI_UFS_QCOM=y # The Type-C port manager on the PMIC, for the role switch and VBUS detection. CONFIG_TYPEC_QCOM_PMIC=y +# Populate the PMIC power/resin key children before the initramfs checks keys. +CONFIG_POWER_RESET_QCOM_PON=y + # The kernel's simple-framebuffer is the first-light console. Keep the DSI # panel driver modular so the probe can try it without growing the built-in # kernel past this bootloader's size limit. From e98d7bc4abb208c0dc610e74336fe37af9216dcc Mon Sep 17 00:00:00 2001 From: quatrixone Date: Mon, 9 Nov 2026 19:38:42 +0100 Subject: [PATCH 09/22] device/dipper: finish owner review follow-ups --- device/dipper/BRINGUP-M1.md | 26 ++++++++++++++++++-------- device/dipper/kernel.config | 10 +++------- tests/all | 3 ++- tests/dipper-probe | 0 4 files changed, 23 insertions(+), 16 deletions(-) mode change 100644 => 100755 tests/dipper-probe diff --git a/device/dipper/BRINGUP-M1.md b/device/dipper/BRINGUP-M1.md index 397d6219a..374137d5c 100644 --- a/device/dipper/BRINGUP-M1.md +++ b/device/dipper/BRINGUP-M1.md @@ -5,9 +5,10 @@ owner saw the console, USB/SSH and read-only storage gate passed, the watchdog feeder ran, and Volume Down generated `KEY_VOLUMEDOWN`. Results and the final image hash are in [the notes PR #330]. -Kernel support is public for review in [panel #218], [touch #219], -[DTS #220] and [ath10k #221]. These PRs are not merged yet. The EA8074 panel -driver and FTS5 touchscreen still need separate hardware tests. +The FTS5 driver is merged upstream in Linux PR [touch #219]. The Dipper board +DTS is under review in [DTS #220], and the EA8074 panel driver is under review +in [panel #218]. +The panel and touchscreen still need separate hardware tests. This is a RAM-only bring-up. Dipper has one OS `boot` partition and no alternate OS slot. The descriptor sets `BOOT_METHOD=ram-only`, the builder makes only a @@ -41,8 +42,9 @@ archive's checksum file. Do not boot if either backup is missing or fails. 3. **Recovery gate** — Fastboot entry uses **Volume Down + Power**; the forced restart is separate. On 2026-11-09, an attended test on this handset found that holding **Power alone for more than 10 seconds** restarted it, then - Volume Down + Power entered fastboot. This was tested from the running - system, not by simulating a kernel hang. Expect: the Power-only hold + Volume Down + Power entered fastboot. This was tested from the installed + Android system, not from the bring-up image or by simulating a kernel hang. + Expect: the Power-only hold restarts the phone. Pass: the observed procedure above is recorded and the phone can enter fastboot. Stop if Power alone does not restart it. Rollback: do not start a RAM boot until this gate passes. Risk: a hard kernel hang has @@ -50,8 +52,9 @@ archive's checksum file. Do not boot if either backup is missing or fails. reset working. 4. **RAM boot gate** — Run `fastboot -s "$FASTBOOT_SERIAL" boot boot.img`. Expect: the image starts - without changing UFS. The screen may go dark about 30 seconds after boot - because the panel regulator is not enabled; that alone is not a hang. + without changing UFS, and the screen stays lit because simpledrm holds the + panel's VCI and VDDIO rails. If it goes dark about 30 seconds in, record + `dmesg | grep -i -E 'regulator|simple'` and stop. Pass only when `uname -r`, the `boot.img` sha256, all partition `ro` values, every whole-disk `ro` value except `sda`, and the `ufs-ro` lines from `dmesg` are recorded and correct. Dipper's main LUN is the exception: @@ -105,10 +108,17 @@ repository; the SSH public key and generated host key stay in the local output. - Wi-Fi needs firmware and the phone's own WLAN address. Read identity files from `persist` with `debugfs` (read-only) before enabling that service; never mount `persist`. +- The exact systemd journal line from the earlier failed `qcom_wdt` timeout + change was not retained. NFS root remains unverified; systemd must take over + the watchdog with `RuntimeWatchdogSec=60s` after the initramfs feeder stops. - Test the panel and FTS5 changes on the phone before marking them supported. +From this rescue image, an SSH session can return to fastboot with +`reboot-to bootloader`. The helper asks the PMIC reboot-mode driver to select +the bootloader and writes no UFS partition. The PMIC reset path was verified on +the handset on 2026-11-09; the packaged helper still needs an end-to-end test. + [panel #218]: https://github.com/derekross/linux-omarchy-mobile/pull/218 [touch #219]: https://github.com/derekross/linux-omarchy-mobile/pull/219 [DTS #220]: https://github.com/derekross/linux-omarchy-mobile/pull/220 -[ath10k #221]: https://github.com/derekross/linux-omarchy-mobile/pull/221 [the notes PR #330]: https://github.com/derekross/omarchy-mobile/pull/330 diff --git a/device/dipper/kernel.config b/device/dipper/kernel.config index 142ee75a0..f24173e2f 100644 --- a/device/dipper/kernel.config +++ b/device/dipper/kernel.config @@ -25,12 +25,8 @@ CONFIG_TYPEC_QCOM_PMIC=y # Populate the PMIC power/resin key children before the initramfs checks keys. CONFIG_POWER_RESET_QCOM_PON=y -# The kernel's simple-framebuffer is the first-light console. Keep the DSI -# panel driver modular so the probe can try it without growing the built-in -# kernel past this bootloader's size limit. -CONFIG_DRM_PANEL_SAMSUNG_EA8074=m - -# Touch, so a working panel is usable without waiting for userspace. +# The FTS5 driver is upstream after PR #219, but PR #220 has no Dipper touch +# node yet. Keep it built in for a later node/overlay test. CONFIG_TOUCHSCREEN_STMFTS=y # Console log into the stock ramoops region: the only way to read an early hang @@ -46,7 +42,7 @@ CONFIG_PSTORE_CONSOLE=y # i2c (geni_i2c loaded by hand bound to nothing, and `bind` by hand failed). # So everything needed to reach a usable system is built in. -# i2c: the touchscreen lives on i2c14, and nothing on that bus exists without it. +# i2c: built in for the follow-up FTS5 node; PR #220 does not enable it yet. CONFIG_I2C_QCOM_GENI=y CONFIG_QCOM_GPI_DMA=y # Nothing of ours is on SPI, so it stays a module: every built-in byte counts diff --git a/tests/all b/tests/all index 27a3b1482..31e7ed5a8 100755 --- a/tests/all +++ b/tests/all @@ -43,9 +43,10 @@ sh -n initramfs/init sh -n device/flame/initramfs/init sh -n device/flame/initramfs/build bash -n tools/build-flame-probe +bash -n tools/dipper/build tools/dipper/initramfs-inside.sh echo "ok - scripts parse" python3 tests/bt-uart-gpio.py -for t in tests/pr-check tests/kernel-pr-check tests/phone-smoke tests/alarm-wake-test tests/install-phone tests/build-rootfs tests/rootfs-resolve tests/phone-provision tests/nv-backup tests/initramfs-grow tests/images-layout tests/boot-update-parity tests/stage-boot-files tests/build-packages-host-tools tests/initramfs-reproducible tests/device-overlays tests/simplefb-trigger tests/initramfs-steps tests/storage-guard tests/usb-product tests/grep-q-pipes tests/boot-method tests/modules-push tests/make-bundle-keys tests/make-bundle tests/release-signing tests/pinned-packages tests/flame-probe packages/omamobile-firstboot/test/all packages/omamobile-device-felix/test/all packages/omamobile-device-lynx/test/all packages/omamobile-device-panther/test/all tests/local-builds tests/phone-install-package tests/publish-kernel tests/fetch-toolchain tests/release-upload tests/extract-camera-data tests/release tests/lineage-ref tests/repo-publish tests/repo-publish-stage tests/extract-vendor-firmware tests/alpine-fetch-callers tests/alpine-fetch tests/tools-help tests/install-phone-initramfs; do +for t in tests/pr-check tests/kernel-pr-check tests/phone-smoke tests/alarm-wake-test tests/install-phone tests/build-rootfs tests/rootfs-resolve tests/phone-provision tests/nv-backup tests/initramfs-grow tests/images-layout tests/boot-update-parity tests/stage-boot-files tests/build-packages-host-tools tests/initramfs-reproducible tests/device-overlays tests/simplefb-trigger tests/initramfs-steps tests/storage-guard tests/usb-product tests/grep-q-pipes tests/boot-method tests/modules-push tests/make-bundle-keys tests/make-bundle tests/release-signing tests/pinned-packages tests/flame-probe tests/dipper-probe packages/omamobile-firstboot/test/all packages/omamobile-device-felix/test/all packages/omamobile-device-lynx/test/all packages/omamobile-device-panther/test/all tests/local-builds tests/phone-install-package tests/publish-kernel tests/fetch-toolchain tests/release-upload tests/extract-camera-data tests/release tests/lineage-ref tests/repo-publish tests/repo-publish-stage tests/extract-vendor-firmware tests/alpine-fetch-callers tests/alpine-fetch tests/tools-help tests/install-phone-initramfs; do echo "# $t" "$t" done diff --git a/tests/dipper-probe b/tests/dipper-probe old mode 100644 new mode 100755 From 0b0b4ca10d1bbd4613f5bcca6704cb885464c3b6 Mon Sep 17 00:00:00 2001 From: quatrixone Date: Mon, 9 Nov 2026 19:59:35 +0100 Subject: [PATCH 10/22] device/dipper: record fastboot helper test --- device/dipper/BRINGUP-M1.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/device/dipper/BRINGUP-M1.md b/device/dipper/BRINGUP-M1.md index 374137d5c..400db20f2 100644 --- a/device/dipper/BRINGUP-M1.md +++ b/device/dipper/BRINGUP-M1.md @@ -116,7 +116,8 @@ repository; the SSH public key and generated host key stay in the local output. From this rescue image, an SSH session can return to fastboot with `reboot-to bootloader`. The helper asks the PMIC reboot-mode driver to select the bootloader and writes no UFS partition. The PMIC reset path was verified on -the handset on 2026-11-09; the packaged helper still needs an end-to-end test. +the handset on 2026-11-09. The packaged helper returned the running image to +fastboot on 2026-11-09 without writing UFS. [panel #218]: https://github.com/derekross/linux-omarchy-mobile/pull/218 [touch #219]: https://github.com/derekross/linux-omarchy-mobile/pull/219 From ecc636a2031fe898307624417e1944117411b128 Mon Sep 17 00:00:00 2001 From: quatrixone Date: Mon, 9 Nov 2026 20:44:20 +0100 Subject: [PATCH 11/22] device/dipper: record verified stock backup --- device/dipper/BRINGUP-M1.md | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/device/dipper/BRINGUP-M1.md b/device/dipper/BRINGUP-M1.md index 400db20f2..ad8d697b4 100644 --- a/device/dipper/BRINGUP-M1.md +++ b/device/dipper/BRINGUP-M1.md @@ -9,6 +9,11 @@ The FTS5 driver is merged upstream in Linux PR [touch #219]. The Dipper board DTS is under review in [DTS #220], and the EA8074 panel driver is under review in [panel #218]. The panel and touchscreen still need separate hardware tests. +On 2026-11-09, a guarded RAM boot was used to capture all 84 GPT partitions +other than `userdata` (the phone has no `super`); source and compressed-image +checksums passed. The separate live userdata archive also passed its checksum +and zstd integrity checks. It is a file-level, non-atomic archive, not a raw +partition image. This is a RAM-only bring-up. Dipper has one OS `boot` partition and no alternate OS slot. The descriptor sets `BOOT_METHOD=ram-only`, the builder makes only a @@ -22,8 +27,8 @@ intended handset's serial, `BACKUP_CHECKSUMS` to the locally held stock partition manifest, and `USERDATA_BACKUP_CHECKSUMS` to the private userdata archive's checksum file. Do not boot if either backup is missing or fails. -1. **Backup gate** — Expect: the verified stock backup and checksum manifest - and the userdata archive are available off-device. Pass: both +1. **Backup gate** — Expect: the verified 84-partition stock backup and + checksum manifests and the userdata archive are available off-device. Pass: both `sha256sum -c "$BACKUP_CHECKSUMS"` and `sha256sum -c "$USERDATA_BACKUP_CHECKSUMS"` report every entry OK (run each from the directory containing its manifest). The userdata archive is a live From 25c7e9db6e86bbea57e28478d45b8ed6b2ce2ab4 Mon Sep 17 00:00:00 2001 From: quatrixone Date: Mon, 9 Nov 2026 21:58:45 +0100 Subject: [PATCH 12/22] device/dipper: record panel test and guard follow-up --- device/dipper/BRINGUP-M1.md | 48 ++++++++++++++++++++------------ device/dipper/kernel.config | 11 ++++---- tests/dipper-probe | 3 +- tools/dipper/initramfs-inside.sh | 5 ++-- 4 files changed, 41 insertions(+), 26 deletions(-) diff --git a/device/dipper/BRINGUP-M1.md b/device/dipper/BRINGUP-M1.md index ad8d697b4..6c5b37ae1 100644 --- a/device/dipper/BRINGUP-M1.md +++ b/device/dipper/BRINGUP-M1.md @@ -3,12 +3,23 @@ **Status (2026-11-09):** this PR's image booted by RAM on a Xiaomi Mi 8; the owner saw the console, USB/SSH and read-only storage gate passed, the watchdog -feeder ran, and Volume Down generated `KEY_VOLUMEDOWN`. Results and the final -image hash are in [the notes PR #330]. -The FTS5 driver is merged upstream in Linux PR [touch #219]. The Dipper board -DTS is under review in [DTS #220], and the EA8074 panel driver is under review -in [panel #218]. -The panel and touchscreen still need separate hardware tests. +feeder ran. Volume Down generated `KEY_VOLUMEDOWN` on the second RAM image; +it has not been rechecked on this image. Results and the final image hash are +in [the notes PR #330]. +The FTS5 driver from [touch #219] is merged into linux-omarchy-mobile. The +Dipper board DTS is under review in [DTS #220], and the EA8074 panel driver is +under review in [panel #218]. +A separate RAM overlay test on 2026-11-09 booted kernel +`7.3.0-rc6-omamobile-push1` (image SHA-256 +`0f0ec9d62ebe57bef9ae8a4804bb23728f624daab824a0bf7dee18f63c2a3d59`). The +EA8074 driver bound to `ae94000.dsi.0`; DRM reported connected at 1080x2248, +and the owner saw the console on the lit panel. Backlight value 0 was accepted +and restored to 511 (maximum 1023). Framebuffer blanking switched DRM `dpms` +from `On` to `Off` and back to `On`. The FTS5 touchscreen still needs a hardware +test. This panel image predates guard PR #484: `/dev/sda` was absent and all 85 +partition flags were `ro=1`, but `/dev/sdb` through `/dev/sdf` still existed +with their whole-disk flags `ro=1`. No UFS was written. Repeat the whole-disk +node check after #484 is included. On 2026-11-09, a guarded RAM boot was used to capture all 84 GPT partitions other than `userdata` (the phone has no `super`); source and compressed-image checksums passed. The separate live userdata archive also passed its checksum @@ -60,17 +71,16 @@ archive's checksum file. Do not boot if either backup is missing or fails. without changing UFS, and the screen stays lit because simpledrm holds the panel's VCI and VDDIO rails. If it goes dark about 30 seconds in, record `dmesg | grep -i -E 'regulator|simple'` and stop. - Pass only when `uname -r`, the `boot.img` sha256, all partition `ro` - values, every whole-disk `ro` value except `sda`, and the `ufs-ro` lines - from `dmesg` are recorded and correct. Dipper's main LUN is the exception: - `/sys/block/sda/ro` remains `0`, but the guard removes `/dev/sda` so only - individually guarded partition nodes are available. Verify `/dev/sda` is - absent and every `/sys/block/sda/sda*/ro` is `1`; fail if the node exists. + Pass only when `uname -r`, the `boot.img` sha256, all partition `ro` values, + whole-disk `ro` values, and `ufs-ro` lines from `dmesg` are recorded. Every + whole-disk node (`/dev/sda` through `/dev/sdf`) must be absent, and every + partition must have `ro=1`; do not gate on whole-disk `ro` values. This holds + when the guard protects all six UFS LUNs, including after #484. Also record the reserved-memory lines from `grep -i -E 'reserved|System RAM' /proc/iomem`, the bound `qcom_wdt` driver, its running watchdog feeder, and USB/SSH are recorded and correct. - Stop if any partition has `ro=0`, another whole-disk node has `ro=0`, - `/dev/sda` exists, the watchdog is not fed, USB/SSH fails, + Stop if any whole-disk node exists, any partition has `ro=0`, the watchdog + is not fed, USB/SSH fails, or anything asks to flash. Rollback: use the verified forced-restart procedure from step 3, then recover from the verified backup if needed. Risk: a USB host that never configures still reaches the existing watcher @@ -114,12 +124,14 @@ repository; the SSH public key and generated host key stay in the local output. from `persist` with `debugfs` (read-only) before enabling that service; never mount `persist`. - The exact systemd journal line from the earlier failed `qcom_wdt` timeout - change was not retained. NFS root remains unverified; systemd must take over - the watchdog with `RuntimeWatchdogSec=60s` after the initramfs feeder stops. -- Test the panel and FTS5 changes on the phone before marking them supported. + change was not retained; NFS root remains unverified. +- Test the FTS5 touchscreen changes and GPU rendering on the phone before + marking them supported. From this rescue image, an SSH session can return to fastboot with -`reboot-to bootloader`. The helper asks the PMIC reboot-mode driver to select +`reboot-to bootloader`. Do not use `reboot-to recovery` until the contents of +the stock `recovery` partition have been verified. The helper asks the PMIC +reboot-mode driver to select the bootloader and writes no UFS partition. The PMIC reset path was verified on the handset on 2026-11-09. The packaged helper returned the running image to fastboot on 2026-11-09 without writing UFS. diff --git a/device/dipper/kernel.config b/device/dipper/kernel.config index f24173e2f..12d5c2f6d 100644 --- a/device/dipper/kernel.config +++ b/device/dipper/kernel.config @@ -49,12 +49,13 @@ CONFIG_QCOM_GPI_DMA=y # against the ABL kernel limit below. CONFIG_SPI_QCOM_GENI=m -# Display comes from the bootloader's framebuffer through simpledrm, not from -# the MSM display driver, so DRM_MSM stays a module. Built in it pushed the -# kernel past about 16 MiB, which this ABL refuses outright: -# Booting FAILED (remote: 'Failed to load/authenticate boot image: 00000050') -# Nothing loads it; the panel path is open work (see NOTES.md). +# The default image uses the bootloader's framebuffer through simpledrm, so +# keep MSM and the EA8074 panel driver as modules. This keeps the kernel under +# Dipper's ABL limit; the rescue initramfs carries them for an attended panel +# test but does not load them at boot. CONFIG_DRM_MSM=m +CONFIG_DRM_PANEL_SAMSUNG_EA8074=m +CONFIG_REGULATOR_QCOM_REFGEN=m CONFIG_DRM_SIMPLEDRM=y CONFIG_SYSFB_SIMPLEFB=y diff --git a/tests/dipper-probe b/tests/dipper-probe index 20c59a792..92ccbaf53 100755 --- a/tests/dipper-probe +++ b/tests/dipper-probe @@ -17,7 +17,8 @@ assert 'OUT=${OUT:-$repo/out/dipper}' in builder assert 'modules_install' not in builder assert 'FIRMWARE_DIR' not in builder assert 'fastboot -s boot boot.img' in builder -assert 'panel-samsung-ea8074' not in script +assert 'panel-samsung-ea8074 qcom-refgen-regulator' in script +assert 'CONFIG_REGULATOR_QCOM_REFGEN=m' in Path('device/dipper/kernel.config').read_text() print('ok - Dipper initramfs patch anchors and RAM-only builder inputs') PY diff --git a/tools/dipper/initramfs-inside.sh b/tools/dipper/initramfs-inside.sh index 51ee3f1d5..a1d218d75 100755 --- a/tools/dipper/initramfs-inside.sh +++ b/tools/dipper/initramfs-inside.sh @@ -41,14 +41,15 @@ rm -f "$stage/usr/lib/modules/$KERNEL_RELEASE/build" \ "$stage/usr/lib/modules/$KERNEL_RELEASE/source" depmod -b "$stage" "$KERNEL_RELEASE" -# Keep only the modules this initramfs actually loads, with their dependencies. +# Keep the watchdog module and the optional Dipper DSI test modules, with their +# dependencies. # The full tree is ~1764 modules and dominates the image: with the PHYs, UFS, # i2c and simpledrm built in, almost none of it is reachable here, and ABL # refuses a boot image that grows too large. Everything else belongs in the # root filesystem, not here. The pruner reads modules.dep and fails loudly # rather than silently emptying the tree. python3 /src/tools/dipper/prune-modules.py \ - "$stage/usr/lib/modules/$KERNEL_RELEASE" qcom_wdt + "$stage/usr/lib/modules/$KERNEL_RELEASE" qcom_wdt msm panel-samsung-ea8074 qcom-refgen-regulator depmod -b "$stage" "$KERNEL_RELEASE" # The modules the init loads must exist AND match this kernel exactly, or the From 41676a69ae5a85245ce942504039337d93254693 Mon Sep 17 00:00:00 2001 From: quatrixone Date: Mon, 9 Nov 2026 22:05:24 +0100 Subject: [PATCH 13/22] device/dipper: clarify reboot and recovery status --- device/dipper/BRINGUP-M1.md | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/device/dipper/BRINGUP-M1.md b/device/dipper/BRINGUP-M1.md index 6c5b37ae1..4659e49e5 100644 --- a/device/dipper/BRINGUP-M1.md +++ b/device/dipper/BRINGUP-M1.md @@ -56,10 +56,10 @@ archive's checksum file. Do not boot if either backup is missing or fails. locked bootloader. Rollback: leave fastboot without writing. Risk: this device has no alternate OS slot. 3. **Recovery gate** — Fastboot entry uses **Volume Down + Power**; the forced - restart is separate. On 2026-11-09, an attended test on this handset found - that holding **Power alone for more than 10 seconds** restarted it, then - Volume Down + Power entered fastboot. This was tested from the installed - Android system, not from the bring-up image or by simulating a kernel hang. + restart is separate. On 2026-11-09, an attended test from installed Android found that holding + **Power alone for more than 10 seconds** restarted into Android. It has not + been tried under the RAM kernel or from a simulated kernel hang. Volume Down + + Power then entered fastboot from Android. Expect: the Power-only hold restarts the phone. Pass: the observed procedure above is recorded and the phone can enter fastboot. Stop if Power alone does not restart it. Rollback: @@ -129,10 +129,10 @@ repository; the SSH public key and generated host key stay in the local output. marking them supported. From this rescue image, an SSH session can return to fastboot with -`reboot-to bootloader`. Do not use `reboot-to recovery` until the contents of -the stock `recovery` partition have been verified. The helper asks the PMIC -reboot-mode driver to select -the bootloader and writes no UFS partition. The PMIC reset path was verified on +`reboot-to bootloader`. The stock `recovery` image was verified from its +4.9.337 kernel header, but recovery-mode reboot was not tested; this runbook +uses only the verified bootloader path. The helper asks the PMIC reboot-mode +driver to select the bootloader and writes no UFS partition. The PMIC reset path was verified on the handset on 2026-11-09. The packaged helper returned the running image to fastboot on 2026-11-09 without writing UFS. From 17dd15bfd58f56901526b6b51153db7d125978da Mon Sep 17 00:00:00 2001 From: quatrixone Date: Mon, 9 Nov 2026 22:52:03 +0100 Subject: [PATCH 14/22] device/dipper: record restart under RAM kernel --- device/dipper/BRINGUP-M1.md | 18 ++++++++---------- 1 file changed, 8 insertions(+), 10 deletions(-) diff --git a/device/dipper/BRINGUP-M1.md b/device/dipper/BRINGUP-M1.md index 4659e49e5..87a9e2631 100644 --- a/device/dipper/BRINGUP-M1.md +++ b/device/dipper/BRINGUP-M1.md @@ -56,16 +56,14 @@ archive's checksum file. Do not boot if either backup is missing or fails. locked bootloader. Rollback: leave fastboot without writing. Risk: this device has no alternate OS slot. 3. **Recovery gate** — Fastboot entry uses **Volume Down + Power**; the forced - restart is separate. On 2026-11-09, an attended test from installed Android found that holding - **Power alone for more than 10 seconds** restarted into Android. It has not - been tried under the RAM kernel or from a simulated kernel hang. Volume Down - + Power then entered fastboot from Android. - Expect: the Power-only hold - restarts the phone. Pass: the observed procedure above is recorded and the - phone can enter fastboot. Stop if Power alone does not restart it. Rollback: - do not start a RAM boot until this gate passes. Risk: a hard kernel hang has - not been simulated; recovery from one still depends on the hardware button - reset working. + restart is separate. On 2026-11-09, an attended test found that holding + **Power alone for 10 seconds** restarted into Android from both installed + Android and the Omarchy Mobile RAM kernel. Volume Down + Power then entered + fastboot from Android. Expect: the Power-only hold restarts the phone. Pass: + the observed procedure above is recorded and the phone can enter fastboot. + Stop if Power alone does not restart it. Rollback: do not start a RAM boot + until this gate passes. Risk: a hard kernel hang has not been simulated; + recovery from one still depends on the hardware button reset working. 4. **RAM boot gate** — Run `fastboot -s "$FASTBOOT_SERIAL" boot boot.img`. Expect: the image starts without changing UFS, and the screen stays lit because simpledrm holds the From bce9717190b9b20b4e65228c9e8193fe0e3f10e5 Mon Sep 17 00:00:00 2001 From: quatrixone Date: Tue, 10 Nov 2026 02:49:39 +0100 Subject: [PATCH 15/22] device/dipper: align panel and guard test gates --- device/dipper/BRINGUP-M1.md | 24 ++++++++---------------- device/dipper/kernel.config | 11 +++++------ tests/dipper-probe | 3 +-- tools/dipper/initramfs-inside.sh | 5 ++--- 4 files changed, 16 insertions(+), 27 deletions(-) diff --git a/device/dipper/BRINGUP-M1.md b/device/dipper/BRINGUP-M1.md index 87a9e2631..a66f1a329 100644 --- a/device/dipper/BRINGUP-M1.md +++ b/device/dipper/BRINGUP-M1.md @@ -9,17 +9,8 @@ in [the notes PR #330]. The FTS5 driver from [touch #219] is merged into linux-omarchy-mobile. The Dipper board DTS is under review in [DTS #220], and the EA8074 panel driver is under review in [panel #218]. -A separate RAM overlay test on 2026-11-09 booted kernel -`7.3.0-rc6-omamobile-push1` (image SHA-256 -`0f0ec9d62ebe57bef9ae8a4804bb23728f624daab824a0bf7dee18f63c2a3d59`). The -EA8074 driver bound to `ae94000.dsi.0`; DRM reported connected at 1080x2248, -and the owner saw the console on the lit panel. Backlight value 0 was accepted -and restored to 511 (maximum 1023). Framebuffer blanking switched DRM `dpms` -from `On` to `Off` and back to `On`. The FTS5 touchscreen still needs a hardware -test. This panel image predates guard PR #484: `/dev/sda` was absent and all 85 -partition flags were `ro=1`, but `/dev/sdb` through `/dev/sdf` still existed -with their whole-disk flags `ro=1`. No UFS was written. Repeat the whole-disk -node check after #484 is included. +The EA8074 panel test is recorded in [the notes PR #330]. The FTS5 touchscreen +still needs a hardware test. On 2026-11-09, a guarded RAM boot was used to capture all 84 GPT partitions other than `userdata` (the phone has no `super`); source and compressed-image checksums passed. The separate live userdata archive also passed its checksum @@ -70,14 +61,15 @@ archive's checksum file. Do not boot if either backup is missing or fails. panel's VCI and VDDIO rails. If it goes dark about 30 seconds in, record `dmesg | grep -i -E 'regulator|simple'` and stop. Pass only when `uname -r`, the `boot.img` sha256, all partition `ro` values, - whole-disk `ro` values, and `ufs-ro` lines from `dmesg` are recorded. Every - whole-disk node (`/dev/sda` through `/dev/sdf`) must be absent, and every - partition must have `ro=1`; do not gate on whole-disk `ro` values. This holds - when the guard protects all six UFS LUNs, including after #484. + whole-disk `ro` values, and `ufs-ro` lines from `dmesg` are recorded. + `/dev/sda` must be absent or present with `/sys/block/sda/ro=1` in NFS mode; + each other whole-disk node must be absent or present with its `ro=1`. Every + partition must have `ro=1`. Stop if any partition or present whole-disk node + has `ro=0`. Also record the reserved-memory lines from `grep -i -E 'reserved|System RAM' /proc/iomem`, the bound `qcom_wdt` driver, its running watchdog feeder, and USB/SSH are recorded and correct. - Stop if any whole-disk node exists, any partition has `ro=0`, the watchdog + Stop if any partition or present whole-disk node has `ro=0`, the watchdog is not fed, USB/SSH fails, or anything asks to flash. Rollback: use the verified forced-restart procedure from step 3, then recover from the verified backup if needed. diff --git a/device/dipper/kernel.config b/device/dipper/kernel.config index 12d5c2f6d..f24173e2f 100644 --- a/device/dipper/kernel.config +++ b/device/dipper/kernel.config @@ -49,13 +49,12 @@ CONFIG_QCOM_GPI_DMA=y # against the ABL kernel limit below. CONFIG_SPI_QCOM_GENI=m -# The default image uses the bootloader's framebuffer through simpledrm, so -# keep MSM and the EA8074 panel driver as modules. This keeps the kernel under -# Dipper's ABL limit; the rescue initramfs carries them for an attended panel -# test but does not load them at boot. +# Display comes from the bootloader's framebuffer through simpledrm, not from +# the MSM display driver, so DRM_MSM stays a module. Built in it pushed the +# kernel past about 16 MiB, which this ABL refuses outright: +# Booting FAILED (remote: 'Failed to load/authenticate boot image: 00000050') +# Nothing loads it; the panel path is open work (see NOTES.md). CONFIG_DRM_MSM=m -CONFIG_DRM_PANEL_SAMSUNG_EA8074=m -CONFIG_REGULATOR_QCOM_REFGEN=m CONFIG_DRM_SIMPLEDRM=y CONFIG_SYSFB_SIMPLEFB=y diff --git a/tests/dipper-probe b/tests/dipper-probe index 92ccbaf53..20c59a792 100755 --- a/tests/dipper-probe +++ b/tests/dipper-probe @@ -17,8 +17,7 @@ assert 'OUT=${OUT:-$repo/out/dipper}' in builder assert 'modules_install' not in builder assert 'FIRMWARE_DIR' not in builder assert 'fastboot -s boot boot.img' in builder -assert 'panel-samsung-ea8074 qcom-refgen-regulator' in script -assert 'CONFIG_REGULATOR_QCOM_REFGEN=m' in Path('device/dipper/kernel.config').read_text() +assert 'panel-samsung-ea8074' not in script print('ok - Dipper initramfs patch anchors and RAM-only builder inputs') PY diff --git a/tools/dipper/initramfs-inside.sh b/tools/dipper/initramfs-inside.sh index a1d218d75..1e05779ce 100755 --- a/tools/dipper/initramfs-inside.sh +++ b/tools/dipper/initramfs-inside.sh @@ -41,15 +41,14 @@ rm -f "$stage/usr/lib/modules/$KERNEL_RELEASE/build" \ "$stage/usr/lib/modules/$KERNEL_RELEASE/source" depmod -b "$stage" "$KERNEL_RELEASE" -# Keep the watchdog module and the optional Dipper DSI test modules, with their -# dependencies. +# Keep only the watchdog module this initramfs loads, with its dependencies. # The full tree is ~1764 modules and dominates the image: with the PHYs, UFS, # i2c and simpledrm built in, almost none of it is reachable here, and ABL # refuses a boot image that grows too large. Everything else belongs in the # root filesystem, not here. The pruner reads modules.dep and fails loudly # rather than silently emptying the tree. python3 /src/tools/dipper/prune-modules.py \ - "$stage/usr/lib/modules/$KERNEL_RELEASE" qcom_wdt msm panel-samsung-ea8074 qcom-refgen-regulator + "$stage/usr/lib/modules/$KERNEL_RELEASE" qcom_wdt depmod -b "$stage" "$KERNEL_RELEASE" # The modules the init loads must exist AND match this kernel exactly, or the From fc4e1148c83c6536b0e57a50ac9db522c9dda46f Mon Sep 17 00:00:00 2001 From: quatrixone Date: Tue, 10 Nov 2026 03:51:23 +0100 Subject: [PATCH 16/22] docs(dipper): record final RAM boot verification --- device/dipper/BRINGUP-M1.md | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/device/dipper/BRINGUP-M1.md b/device/dipper/BRINGUP-M1.md index a66f1a329..ad7320971 100644 --- a/device/dipper/BRINGUP-M1.md +++ b/device/dipper/BRINGUP-M1.md @@ -1,11 +1,7 @@ # Xiaomi Mi 8 (dipper): RAM-only first light -**Status (2026-11-09):** this PR's image booted by RAM on a Xiaomi Mi 8; the -owner saw the console, USB/SSH and read-only storage gate passed, the watchdog -feeder ran. Volume Down generated `KEY_VOLUMEDOWN` on the second RAM image; -it has not been rechecked on this image. Results and the final image hash are -in [the notes PR #330]. +**Status (2026-11-10):** boot image `0ee4f11d1973085c434e741a2e9dd73af5a9cd157296c25801ed5a92a6b9e9d9` booted by RAM on a Xiaomi Mi 8 using kernel/DTS PR #220 at `055a4019998f22cc0e2a8afef7650274a6ce0657`. The root was initramfs; all 85 UFS partition flags were read-only. The `sda` sysfs disk had `ro=0`, but its `/dev/sda` node was absent; `sdb`–`sdf` were read-only. The guard confirmed this state. `qcom_wdt` and its feeder ran, simpledrm registered `fb0`, USB/SSH worked, and `/proc/iomem` reserved `0x85fc0000–0x8a8fffff`, covering the former TZ range. `reboot-to bootloader` returned the phone to fastboot without UFS writes. Physical input events were not captured on this exact image. Full results are in [the notes PR #330]. The FTS5 driver from [touch #219] is merged into linux-omarchy-mobile. The Dipper board DTS is under review in [DTS #220], and the EA8074 panel driver is under review in [panel #218]. From 737716d119afbd6e3be281655298f1e598804f5b Mon Sep 17 00:00:00 2001 From: quatrixone Date: Tue, 10 Nov 2026 09:13:35 +0100 Subject: [PATCH 17/22] dipper: pin the rescue SSH host key --- tests/dipper-probe | 2 +- tools/dipper/patch-init.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/dipper-probe b/tests/dipper-probe index 20c59a792..2215fdf87 100755 --- a/tests/dipper-probe +++ b/tests/dipper-probe @@ -33,7 +33,7 @@ with tempfile.TemporaryDirectory() as tmp: patched = init.read_text() assert 'modprobe qcom_wdt' in patched assert 'watchdog -t 5 -T 30 /dev/watchdog0' in patched - assert 'dropbear -R -E -s -p "$usb_addr:22"' in patched + assert 'dropbear -E -s -p "$usb_addr:22" -r /etc/dropbear/dropbear_ed25519_host_key' in patched assert 'no USB host; RAM-only probe will reboot in 20 s' in patched print('ok - Dipper patch step applies to the checked-in shared init') PY diff --git a/tools/dipper/patch-init.py b/tools/dipper/patch-init.py index 49328a750..c696058bd 100644 --- a/tools/dipper/patch-init.py +++ b/tools/dipper/patch-init.py @@ -17,7 +17,7 @@ ("dropbear -R -E -p 22", """usb_addr=$(ip -o -4 addr show dev usb0 scope global | awk '{ sub(/\\/.*/, "", $4); print $4; exit }') if [ -n "$usb_addr" ]; then - dropbear -R -E -s -p "$usb_addr:22" + dropbear -E -s -p "$usb_addr:22" -r /etc/dropbear/dropbear_ed25519_host_key fi""", "dropbear anchor"), ("no USB host, crashing in 20 s so ABL falls back to slot A", "no USB host; RAM-only probe will reboot in 20 s", From 829bb438d9bc61dc2b949385d2951636375b36b9 Mon Sep 17 00:00:00 2001 From: quatrixone Date: Tue, 10 Nov 2026 09:26:54 +0100 Subject: [PATCH 18/22] docs(dipper): record final NFS and RAM probes --- device/dipper/BRINGUP-M1.md | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/device/dipper/BRINGUP-M1.md b/device/dipper/BRINGUP-M1.md index ad7320971..9fbdf30a4 100644 --- a/device/dipper/BRINGUP-M1.md +++ b/device/dipper/BRINGUP-M1.md @@ -1,7 +1,9 @@ # Xiaomi Mi 8 (dipper): RAM-only first light -**Status (2026-11-10):** boot image `0ee4f11d1973085c434e741a2e9dd73af5a9cd157296c25801ed5a92a6b9e9d9` booted by RAM on a Xiaomi Mi 8 using kernel/DTS PR #220 at `055a4019998f22cc0e2a8afef7650274a6ce0657`. The root was initramfs; all 85 UFS partition flags were read-only. The `sda` sysfs disk had `ro=0`, but its `/dev/sda` node was absent; `sdb`–`sdf` were read-only. The guard confirmed this state. `qcom_wdt` and its feeder ran, simpledrm registered `fb0`, USB/SSH worked, and `/proc/iomem` reserved `0x85fc0000–0x8a8fffff`, covering the former TZ range. `reboot-to bootloader` returned the phone to fastboot without UFS writes. Physical input events were not captured on this exact image. Full results are in [the notes PR #330]. +**Status (2026-11-10):** the combined #503/#505 non-NFS image `540b5d31ea73a31ade9a8d8cb5152cf701dc3c2ad8256734790b0ef2db6dbdd0` booted by RAM on the Xiaomi Mi 8 with kernel/DTS PR #220 at `055a4019998f22cc0e2a8afef7650274a6ce0657`. Its initramfs root had all 85 UFS partition flags at `ro=1`. `/sys/block/sda/ro` was `0`, but `/dev/sda` was absent; `sdb`–`sdf` were `ro=1`. The guard confirmed this state. `qcom_wdt` and its feeder ran, simpledrm registered `fb0`, USB/SSH worked, and `/proc/iomem` reserved `0x85fc0000–0x8a8fffff`, covering the former TZ range. The pinned rescue SSH key matched, and `reboot-to` returned the phone to fastboot. Physical input events were not captured on this exact image. + +A separate RAM NFS-root run used image `a2d435a7430e7e4c145c61cdb9866d16929731859d91c7105e6bfcaf9e3e9dd7` with the rebased #503 init. BusyBox `mount` switched to the test NFS root; all six disk flags and all 85 partition flags were `ro=1`. Systemd reached the multi-user target with `RuntimeWatchdogSec=60s`, and SSH remained available. `reboot-to bootloader` returned the phone to fastboot. The exported root was a generic Arch base; this did not test the Omarchy desktop or link-loss recovery. Full results are in [the notes PR #330]. The FTS5 driver from [touch #219] is merged into linux-omarchy-mobile. The Dipper board DTS is under review in [DTS #220], and the EA8074 panel driver is under review in [panel #218]. @@ -110,7 +112,9 @@ repository; the SSH public key and generated host key stay in the local output. from `persist` with `debugfs` (read-only) before enabling that service; never mount `persist`. - The exact systemd journal line from the earlier failed `qcom_wdt` timeout - change was not retained; NFS root remains unverified. + change was not retained. The 2026-11-10 NFS test root reached systemd with + `RuntimeWatchdogSec=60s`; NFS link-loss recovery and the Omarchy desktop on + that root remain untested. - Test the FTS5 touchscreen changes and GPU rendering on the phone before marking them supported. From 454bd93219710434f23be651163024e00c351d0f Mon Sep 17 00:00:00 2001 From: quatrixone Date: Wed, 11 Nov 2026 08:32:28 +0100 Subject: [PATCH 19/22] dipper: apply final owner review notes --- device/dipper/BRINGUP-M1.md | 26 ++++++++++++++------------ docs/DEVICES.md | 2 +- tests/dipper-probe | 3 ++- tools/dipper/build | 6 +++++- tools/dipper/initramfs-inside.sh | 8 ++++---- tools/dipper/patch-init.py | 2 +- 6 files changed, 27 insertions(+), 20 deletions(-) diff --git a/device/dipper/BRINGUP-M1.md b/device/dipper/BRINGUP-M1.md index 9fbdf30a4..43013617c 100644 --- a/device/dipper/BRINGUP-M1.md +++ b/device/dipper/BRINGUP-M1.md @@ -27,17 +27,18 @@ intended handset's serial, `BACKUP_CHECKSUMS` to the locally held stock partition manifest, and `USERDATA_BACKUP_CHECKSUMS` to the private userdata archive's checksum file. Do not boot if either backup is missing or fails. -1. **Backup gate** — Expect: the verified 84-partition stock backup and - checksum manifests and the userdata archive are available off-device. Pass: both +1. **Backup gate** — Expect: the verified backup of the installed system's 84 + non-userdata GPT partitions, both checksum manifests, and the userdata archive + are available off-device. Pass: both `sha256sum -c "$BACKUP_CHECKSUMS"` and `sha256sum -c "$USERDATA_BACKUP_CHECKSUMS"` report every entry OK (run each from the directory containing its manifest). The userdata archive is a live file-level copy, not a raw partition image or an atomic snapshot. Stop: any - missing or mismatched entry. Rollback: restore the verified stock backup - using the device recovery procedure. Risk: an unverified backup cannot - recover a damaged single-slot phone. + missing or mismatched entry. Rollback: do not boot; there is no reviewed + restore procedure yet, and nothing in this runbook writes UFS. Risk: an + unverified backup cannot recover a damaged single-slot phone. 2. **Fastboot gate** — Enter fastboot with **Volume Down + Power**; the §3.1 - entry is in [PR #499](https://github.com/derekross/omarchy-mobile/pull/499). + entry is in [CONTRIBUTING.md §3.1](../../CONTRIBUTING.md#phones-without-ab-slots). Run `fastboot -s "$FASTBOOT_SERIAL" getvar product` and `fastboot -s "$FASTBOOT_SERIAL" getvar unlocked`. Expect `dipper` and `yes`. Pass: exactly one device is listed, both values match, and the serial pins @@ -102,7 +103,8 @@ repository; the SSH public key and generated host key stay in the local output. ## What remains - Do not flash until there is a reviewed, device-specific recovery plan and a - verified stock backup. This PR deliberately adds no persistent writer. + verified backup of the installed system. This PR deliberately adds no + persistent writer. - The initramfs has no Arch root yet. A later hard NFS-root mount can freeze the root session if the host drops; use it only for a RAM-only probe. NFS-root needs a root with `RuntimeWatchdogSec=60s`, because `kill -9 -1` stops the @@ -119,12 +121,12 @@ repository; the SSH public key and generated host key stay in the local output. marking them supported. From this rescue image, an SSH session can return to fastboot with -`reboot-to bootloader`. The stock `recovery` image was verified from its -4.9.337 kernel header, but recovery-mode reboot was not tested; this runbook +`reboot-to bootloader`. The installed ROM's `recovery` image was verified from +its 4.9.337 kernel header, but recovery-mode reboot was not tested; this runbook uses only the verified bootloader path. The helper asks the PMIC reboot-mode -driver to select the bootloader and writes no UFS partition. The PMIC reset path was verified on -the handset on 2026-11-09. The packaged helper returned the running image to -fastboot on 2026-11-09 without writing UFS. +driver to select the bootloader and writes no UFS partition. The PMIC reset path +was verified on the handset on 2026-11-09. The packaged helper returned the +running image to fastboot on 2026-11-09 without writing UFS. [panel #218]: https://github.com/derekross/linux-omarchy-mobile/pull/218 [touch #219]: https://github.com/derekross/linux-omarchy-mobile/pull/219 diff --git a/docs/DEVICES.md b/docs/DEVICES.md index 921c17dbe..72a8a94b9 100644 --- a/docs/DEVICES.md +++ b/docs/DEVICES.md @@ -78,7 +78,7 @@ Devices we'd like to support, with the closest starting point. Open an issue to | Pixel 11 Pro, 11 Pro XL, 11 Pro Fold | grizzly, kodiak, yogi | malibu (Tensor G6) | stock facts, contributors welcome: 11 Pro ([#26](https://github.com/derekross/omarchy-mobile/issues/26)), 11 Pro XL ([#199](https://github.com/derekross/omarchy-mobile/issues/199), [notes](../device/kodiak/NOTES.md)), 11 Pro Fold ([#40](https://github.com/derekross/omarchy-mobile/issues/40)) | | Pixel 4 | flame | SM8150 (Snapdragon 855) | **WIP, community port**, in the matrix above: the RAM-only first-light probe is merged ([BRINGUP-M1](../device/flame/BRINGUP-M1.md)); the native install is in review, split out of [#17](https://github.com/derekross/omarchy-mobile/pull/17) into [#55](https://github.com/derekross/omarchy-mobile/pull/55), [#56](https://github.com/derekross/omarchy-mobile/pull/56), [#58](https://github.com/derekross/omarchy-mobile/pull/58) and [#59](https://github.com/derekross/omarchy-mobile/pull/59) | | Pixel 4 XL | coral | SM8150 (Snapdragon 855) | **WIP, community port**, in the matrix above: bring-up notes merged ([#52](https://github.com/derekross/omarchy-mobile/pull/52): [BRINGUP-M1](../device/coral/BRINGUP-M1.md), [NOTES](../device/coral/NOTES.md)), with companion kernel/userspace sources ([omarchy-mobile-coral v0.2.3](https://github.com/HemangKumawat/omarchy-mobile-coral/tree/v0.2.3)); slot-B installer and `CONTRIBUTING.md` §3.1 entry still to land | -| Xiaomi Mi 8 | dipper | SDM845 | **WIP, RAM-only probe under review:** [#505](https://github.com/derekross/omarchy-mobile/pull/505); notes await [#330](https://github.com/derekross/omarchy-mobile/pull/330). Kernel series: [#218](https://github.com/derekross/linux-omarchy-mobile/pull/218), [#219](https://github.com/derekross/linux-omarchy-mobile/pull/219), [#220](https://github.com/derekross/linux-omarchy-mobile/pull/220) | +| Xiaomi Mi 8 | dipper | SDM845 | **WIP, community port:** the RAM-only first-light probe is merged ([BRINGUP-M1](../device/dipper/BRINGUP-M1.md)); single-slot, no install path yet. Kernel: touch [#219](https://github.com/derekross/linux-omarchy-mobile/pull/219) merged, board DTS [#220](https://github.com/derekross/linux-omarchy-mobile/pull/220) and panel [#218](https://github.com/derekross/linux-omarchy-mobile/pull/218) in review. Notes await [#330](https://github.com/derekross/omarchy-mobile/pull/330) | | POCO F3 | alioth | SM8250 (Snapdragon 870) | the first non-Pixel port: a guarded installer and root image in review ([#25](https://github.com/derekross/omarchy-mobile/pull/25)) | | OnePlus 13 | dodge | SM8750 (Snapdragon 8 Elite) | **WIP, community port**, in the matrix above: device files, notes and the qcom-abl boot images merged ([#111](https://github.com/derekross/omarchy-mobile/pull/111)); its kernel stays in the contributor's fork ([mrlund/linux-omarchy-mobile `dodge-v3-20261101`](https://github.com/mrlund/linux-omarchy-mobile/tree/dodge-v3-20261101); [kernel #115](https://github.com/derekross/linux-omarchy-mobile/pull/115) closed: the SoC series is out of this tree's scope); the guarded installer follows in a later pull request | | OnePlus 6 | enchilada | SDM845 (Snapdragon 845) | **WIP, community port: [#432](https://github.com/derekross/omarchy-mobile/issues/432)**, in the matrix above: descriptor and notes; RAM-only (`fastboot boot`) until the slot-B install and its CONTRIBUTING.md §3.1 entry are agreed; `omamobile images` packs its header-v0 boot image, and its `UFS_RW_LUNS=sde` (the guard's second-LUN list, #530) comes with the slot-B install | diff --git a/tests/dipper-probe b/tests/dipper-probe index 2215fdf87..be333ee44 100755 --- a/tests/dipper-probe +++ b/tests/dipper-probe @@ -30,10 +30,11 @@ with tempfile.TemporaryDirectory() as tmp: init = Path(tmp) / 'init' init.write_bytes(Path('initramfs/init').read_bytes()) subprocess.run(['python3', 'tools/dipper/patch-init.py', str(init)], check=True) + subprocess.run(['sh', '-n', str(init)], check=True) patched = init.read_text() assert 'modprobe qcom_wdt' in patched assert 'watchdog -t 5 -T 30 /dev/watchdog0' in patched - assert 'dropbear -E -s -p "$usb_addr:22" -r /etc/dropbear/dropbear_ed25519_host_key' in patched + assert 'dropbear -E -s -p "$usb_addr:22" -r /etc/dropbear/dropbear_ed25519_host_key && say "ssh: root@$usb_addr"' in patched assert 'no USB host; RAM-only probe will reboot in 20 s' in patched print('ok - Dipper patch step applies to the checked-in shared init') PY diff --git a/tools/dipper/build b/tools/dipper/build index 823581c1f..63725f877 100755 --- a/tools/dipper/build +++ b/tools/dipper/build @@ -45,7 +45,11 @@ tar --zstd -xf "$KERNEL_OUT/modules-$release.tar.zst" -C "$mods/lib/modules" echo "building the initramfs in $ALPINE (linux/arm64)" docker run --rm --platform linux/arm64 \ - -v "$repo:/src:ro" -v "$mods:/modules:ro" -v "$SSH_PUBKEY:/input/key.pub:ro" \ + -v "$repo/initramfs/init:/input/init:ro" \ + -v "$repo/tools/dipper/prune-modules.py:/input/prune-modules.py:ro" \ + -v "$repo/tools/dipper/patch-init.py:/input/patch-init.py:ro" \ + -v "$repo/packages/omamobile-device-cheetah/src/reboot-to.c:/input/reboot-to.c:ro" \ + -v "$mods:/modules:ro" -v "$SSH_PUBKEY:/input/key.pub:ro" \ -v "$OUT:/out" \ -e "KERNEL_RELEASE=$release" -e "OUT_UID=$(id -u)" -e "OUT_GID=$(id -g)" \ -e "OMAMOBILE_NFSROOT=${OMAMOBILE_NFSROOT:-}" \ diff --git a/tools/dipper/initramfs-inside.sh b/tools/dipper/initramfs-inside.sh index 1e05779ce..96f70c870 100755 --- a/tools/dipper/initramfs-inside.sh +++ b/tools/dipper/initramfs-inside.sh @@ -47,7 +47,7 @@ depmod -b "$stage" "$KERNEL_RELEASE" # refuses a boot image that grows too large. Everything else belongs in the # root filesystem, not here. The pruner reads modules.dep and fails loudly # rather than silently emptying the tree. -python3 /src/tools/dipper/prune-modules.py \ +python3 /input/prune-modules.py \ "$stage/usr/lib/modules/$KERNEL_RELEASE" qcom_wdt depmod -b "$stage" "$KERNEL_RELEASE" @@ -59,8 +59,8 @@ for module in qcom_wdt; do echo "module $module does not match $KERNEL_RELEASE" >&2; exit 1; } done -cp /src/initramfs/init "$stage/init" -python3 /src/tools/dipper/patch-init.py "$stage/init" +cp /input/init "$stage/init" +python3 /input/patch-init.py "$stage/init" chmod 755 "$stage/init" echo xiaomi,dipper > "$stage/etc/omamobile-compatible" @@ -76,7 +76,7 @@ fi echo 'Xiaomi Mi 8 Omarchy' > "$stage/etc/omamobile-usb-product" gcc -Os -static -o "$stage/usr/local/bin/reboot-to" \ - /src/packages/omamobile-device-cheetah/src/reboot-to.c + /input/reboot-to.c # Prove the packaged userspace actually runs on ARM before shipping it. chroot "$stage" /bin/busybox true diff --git a/tools/dipper/patch-init.py b/tools/dipper/patch-init.py index c696058bd..6ae245e1c 100644 --- a/tools/dipper/patch-init.py +++ b/tools/dipper/patch-init.py @@ -17,7 +17,7 @@ ("dropbear -R -E -p 22", """usb_addr=$(ip -o -4 addr show dev usb0 scope global | awk '{ sub(/\\/.*/, "", $4); print $4; exit }') if [ -n "$usb_addr" ]; then - dropbear -E -s -p "$usb_addr:22" -r /etc/dropbear/dropbear_ed25519_host_key + dropbear -E -s -p "$usb_addr:22" -r /etc/dropbear/dropbear_ed25519_host_key && say "ssh: root@$usb_addr" fi""", "dropbear anchor"), ("no USB host, crashing in 20 s so ABL falls back to slot A", "no USB host; RAM-only probe will reboot in 20 s", From c4238abc521823344a9029a7f0528480872d6dbe Mon Sep 17 00:00:00 2001 From: quatrixone Date: Wed, 11 Nov 2026 18:39:23 +0100 Subject: [PATCH 20/22] device/dipper: link merged bring-up notes --- device/dipper/BRINGUP-M1.md | 5 ++--- docs/DEVICES.md | 2 +- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/device/dipper/BRINGUP-M1.md b/device/dipper/BRINGUP-M1.md index 43013617c..4486a4c80 100644 --- a/device/dipper/BRINGUP-M1.md +++ b/device/dipper/BRINGUP-M1.md @@ -3,11 +3,11 @@ **Status (2026-11-10):** the combined #503/#505 non-NFS image `540b5d31ea73a31ade9a8d8cb5152cf701dc3c2ad8256734790b0ef2db6dbdd0` booted by RAM on the Xiaomi Mi 8 with kernel/DTS PR #220 at `055a4019998f22cc0e2a8afef7650274a6ce0657`. Its initramfs root had all 85 UFS partition flags at `ro=1`. `/sys/block/sda/ro` was `0`, but `/dev/sda` was absent; `sdb`–`sdf` were `ro=1`. The guard confirmed this state. `qcom_wdt` and its feeder ran, simpledrm registered `fb0`, USB/SSH worked, and `/proc/iomem` reserved `0x85fc0000–0x8a8fffff`, covering the former TZ range. The pinned rescue SSH key matched, and `reboot-to` returned the phone to fastboot. Physical input events were not captured on this exact image. -A separate RAM NFS-root run used image `a2d435a7430e7e4c145c61cdb9866d16929731859d91c7105e6bfcaf9e3e9dd7` with the rebased #503 init. BusyBox `mount` switched to the test NFS root; all six disk flags and all 85 partition flags were `ro=1`. Systemd reached the multi-user target with `RuntimeWatchdogSec=60s`, and SSH remained available. `reboot-to bootloader` returned the phone to fastboot. The exported root was a generic Arch base; this did not test the Omarchy desktop or link-loss recovery. Full results are in [the notes PR #330]. +A separate RAM NFS-root run used image `a2d435a7430e7e4c145c61cdb9866d16929731859d91c7105e6bfcaf9e3e9dd7` with the rebased #503 init. BusyBox `mount` switched to the test NFS root; all six disk flags and all 85 partition flags were `ro=1`. Systemd reached the multi-user target with `RuntimeWatchdogSec=60s`, and SSH remained available. `reboot-to bootloader` returned the phone to fastboot. The exported root was a generic Arch base; this did not test the Omarchy desktop or link-loss recovery. Full results are in [NOTES.md]. The FTS5 driver from [touch #219] is merged into linux-omarchy-mobile. The Dipper board DTS is under review in [DTS #220], and the EA8074 panel driver is under review in [panel #218]. -The EA8074 panel test is recorded in [the notes PR #330]. The FTS5 touchscreen +The EA8074 panel test is recorded in [NOTES.md]. The FTS5 touchscreen still needs a hardware test. On 2026-11-09, a guarded RAM boot was used to capture all 84 GPT partitions other than `userdata` (the phone has no `super`); source and compressed-image @@ -131,4 +131,3 @@ running image to fastboot on 2026-11-09 without writing UFS. [panel #218]: https://github.com/derekross/linux-omarchy-mobile/pull/218 [touch #219]: https://github.com/derekross/linux-omarchy-mobile/pull/219 [DTS #220]: https://github.com/derekross/linux-omarchy-mobile/pull/220 -[the notes PR #330]: https://github.com/derekross/omarchy-mobile/pull/330 diff --git a/docs/DEVICES.md b/docs/DEVICES.md index 72a8a94b9..f781678ce 100644 --- a/docs/DEVICES.md +++ b/docs/DEVICES.md @@ -78,7 +78,7 @@ Devices we'd like to support, with the closest starting point. Open an issue to | Pixel 11 Pro, 11 Pro XL, 11 Pro Fold | grizzly, kodiak, yogi | malibu (Tensor G6) | stock facts, contributors welcome: 11 Pro ([#26](https://github.com/derekross/omarchy-mobile/issues/26)), 11 Pro XL ([#199](https://github.com/derekross/omarchy-mobile/issues/199), [notes](../device/kodiak/NOTES.md)), 11 Pro Fold ([#40](https://github.com/derekross/omarchy-mobile/issues/40)) | | Pixel 4 | flame | SM8150 (Snapdragon 855) | **WIP, community port**, in the matrix above: the RAM-only first-light probe is merged ([BRINGUP-M1](../device/flame/BRINGUP-M1.md)); the native install is in review, split out of [#17](https://github.com/derekross/omarchy-mobile/pull/17) into [#55](https://github.com/derekross/omarchy-mobile/pull/55), [#56](https://github.com/derekross/omarchy-mobile/pull/56), [#58](https://github.com/derekross/omarchy-mobile/pull/58) and [#59](https://github.com/derekross/omarchy-mobile/pull/59) | | Pixel 4 XL | coral | SM8150 (Snapdragon 855) | **WIP, community port**, in the matrix above: bring-up notes merged ([#52](https://github.com/derekross/omarchy-mobile/pull/52): [BRINGUP-M1](../device/coral/BRINGUP-M1.md), [NOTES](../device/coral/NOTES.md)), with companion kernel/userspace sources ([omarchy-mobile-coral v0.2.3](https://github.com/HemangKumawat/omarchy-mobile-coral/tree/v0.2.3)); slot-B installer and `CONTRIBUTING.md` §3.1 entry still to land | -| Xiaomi Mi 8 | dipper | SDM845 | **WIP, community port:** the RAM-only first-light probe is merged ([BRINGUP-M1](../device/dipper/BRINGUP-M1.md)); single-slot, no install path yet. Kernel: touch [#219](https://github.com/derekross/linux-omarchy-mobile/pull/219) merged, board DTS [#220](https://github.com/derekross/linux-omarchy-mobile/pull/220) and panel [#218](https://github.com/derekross/linux-omarchy-mobile/pull/218) in review. Notes await [#330](https://github.com/derekross/omarchy-mobile/pull/330) | +| Xiaomi Mi 8 | dipper | SDM845 | **WIP, community port:** the RAM-only first-light probe is merged ([BRINGUP-M1](../device/dipper/BRINGUP-M1.md), [NOTES](../device/dipper/NOTES.md)); single-slot, no install path yet. Kernel: touch [#219](https://github.com/derekross/linux-omarchy-mobile/pull/219) merged, board DTS [#220](https://github.com/derekross/linux-omarchy-mobile/pull/220) and panel [#218](https://github.com/derekross/linux-omarchy-mobile/pull/218) in review. | | POCO F3 | alioth | SM8250 (Snapdragon 870) | the first non-Pixel port: a guarded installer and root image in review ([#25](https://github.com/derekross/omarchy-mobile/pull/25)) | | OnePlus 13 | dodge | SM8750 (Snapdragon 8 Elite) | **WIP, community port**, in the matrix above: device files, notes and the qcom-abl boot images merged ([#111](https://github.com/derekross/omarchy-mobile/pull/111)); its kernel stays in the contributor's fork ([mrlund/linux-omarchy-mobile `dodge-v3-20261101`](https://github.com/mrlund/linux-omarchy-mobile/tree/dodge-v3-20261101); [kernel #115](https://github.com/derekross/linux-omarchy-mobile/pull/115) closed: the SoC series is out of this tree's scope); the guarded installer follows in a later pull request | | OnePlus 6 | enchilada | SDM845 (Snapdragon 845) | **WIP, community port: [#432](https://github.com/derekross/omarchy-mobile/issues/432)**, in the matrix above: descriptor and notes; RAM-only (`fastboot boot`) until the slot-B install and its CONTRIBUTING.md §3.1 entry are agreed; `omamobile images` packs its header-v0 boot image, and its `UFS_RW_LUNS=sde` (the guard's second-LUN list, #530) comes with the slot-B install | From 2d67708e07728b13b5d2a9eda299ace8a1608163 Mon Sep 17 00:00:00 2001 From: quatrixone Date: Wed, 11 Nov 2026 19:18:49 +0100 Subject: [PATCH 21/22] device/dipper: fix initramfs container mounts Signed-off-by: quatrixone --- tests/dipper-probe | 7 ++++++- tools/dipper/build | 3 ++- tools/dipper/patch-init.py | 7 ++++--- 3 files changed, 12 insertions(+), 5 deletions(-) diff --git a/tests/dipper-probe b/tests/dipper-probe index be333ee44..033977958 100755 --- a/tests/dipper-probe +++ b/tests/dipper-probe @@ -18,6 +18,10 @@ assert 'modules_install' not in builder assert 'FIRMWARE_DIR' not in builder assert 'fastboot -s boot boot.img' in builder assert 'panel-samsung-ea8074' not in script +for path in ('init', 'prune-modules.py', 'patch-init.py', 'initramfs-inside.sh', + 'reboot-to.c', 'key.pub'): + assert f':/input/{path}:ro' in builder, f'missing read-only container mount for /input/{path}' +assert 'sh /input/initramfs-inside.sh' in builder print('ok - Dipper initramfs patch anchors and RAM-only builder inputs') PY @@ -34,7 +38,8 @@ with tempfile.TemporaryDirectory() as tmp: patched = init.read_text() assert 'modprobe qcom_wdt' in patched assert 'watchdog -t 5 -T 30 /dev/watchdog0' in patched - assert 'dropbear -E -s -p "$usb_addr:22" -r /etc/dropbear/dropbear_ed25519_host_key && say "ssh: root@$usb_addr"' in patched + assert 'dropbear -E -s -p "$usb_addr:22" -r /etc/dropbear/dropbear_ed25519_host_key 2>/dev/null && say "ssh: root@$usb_addr"' in patched + assert 'dropbear -R -E -p 22 2>/dev/null && say "ssh: root@172.16.42.1"' not in patched assert 'no USB host; RAM-only probe will reboot in 20 s' in patched print('ok - Dipper patch step applies to the checked-in shared init') PY diff --git a/tools/dipper/build b/tools/dipper/build index 63725f877..3bf10e30e 100755 --- a/tools/dipper/build +++ b/tools/dipper/build @@ -48,12 +48,13 @@ docker run --rm --platform linux/arm64 \ -v "$repo/initramfs/init:/input/init:ro" \ -v "$repo/tools/dipper/prune-modules.py:/input/prune-modules.py:ro" \ -v "$repo/tools/dipper/patch-init.py:/input/patch-init.py:ro" \ + -v "$repo/tools/dipper/initramfs-inside.sh:/input/initramfs-inside.sh:ro" \ -v "$repo/packages/omamobile-device-cheetah/src/reboot-to.c:/input/reboot-to.c:ro" \ -v "$mods:/modules:ro" -v "$SSH_PUBKEY:/input/key.pub:ro" \ -v "$OUT:/out" \ -e "KERNEL_RELEASE=$release" -e "OUT_UID=$(id -u)" -e "OUT_GID=$(id -g)" \ -e "OMAMOBILE_NFSROOT=${OMAMOBILE_NFSROOT:-}" \ - "$ALPINE" sh /src/tools/dipper/initramfs-inside.sh + "$ALPINE" sh /input/initramfs-inside.sh # Pack a copy of the DTB so nothing we do can dirty the kernel tree. packdtb=$OUT/sdm845-xiaomi-dipper.dtb diff --git a/tools/dipper/patch-init.py b/tools/dipper/patch-init.py index 6ae245e1c..a2e1b46f3 100644 --- a/tools/dipper/patch-init.py +++ b/tools/dipper/patch-init.py @@ -14,11 +14,12 @@ fi hostname omamobile """, "hostname anchor"), - ("dropbear -R -E -p 22", + ('dropbear -R -E -p 22 2>/dev/null && say "ssh: root@172.16.42.1"\n', """usb_addr=$(ip -o -4 addr show dev usb0 scope global | awk '{ sub(/\\/.*/, "", $4); print $4; exit }') if [ -n "$usb_addr" ]; then - dropbear -E -s -p "$usb_addr:22" -r /etc/dropbear/dropbear_ed25519_host_key && say "ssh: root@$usb_addr" -fi""", "dropbear anchor"), + dropbear -E -s -p "$usb_addr:22" -r /etc/dropbear/dropbear_ed25519_host_key 2>/dev/null && say "ssh: root@$usb_addr" +fi +""", "dropbear anchor"), ("no USB host, crashing in 20 s so ABL falls back to slot A", "no USB host; RAM-only probe will reboot in 20 s", "no-USB recovery message"), From 5d917b4b198f454123f2ac029a665325e2262288 Mon Sep 17 00:00:00 2001 From: quatrixone Date: Wed, 11 Nov 2026 19:46:32 +0100 Subject: [PATCH 22/22] device/dipper: record current RAM boot Signed-off-by: quatrixone --- device/dipper/NOTES.md | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/device/dipper/NOTES.md b/device/dipper/NOTES.md index 3a0ec67dd..50f49859f 100644 --- a/device/dipper/NOTES.md +++ b/device/dipper/NOTES.md @@ -9,6 +9,7 @@ the facts needed for review. | Date | `boot.img` SHA-256 | Source, as recorded | `/dev/sda` and UFS partitions | Checks and gaps | | --- | --- | --- | --- | --- | +| 2026-11-11 | `665fcbd682cd8e64b3ffec1ff7f4ab9ca33a26b9b47b11073be7a3c267abf2b1` | #505 `2d67708e07728b13b5d2a9eda299ace8a1608163`; kernel/DTS #220 `26aa77c317cd029d16e58890c532562ca275c9f0` | Node absent, disk `ro=0`; all 85 partitions `ro=1`; `sdb`–`sdf` `ro=1` | `uname -r` `7.3.0-rc6-omamobile-push1`; `qcom_wdt` bound and feeder running; simpledrm fb0, USB/SSH and reserved `0x85fc0000–0x8a8fffff` passed. Physical screen, keys, touch, GPU and Wi-Fi not tested. RAM boot only; no UFS write. | | 2026-11-10 | `540b5d31ea73a31ade9a8d8cb5152cf701dc3c2ad8256734790b0ef2db6dbdd0` | Combined #503/#505; kernel/DTS #220 `055a4019998f22cc0e2a8afef7650274a6ce0657` | Node absent, disk `ro=0`; all 85 partitions `ro=1`; `sdb`–`sdf` `ro=1` | Watchdog/feeder, simpledrm, USB/SSH, reserved TZ range, pinned host key and `reboot-to bootloader` passed; physical keys not captured. | | 2026-11-10 | `a2d435a7430e7e4c145c61cdb9866d16929731859d91c7105e6bfcaf9e3e9dd7` | Rebased #503 NFS image with #220 `055a4019998f22cc0e2a8afef7650274a6ce0657` | `/dev/sda` present, set `ro=1`; six disks and all 85 partitions read back `ro=1` | `uname`, NFS root, multi-user systemd, watchdog and SSH passed; generic Arch test root only; link-loss recovery and Omarchy desktop untested. | | 2026-11-10 | `0ee4f11d1973085c434e741a2e9dd73af5a9cd157296c25801ed5a92a6b9e9d9` | #505 `994944d7ecbacd69444221e6951153cb329a374e`; kernel/DTS #220 `055a4019998f22cc0e2a8afef7650274a6ce0657` | Node absent, disk `ro=0`; all 85 partitions `ro=1`; `sdb`–`sdf` `ro=1` | Watchdog/feeder, framebuffer, USB/SSH, reserved TZ range and `reboot-to` passed; physical keys not captured. | @@ -26,6 +27,21 @@ name list. The retained backup and kernel records cover 84 non-userdata GPT partitions plus `userdata`; the other seven names cannot be identified from the retained artifacts and remain unknown. +## 2026-11-11 — rebuilt #505 RAM image + +Built and booted `boot.img` SHA-256 +`665fcbd682cd8e64b3ffec1ff7f4ab9ca33a26b9b47b11073be7a3c267abf2b1` with +`fastboot boot` from #505 `2d67708e07728b13b5d2a9eda299ace8a1608163` and +kernel/DTS #220 `26aa77c317cd029d16e58890c532562ca275c9f0`. `uname -r` was +`7.3.0-rc6-omamobile-push1`. The `/dev/sda` whole-disk node was absent; its +sysfs flag remained `ro=0`. Nodes `/dev/sdb`–`/dev/sdf` were present with +`ro=1`; all 85 partition flags were `ro=1`, and `ufs-ro` logged the guard for +each. `qcom_wdt` was bound and the watchdog feeder was running. simpledrm +registered `fb0`; authenticated USB SSH worked. `/proc/iomem` reserved +`0x85fc0000–0x8a8fffff`, including the former TZ range. The physical screen, +keys, touch, GPU rendering and Wi-Fi were not tested in this run. Only +`fastboot boot` was used; no UFS partition was written. + ## 2026-11-10 — final PR #505 RAM image Booted image SHA-256 `0ee4f11d1973085c434e741a2e9dd73af5a9cd157296c25801ed5a92a6b9e9d9` with `fastboot boot`; it was built from PR #505 head `994944d7ecbacd69444221e6951153cb329a374e` and kernel/DTS PR #220 head `055a4019998f22cc0e2a8afef7650274a6ce0657` (touch PR #219 is merged). `uname -r` was `7.3.0-rc6-omamobile-push1`; `/` was the initramfs (`rootfs`). The guard reported the UFS devices read-only. Sysfs showed six disks: `sda` had `ro=0` but its whole-disk `/dev/sda` node was absent; `sdb`–`sdf` each had `ro=1` and present nodes. All 85 partitions had `ro=1`. This matches PR #505's intended missing-node case for `sda`; no UFS write was attempted.