diff --git a/device/dipper/BRINGUP-M1.md b/device/dipper/BRINGUP-M1.md index 012f1070c..387cd7f6a 100644 --- a/device/dipper/BRINGUP-M1.md +++ b/device/dipper/BRINGUP-M1.md @@ -1,14 +1,35 @@ # Xiaomi Mi 8 (dipper): RAM-only first light -**Status (2026-11-12):** the newest RAM boot used the Dipper FTS5 node enabled directly in a local kernel tree. `stmfts` registered as `event2`; the screen was not visually verified, and no physical touch was captured on that boot. The preceding corrected overlay boot captured contact, changing X/Y and release. All recorded UFS partition flags were read-only, `/dev/sda` was absent, and `0x85fc0000–0x8a8fffff` remained reserved. No UFS partition was written. Rebuildable kernel DTS and repository overlay sources are now proposed in kernel PR #249 and this PR; the test images predate those commits. Earlier boots are recorded in [NOTES.md]. +**Status (2026-11-18):** a fresh Omarchy 4.5.0-3 NFS root runs on the phone +with `omamobile-omarchy 0.1.45`. Two phone smoke runs confirmed the USB link, +display connector and all UFS disks read-only. Both found no render node, no +multitouch input, and no Hyprland or shell session. Firstboot with the 0.1.8 +service-enable change reached user setup, but UFW failed because the NFS root +had modules for a different kernel release. Matching modules are now in the +disposable root; a phone reboot and smoke test with them are pending. The NFS +journal later showed the graphical target and SDDM session starting, without +visual confirmation or a captured renderer. A rescue framebuffer was +unblanked, but that result was also not visually confirmed. Exact evidence +and limits are in [NOTES.md]. No persistent image was flashed; the descriptor +and installer still have no Dipper install path. + +**Status (2026-11-15):** a RAM-only `fastboot boot` reached the Omarchy 4.5.0-3 NFS root with `omamobile-omarchy 0.1.45`. Its journal records the handoff, the UFS guard setting all six whole-disk nodes and all 85 partitions read-only, both packed-DTB `removed-region` nodes, the initramfs guard, and the `qcom_wdt` device; direct UFS `ro` readback was not captured. In a later 20-second-watchdog NFS retry, `/proc/iomem` showed `0x85fc0000–0x8a8fffff` reserved and `networkctl status usb0` reported routable/configured. Systemd was still `initializing`; it did not reach multi-user, and `tools/phone-smoke`, watchdog feeder state, direct UFS `ro` readback and the visible screen remain unverified. The phone later returned to the existing ext4 root. The 60-second setting was rejected by the driver, so the package now uses 30 seconds (driver maximum 31); a fresh boot with that packaged setting remains unverified. The diagnostic root used volatile journals and temporary early-SSH wiring; those changes are not in the package. No flash or explicit UFS-write command was issued. Image hash, source commits and evidence limits are in [NOTES.md]. + +**Previous status (2026-11-14):** a fresh rootfs was built with Omarchy 4.5.0-3 and `omamobile-omarchy 0.1.45`; all build-time rootfs smoke checks passed. The Dipper kernel and EA8074 panel module also built. A RAM-only NFS test did not reach that new root: a later SSH session reported the existing kernel (`g2a318a96ae9d-dirty`) and an `ext4` root. `reboot-to bootloader` returned the phone to fastboot. The test image showed no firstboot log or created test account. `/proc/iomem`, UFS read-only flags, `tools/phone-smoke`, `networkctl status usb0` and the visible desktop were not captured. No flash command was issued; incidental userdata writes by the existing ext4 system could not be ruled out. Earlier RAM boots and test limits are recorded in [NOTES.md]. + +A retry of image `d7bdde5e35b5c78a5878ebf4df28effefca35bed9a26c39098f473278d233ead` was accepted by `fastboot boot`, but the host saw no ARP reply and a 10-second capture contained no SSH, RPC or NFS packets. The root handoff remains unverified. The exported image was checked on the host: it has Omarchy 4.5.0-3, `omamobile-omarchy 0.1.45`, `omamobile-device-dipper 0.1.0`, all seven runtime dependencies and 375 package-owned `/usr/lib/systemd/system/*.service` files; the three old unowned units and WLAN helper are absent. No phone-side `phone-smoke`, `networkctl status usb0`, `/proc/iomem`, UFS flags or display observation could be collected from this boot. No flash or explicit UFS-write command was issued; with the running root unknown, incidental writes cannot be ruled out. + +Before that retry, the 84-partition read-only backup was revalidated and `userdata` was recaptured to a private off-repository file archive from an ext4 mount using `ro,noload`. GNU tar preserved numeric ownership, modes, sparse files, ACLs and xattrs; zstd integrity and a full tar listing passed. This supersedes the older possibly stale userdata archive. It is a file-level, non-atomic archive, not a raw partition 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 [NOTES.md]. The FTS5 driver from [touch #219] is merged into linux-omarchy-mobile. The Dipper board DTS from [DTS #220] is merged too (2026-11-11), and the EA8074 panel driver is under review in [panel #218]. -The EA8074 panel test and the corrected FTS5 touchscreen hardware test are -recorded in [NOTES.md]. Both used RAM boots; no UFS partition was written. +The EA8074 panel test is recorded in [NOTES.md]. The FTS5 touchscreen +registered and physical taps produced touch events on 2026-11-13; see +[NOTES.md]. End-to-end touch use in a visible Omarchy session remains +unverified. 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 @@ -59,7 +80,8 @@ 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. - Before booting, decompile the exact packed DTB on the laptop with + **Pre-boot DTB check:** before running `fastboot boot`, decompile the exact + packed DTB on the laptop with `dtc -I dtb -O dts` and verify it contains both `removed-region@86200000` and `removed-region@89100000`. On the phone, before touching the screen or doing any other test, verify @@ -113,16 +135,21 @@ repository; the SSH public key and generated host key stay in the local output. 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 - userspace feeder before systemd can take over. It must never fall through to - writable userdata. + must configure systemd's hardware watchdog within the kernel driver's limit. + The Dipper `qcom_wdt` driver's `0xFFFFF` tick limit at 32764 Hz gives a + maximum timeout of 31 seconds. Systemd rejected 60 seconds in the + 2026-11-15 test; the package now uses 30 seconds for both runtime and reboot + watchdogs. A fresh boot with that packaged setting still needs verification. + 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`. -- The exact systemd journal line from the earlier failed `qcom_wdt` timeout - 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. +- The 2026-11-15 test journal records + `Failed to set watchdog hardware timeout to 1min: Invalid argument` with + `RuntimeWatchdogSec=60s`; udev also timed out before SSH became available. + The earlier 2026-11-10 NFS test used `RuntimeWatchdogSec=20s` and reached + multi-user. NFS link-loss recovery and the Omarchy desktop on the current + Omarchy root remain untested. - FTS5 controller probe and physical contact/coordinate/release events passed on 2026-11-12 (see [NOTES.md]); Hyprland input delivery and GPU rendering remain untested on the phone. diff --git a/device/dipper/NOTES.md b/device/dipper/NOTES.md index 838b0c8e7..b0cfadad0 100644 --- a/device/dipper/NOTES.md +++ b/device/dipper/NOTES.md @@ -5,10 +5,301 @@ Facts only, each read off the phone. Captures remain outside the repository because they contain device identifiers and Wi-Fi keys; this file records only the facts needed for review. +## 2026-11-18 — NFS firstboot and matching modules + +The current NFS boot ran `omamobile-firstboot` past the repeated service-enable +calls after version 0.1.8 changed them to `systemctl enable --no-reload`. The +run reached user setup, but its services/firewall step failed when UFW's +`iptables` could not create an nftables ruleset (`Could not fetch rule set +generation id: Invalid argument`). The journal records networkd and sshd +starting; a fresh phone-side smoke report and a stable SSH session were not +captured. + +The booted kernel release was `7.3.0-rc6-omamobile-push1-gf61e96519032`, while +the disposable root initially contained modules only for +`7.3.0-rc6-omamobile-push1-g7062b50298ff`. I copied the module tree matching the +booted kernel from its RAM image into the disposable root and ran `depmod`; +host-side module resolution finds `nf_tables`. A subsequent RAM boot logged +all six UFS disks and 85 partitions read-only, and the NFS root handed off to +systemd. For this diagnostic boot only, UFW was disabled in the disposable +root because the preceding firstboot attempt could not install its nftables +rules. That means this run does not verify the firewall or resolve the +`iptables-nft` error. + +The kernel logged simpledrm's `fb0`, then `msm-mdss` failed its deferred probe +with `-110` at 143 seconds. This does not establish what was visible on the +panel. Networkd brought `usb0` up and sshd listened, but later SSH sessions +timed out while opening the systemd login session. `omamobile-firstboot 0.1.9` +started keyring setup and had not left that step more than eleven minutes into +the boot; the device clock was in 1970 and DNS/NTP did not recover. No +`tools/phone-smoke` report, phone-side `networkctl status usb0`, visible +desktop, or GPU renderer was captured. The firstboot 0.1.9 mask change has not +completed on the phone. + +Before this retry, the NFS journal had shown systemd reaching the graphical +target and SDDM reporting its autologin session started; that does not confirm +a visible frame or a working renderer. + +In a separate RAM rescue, fb0 reported `blank=4`; writing `0` changed the +reported state and text was sent to tty1. The display was not visually +confirmed after that change. No phone-side smoke was captured after matching +modules were added. These tests used a disposable NFS root; no UFS partition +was flashed or explicitly written. + +## 2026-11-16 — fresh current-stack NFS root + +The checksum-verified Omarchy 4.5.0-3 root image (SHA-256 +`75f2dc67630c2661705f3b796170621a3582d96093893ed72e6f680ec34581ce`) +was unpacked into a disposable NFS export. The first attempt read an older +export: two mounted ext4 test images had the same filesystem UUID, and NFS +served the older one despite the path naming the new image. The older root's +systemd unit and inode numbers exposed the mismatch. The new image was given +a distinct UUID while the phone was in fastboot, then exported again. + +The second `fastboot boot` used RAM boot image SHA-256 +`b58ab9dff9c960380563e22e3aedc41dcbe0ef58e6ec8386eb41d9251bc5710d`. +SSH on the phone confirmed kernel `7.3.0-rc6-omamobile-push1-gf61e96519032`, +an NFS root with the new image's inode and a test-only mask of the interactive +`systemd-firstboot` service. All six UFS whole-disk flags were `ro=1`. The +image's package database reported `omarchy 4.5.0-3`, +`omamobile-omarchy 0.1.45-1`, `omamobile-device-dipper 0.1.0-1`, and +`mesa 1:26.2.4-1.5`. `omamobile-firstboot` started and generated a private +pacman key, then spent several minutes importing the Arch keyring. The +disposable export was switched from `sync` to `async` during that import. + +The phone later stopped answering ping and SSH while the USB gadget remained +enumerated. The firstboot log had not passed the keyring step. No raw +`tools/phone-smoke`, `networkctl status usb0`, visible desktop, or GPU renderer +was captured from this fresh root. This is a partial current-stack boot, not +the completed owner smoke gate. No flash or explicit UFS write was issued. + +## 2026-11-17 — current-stack NFS phone-smoke + +`tools/phone-smoke` ran on kernel `7.3.0-rc6-omamobile-push1-gf61e96519032` +with tools commit `f9b04b7`. It confirmed all 6 UFS whole disks and 85 +partitions read-only, NFS as `/`, USB gadget bound, and `usb0` routable and +online at `172.16.42.1`. The display connector reported connected at +1080x2248; no failed systemd units were reported. + +The required session check failed: Hyprland and the shell were not running. +GPU had no render node and no multitouch input device was present. Kernel +health had no oops, BUG or WARN, but `dmesg` had three new errors: the +watchdog did not stop, its hardware timeout was rejected, and a generated +unit failed. The boot check skipped because Dipper has no slot suffix; root +skipped as a nonpersistent NFS test root. Battery, sound, sensors, cameras, +Wi-Fi and Bluetooth were also skipped. + +Firstboot was active. After importing the keyring, `gpg-agent` repeatedly +failed while locally signing trusted keys; SSH later stopped answering. The +report does not demonstrate a usable desktop or GPU. No UFS writes were made. + +## 2026-11-16 — visible RAM console and NFS retry + +A locally repacked RAM rescue image used the same kernel and DTB as the earlier +rescue image, with an SSH public key whose private key was available to the +test host. `fastboot boot` accepted it. SSH confirmed kernel +`7.3.0-rc6-omamobile-push1`, a `rootfs` root, all 6 UFS disks and 85 +partitions read-only, and fbcon bound to the 1080x2248 framebuffer. A line +written to `/dev/tty0` was visible on the phone, as confirmed by the owner. +`/usr/local/bin/reboot-to bootloader` over SSH returned it to fastboot. The +local key and repacked image are not included in this PR. + +Two RAM boots of the current NFS image then mounted the disposable Omarchy +root, but SSH in that root never became usable. The NFS connection stopped +and the phone restarted into its pre-existing ext4 `userdata` system, which +reported a writable main disk. Both times, `reboot-to bootloader` over SSH +returned it to fastboot. The second attempt used a test-only networkd rule +leaving `usb0` unmanaged and volatile journaling; neither prevented the +restart. Pstore was empty after the first restart. These attempts do not +verify a clean Omarchy boot, display session or package firstboot. No UFS +partition was flashed or explicitly written, but routine writes by the old +system cannot be ruled out. + +Further diagnostic NFS boots left `usb0` unmanaged by both networkd and +NetworkManager in the disposable root. One boot reached +`omamobile-firstboot`, but pacman key population repeatedly waited on GPG +locks; removing stale lock files after the phone was back in fastboot let it +advance, not finish. A test-only initramfs clock seed and a separate boot with +`omamobile-firstboot` masked did not yield a stable NFS session. Each attempt +eventually restarted into the old writable `userdata` installation; SSH from +that installation returned the phone to fastboot. No new root image or boot +partition was flashed. The next gate is a reviewed single-slot install path, +not another claim that the old installation is the new Omarchy image. + +A controlled comparison used the earlier base DTB in place of the later +`dispcc`-enabled DTB, with the same NFS initramfs and disposable root. With +firstboot isolated, both network managers leaving `usb0` alone, and volatile +journaling, the NFS connection still stopped before root SSH answered. A +second try changed only the host's disposable NFS export from `sync` to +`async`; it reduced the observed TCP send queue but did not prevent the same +restart into the old ext4 root. Host USB logs show the Omarchy gadget +disconnecting about a minute after enumeration. Neither the DTB change nor +the export sync mode is established as the sole cause. After the test the +export was restored to `sync`, the test-only root overrides were removed, and +the phone was returned to fastboot through the old installation's SSH. + +## 2026-11-16 — RAM rescue and NFS retry + +RAM image `426af1000e4912f26cff210f9ffe6017753289a93db53297489525ac974d11c9` +used the kernel and DTB from `04dc54e1…`, its initramfs with the NFS export +path updated, and `omamobile.initramfs` to stay in rescue. SSH host identity +matched the image's key. `uname -r` was `7.3.0-rc6-omamobile-push1`, `/` was +`rootfs`, and `/proc/iomem` reserved `0x85fc0000–0x8a8fffff`. All 91 disk and +partition `ro` flags read `1`; `qcom_wdt` was bound and its feeder was running. +The NFS root mounted read-only and contained systemd. The initramfs helper +`/usr/local/bin/reboot-to bootloader` returned the phone to fastboot. + +The matching 1818 kernel modules were copied into the disposable NFS root. A +subsequent RAM boot of `16f038cd425d4a5b0afe0da9b60df58bc79a689f50772a9c0469a5fb74b22c8c` +used the same kernel, DTB and modified initramfs without the rescue flag. +Initramfs SSH briefly opened but was gone before a shell was captured. The +phone answered ping, but NFS-root SSH and a current phone-side smoke report +were not obtained. The handoff and visible screen on this retry are unverified. +No UFS flash or explicit UFS write was issued. + +The disposable root's persistent journal subsequently showed an NFS handoff +on 2026-11-16, followed by `systemd-firstboot.service` starting its interactive +Initial Setup before `sysinit.target`; the user saw a timezone prompt on the +phone. SSH in the root had not started. For a further test only, that service +was masked in the disposable NFS root; `omamobile-firstboot` and its existing +test configuration were left enabled. The next RAM boot was accepted by +fastboot, but the resulting root and SSH were not confirmed. This mask is not +a packaged change or evidence of a working first boot. + +A later retry staged the draft #839 `systemd-firstboot` drop-in and verified +the test answers with `omamobile-firstboot --check`. The disposable root also +had a temporary root SSH key, a networkd override leaving `usb0` unmanaged, +and volatile journal storage. The NFS root's SSH host key was observed on +the USB link, but the connection timed out before a shell or phone-side +`phone-smoke` could be captured. This does not establish the condition result, +storage flags or a running desktop on that boot. No UFS flash or explicit UFS +write was issued. + +## 2026-11-16 — isolated NFS session and smoke report + +RAM image `16f038cd425d4a5b0afe0da9b60df58bc79a689f50772a9c0469a5fb74b22c8c` +reached the disposable Omarchy 4.5.0-3 NFS root with kernel +`7.3.0-rc6-omamobile-push1`; systemd reported `running`. The phone showed +`0x85fc0000–0x8a8fffff` reserved and all 6 disk and 85 partition `ro` flags +were `1`. The root used a temporary SSH key, volatile journaling, an unmanaged +USB network override and a draft #839 drop-in. `omamobile-firstboot` was masked +at boot for isolation, then the mask was removed on the host after boot. This +does not validate the normal first-boot path. `networkctl` reported `usb0` +routable and unmanaged. No UFS flash or explicit UFS write was issued. + +The read-only smoke report follows. Its display result is connector detection; +after the report, the user observed the Omarchy logo and password lock screen +on the phone. Unlock was not tested. Mesa rendering was not verified: no render +node existed. + +### phone-smoke: dipper + +Kernel `7.3.0-rc6-omamobile-push1`, tools at `4b535d0`, 2026-11-16T08:31Z. + +| Check | Result | Detail | +| --- | --- | --- | +| boot (required) | skip | kernel 7.3.0-rc6-omamobile-push1, no slot in bootconfig or on the command line | +| storage guard (required) | ok | 6 whole disks read-only; 85 partitions; no writes outside the descriptor allowlist | +| root | skip | nfs test root; not persistent | +| kernel health (required) | ok | no oops or BUG; 0 WARN, 2 error lines in dmesg (0 known, 2 new) | +| new dmesg errors | not ok | watchdog: N: watchdog did not stop! x1; (generato[N]: '…' failed with exit status N x1 | +| systemd units | ok | none failed | +| USB gadget (required) | ok | bound to a600000.usb | +| display | ok | card0-Unknown-1 connected, 1080x2248 | +| GPU | not ok | no render node | +| session (required) | not ok | Hyprland runs, the shell isn't running | +| lock | ok | PAM file present (the shell didn't answer lock status) | +| touch | not ok | no multitouch input device | +| buttons | ok | gpio-keys | +| Wi-Fi | skip | no wireless interface | +| Bluetooth | skip | no controller | +| battery | skip | no battery power supply | +| sound cards | skip | none | +| sensors | skip | no sensor proxy | +| cameras | skip | no libcamera tools | +| thermal | ok | hottest zone 37 °C | + +Packages: hyprland 0.57.0-3.3, libcamera 0.7.2-4.23, mesa 1:26.2.4-1.5, omacam 0.3.3-1, omamessages 0.2.2-1, omamobile-apps 0.2.3-1, omamobile-device-dipper 0.1.0-1, omamobile-firstboot 0.1.5-1, omamobile-keyring 20261026-1, omamobile-mirror 0.1.1-1, omamobile-omarchy 0.1.45-1, omamobile-owl-widgets 0.1.2-1, omamobile-settings 0.1.2-1, omamobile-shell 0.2.127-1, omamobile-voice 0.1.0-1, omaphone 0.2.3-1, omarchy 4.5.0-3, omatel-agent 0.2.4-2, quickshell 0.3.2.r7.g2b4501a-1 + +## 2026-11-16 — networkd reload and clean-boot retry + +On the same NFS-root session, `networkctl reload` and `networkctl reconfigure +usb0` selected the packaged `/usr/lib/systemd/network/20-usb-gadget.network`; +`usb0` reported `routable (configured)` and online. A fresh SSH command +completed and the following `phone-smoke` ran. This verifies the live +reconfiguration, not that a clean boot reaches that state. + +The follow-up smoke used kernel +`7.3.0-rc6-omamobile-push1-gf61e96519032`, tools at `92f8953`, and the same +RAM-only image (`4b028fb51f446647473e0a887dc5689a0c32cbedb98d8ee53ce81366a541d4f7`). +The handset clock was `1970-01-19T01:41Z`; that timestamp is not a test date. +Storage guard passed (6 disks, 85 partitions read-only), kernel health showed +no new errors, systemd had no failed units, USB and display detection passed, +and Bluetooth created `hci0` with its power state unknown. The root remained +NFS and non-persistent. The report still found no GPU render node, no shell +process, and no multitouch input device. No visual screen capture was made on +this pass. + +### phone-smoke: dipper + +Kernel `7.3.0-rc6-omamobile-push1-gf61e96519032`, tools at `92f8953`, +handset clock `1970-01-19T01:41Z`. + +| Check | Result | Detail | +| --- | --- | --- | +| boot (required) | skip | no slot in bootconfig or on the command line | +| storage guard (required) | ok | 6 whole disks read-only; 85 partitions; no writes outside the descriptor allowlist | +| root | skip | NFS test root; not persistent | +| kernel health (required) | ok | no oops or BUG; 0 WARN, 0 error lines in dmesg | +| systemd units | ok | none failed | +| USB gadget (required) | ok | bound to a600000.usb | +| display | ok | card0-Unknown-1 connected, 1080x2248 | +| GPU | not ok | no render node | +| session (required) | not ok | Hyprland runs, the shell isn't running | +| lock | ok | PAM file present (the shell didn't answer lock status) | +| touch | not ok | no multitouch input device | +| buttons | ok | gpio-keys | +| Wi-Fi | skip | no wireless interface | +| Bluetooth | ok | hci0, powered unknown | +| battery | skip | no battery power supply | +| sound cards | skip | none | +| sensors | skip | no sensor proxy | +| cameras | skip | no libcamera tools | +| thermal | ok | hottest zone 60 °C | + +After that report, `fastboot boot` accepted the same image without flashing a +partition. The kernel capture records switching to the NFS root after 4.8 s +and systemd starting. USB ping began answering after about 55 s; fresh SSH +still refused or timed out until about 110 s. The subsequent phone-smoke +report found the pre-existing dirty kernel `7.3.0-rc6-omamobile-push1-g2a318a96ae9d-dirty` +and an ext4 root on `userdata`, with the older Omarchy 4.0.6 package stack. +Its storage check found the main disk writable, so this report does not test +the NFS image. The user reported that the text console was no longer visible. +`reboot-to bootloader` over SSH then returned the phone to fastboot; product +was `dipper` and the bootloader was unlocked. No partition was flashed and no +explicit UFS write command was issued; incidental writes from the existing +system cannot be ruled out. + +## Fastboot recovery (2026-11-15) + +From the existing Linux system on `userdata` (not the new NFS-root image), +`DEVICE=dipper bin/omamobile fastboot` used the installed +`/usr/bin/reboot-to bootloader` and returned the phone to fastboot. The helper +reported `In fastboot`; `fastboot getvar product` returned `dipper` and +`fastboot getvar unlocked` returned `yes`. No partition was flashed. This +confirms the host-side recovery command for the installed system; it does not +verify the new NFS-root boot. + ## RAM sessions (newest first) | Date | `boot.img` SHA-256 | Source, as recorded | `/dev/sda` and UFS partitions | Checks and gaps | | --- | --- | --- | --- | --- | +| 2026-11-15 | `04dc54e155b90e189b504df03476dc4ea086fdb6b02b2249aab54665a60ffa07` | Kernel `7.3.0-rc6-omamobile-push1`, base `da171eae4cb7b0a852b6629ff986c78ebab911c0` plus panel-driver commit `ee6f8c7139e428be8f8435e4d67503cd7b5486bc`; packed DTB SHA-256 `b5baf1c71cf85f2a0f2c16229aaa4a1a96a53ce00310f57caa68a435b631349d` | NFS root handoff confirmed. UFS guard logs say it set all 6 whole-disk nodes and all 85 partition nodes read-only; their `ro` flags were not read directly. | `fastboot boot` accepted the image. The NFS root was Omarchy 4.5.0-3 with `omamobile-omarchy 0.1.45`; its journal confirms switch to NFS, both `removed-region` reservations, the UFS guard, and the `qcom_wdt` watchdog device. The initramfs guard ran; watchdog feeder state was not read. The packed DTB was decompiled after this boot and contained both removed-region nodes. `/proc/iomem` was not captured, so the reserved-range gate is unverified. SSH was refused; `tools/phone-smoke`, phone-side `networkctl status usb0`, and the visible screen were not captured. The full kernel module bundle was added to the NFS root after this boot, so its userspace module-loading path was not tested. No flash or explicit UFS-write command was issued. | +| 2026-11-15 (retry, 60s watchdog) | `04dc54e155b90e189b504df03476dc4ea086fdb6b02b2249aab54665a60ffa07` | Same kernel, rootfs and packed DTB as the preceding row | Boot image accepted by `fastboot boot`; host enumerated CDC NCM and ACM; NFS requests confirmed root-systemd startup | NFS-root systemd journal records `RuntimeWatchdogSec=60s` rejected with `Failed to set watchdog hardware timeout to 1min: Invalid argument`; udev startup timed out and SSH/ping did not respond. No `/proc/iomem`, UFS flag readback, watchdog feeder, `phone-smoke` or visible-screen evidence from that root. No partition was flashed. | +| 2026-11-15 (retry, 20s watchdog) | `04dc54e155b90e189b504df03476dc4ea086fdb6b02b2249aab54665a60ffa07` | Same kernel, Omarchy 4.5.0-3 NFS root and packed DTB | NFS root; `/proc/iomem` showed `85fc0000-8a8fffff : reserved`; direct UFS `ro` flags were not captured | `networkctl status usb0` reported routable/configured and systemd was still `initializing`, not multi-user. The phone later returned to the existing ext4 root. `tools/phone-smoke`, watchdog feeder state, direct UFS `ro` readback and visible-screen evidence remain unavailable. The disposable test root used volatile journals and temporary early-SSH wiring, not included in the package. No partition was flashed. | +| 2026-11-14 | `d7bdde5e35b5c78a5878ebf4df28effefca35bed9a26c39098f473278d233ead` (debug image: `c86d517e5c3c5940f3099f46524968d59ddf6e0a258aac51fd00547b7acc24bb`) | Kernel `7.3.0-rc6-omamobile-push1-g7062b50298ff`, source `7062b50298ff2868e5a8a0be70483227e9c7db0b`; rootfs image SHA-256 `75f2dc67630c2661705f3b796170621a3582d96093893ed72e6f680ec34581ce` | No `/proc/iomem` or UFS `ro` flags were captured. A later SSH session reported kernel `7.3.0-rc6-omamobile-push1-g2a318a96ae9d-dirty` and root type `ext4`; `reboot-to bootloader` returned the phone to fastboot. | Omarchy 4.5.0-3 / `omamobile-omarchy 0.1.45` rootfs build and all rootfs smoke checks passed; 1818 kernel modules included `qcom-wdt`, MSM DRM and EA8074. The NFS image showed no firstboot log or created test account. A retry of this image was accepted by `fastboot boot`, but a 10-second host capture saw no SSH/RPC/NFS packets and an ARP probe got no reply. Raw `phone-smoke`, `networkctl status usb0`, `/proc/iomem`, UFS flags and display evidence remain unavailable. No flash command was issued; incidental writes by the existing ext4 system cannot be ruled out, so the earlier userdata backup may be stale. | +| 2026-11-13 | `50356521ec35b361261de571fc9f8033b55c8fd7ad0689010fb55d0cec16401c` | Corrected RAM image with NFS-root request | Exposed whole-disk and partition flags read-only during the NFS session | Booted kernel `7.3.0-rc6-omamobile-push1` with the disposable NFS root. Installed `omamobile-omarchy 0.1.44-1` locally; its hook applied 29 Omarchy 4.0.6 patches and `omamobile-omarchy-patches verify` passed. `phone-smoke` found no failed systemd units or new kernel errors; USB, DSI enumeration, GPU render node, Hyprland/session, touch, buttons, Bluetooth and thermal checks passed. Root check correctly identifies NFS as non-persistent. Lock IPC was intermittent. No flash or explicit UFS-write command was issued; see the later userdata-root observation below. | +| 2026-11-13 | `1d4ce38579a881b6d875a9a3bc025357f753cf119ce5ce16b3dbdc52f86da9f9` | Local RAM image; retained manifest has image/kernel/ramdisk hashes but no source commit; no NFS-root request was included | All exposed whole-disk and partition `ro` flags were `1` | Initramfs and USB/SSH ran on `7.3.0-rc6-omamobile-push1`. `stmfts` registered as `event2`; three touch-key and 428 absolute events arrived during three taps. Display stayed black: only simpledrm `Unknown-1` was present, with no DSI panel/backlight device. Mounted disposable NFS root without switching PID 1; chroot `pacman -Qk omamobile-device-dipper` reported 47 files, none missing. `reboot-to bootloader` used the initramfs helper because PID 1 never switched. No UFS write. | | 2026-11-12 | `ac93a5d9f6787153cf620704f192c22da91cf2041789f16f4214111b8458d226` | Test kernel source: base `2a318a96ae9d4c87e061da1da13c05b11d305658` plus the FTS5 DTS change now proposed as kernel PR #249 commit `0d548847248512b1e8e1d40d66a85b81fe5ed471`; enabled directly for this test | `/dev/sda` absent (disk flag not applicable); `sdb`–`sdf` disk flags not read; all 85 partition flags `ro=1` | Full reserved range, kernel `7.3.0-rc6-omamobile-push1`, `stmfts` on `event2`, no Oops/BUG/panic/WARN. `qcom_wdt` and feeder state: not read. Exact touch X/Y extrema were not retained. No physical touch event captured; no UFS write. | | 2026-11-12 | `1bf0ffd5302fff7fa75f49382567063d7e03bd52083baa81a88107a47dcbdbd2` | The booted test overlay itself defined the full touch node; its exact source was not retained. The later rebuild uses #249's disabled node plus [`device/dipper/overlays/fts5-touchscreen.dtso`](overlays/fts5-touchscreen.dtso), blob `f09381d59a110d02a8b8819f585e304efb1870a3`; both proposed sources postdate the boot. | `/dev/sda` absent (disk flag not applicable); `sdb`–`sdf` disk flags not read; all 85 partition flags `ro=1` | `0x85fc0000–0x8a8fffff` reserved; `stmfts` exposed `event2` on I2C14; physical input included contact, changing X/Y coordinates and `ABS_MT_TRACKING_ID=-1` release. `qcom_wdt` was bound; feeder state: not read. Exact touch X/Y extrema were not retained. No UFS write. | | 2026-11-12 (superseded) | `e37196952fca14d5a9152871927039b2ac1d311ec500710f8611f9ac6eff8072` | The booted test overlay itself defined the full touch node; its exact source was not retained. The later rebuild uses #249's disabled node plus [`device/dipper/overlays/fts5-touchscreen.dtso`](overlays/fts5-touchscreen.dtso), blob `f09381d59a110d02a8b8819f585e304efb1870a3`; both proposed sources postdate the boot. The exact source commit for the stale `base-panel.dtb` was not retained. | `/dev/sda` absent (disk flag not applicable); `sdb`–`sdf` disk flags not read; all 85 partition flags `ro=1` | Touch events worked, but the DTB omitted `removed-region@86200000` and `removed-region@89100000`; `/proc/iomem` exposed those areas as System RAM. This was noticed when reviewing `/proc/iomem` after the boot's touch test. Replaced by the corrected image above. No UFS write. | @@ -25,6 +316,91 @@ the facts needed for review. | 2026-11-09 | `f2f5cb2e3da8fe992d366dba36e059c0d9106cf14a7d1c8872c61ee144a4474b` | Earlier #505 image after `qcom-pon` was built in; exact kernel/DTS heads unknown | `/dev/sda` absent, disk `ro=0`; all 85 partitions and other disks `ro=1` | PMIC keys registered and Volume Down produced `KEY_VOLUMEDOWN`; watchdog/feeder, framebuffer and USB/SSH worked. | | 2026-11-09 | `93484a91103c294f6c73799ae6cb7161019129b9f89ab331222ae04f10ecf3e1` | First #505 image before `qcom-pon` was built in; exact kernel/DTS heads unknown | `/dev/sda` absent, disk `ro=0`; all 85 partitions and other disks `ro=1` | Console, framebuffer, USB/SSH and watchdog/feeder worked; no physical key event was captured. | +On 2026-11-13, all 84 entries in the off-device partition checksum manifest +were revalidated. The separate 7.1 GB compressed userdata archive passed its +SHA-256 and zstd integrity checks; it remains a file-level, non-atomic archive, +not a raw partition image. + +The 2026-11-13 NFS-root run used Omarchy 4.0.6 and +`omamobile-omarchy 0.1.44-1`; it does not satisfy the owner's requested +Omarchy 4.5.0-3/`omamobile-omarchy 0.1.45` run. The full +`tools/phone-smoke` output and `networkctl status usb0` were not retained. +The corrected image was booted again, but its USB gadget did not provide ping, +SSH or NFS connectivity, so the refreshed run and those captures remain pending. + +The corrected NFS-root image above was booted with `fastboot boot`; it was not +flashed. The NFS test root's configured stable repository key was unknown to +the root's local pacman keyring, so it was not imported or trusted. The package +was built from the PR source on the phone and installed from the local archive +with a local-only pacman configuration. The pacman commands had no +`--nodeps`; all declared runtime dependencies were present in the root's local +package database. The normal `tools/phone-install-package` +repository path therefore remains unverified. During cleanup, the stale +`omamobile-wlan.service` was disabled in the disposable root because it waited +for unavailable modem/QMI services; Wi-Fi and modem remain unverified. + +After the NFS session, USB SSH became unavailable and later returned. The +device reported `/dev/sda21` (`PARTNAME=userdata`) as the ext4 root, mounted +read-write, with no NFS-root request. The owner confirmed this was the +pre-existing Linux installation on userdata, not an installation made by this +test. No flash or explicit UFS-write command was issued. The existing system +may perform routine writes while running; the separately verified userdata +backup is file-level and non-atomic. The phone was then placed in fastboot, +where the bootloader reported product `dipper`. The corrected NFS image was +RAM-booted again; its USB gadget enumerated, but ping and SSH did not respond +and no NFS connection reached the host at the time of this note. + +The old 4.0.6 test root also contained unowned files in +`/etc/systemd/system`: `omamobile-wlan.service`, +`omamobile-dipper-display.service` and `omamobile-nfs-trigger.service`. +The WLAN unit is a one-shot WCN3990/QMI startup calling +`/usr/local/bin/omamobile-wlan-up`; neither it nor that helper appears in a +package manifest or this repository. The display unit refers to a dirty local +kernel module release. The NFS trigger calls an unowned local helper. The old +root's package database does not identify who staged these files or when. +WLAN was disabled because modem/QMI is unverified; the other two are not +evidence of package-owned services. A new NFS root must omit all three. + +That root also had unowned files in +`/usr/lib/firmware/qcom/sdm845/dipper/`. The local porting record says +`a630_zap.mbn` and the Dipper DSP images were extracted from this phone's own +vendor firmware and reassembled outside this repository; the old root's +package database confirms they were not package-owned. `a630_sqe.fw` came +from `linux-firmware-qcom 20260916-1`. The exact per-file source hashes used +by the render run were not retained. No vendor firmware blob is committed. + +On 2026-11-13, the Mesa 1.5 package was extracted to tmpfs in the phone's +pre-existing userdata Linux root and tested from a console login with +`eglinfo -p gbm`. OpenGL core, compatibility and ES reported +`freedreno` / `FD630`; `LD_DEBUG=libs` confirmed this package's +`libgallium` and `dri_gbm.so` were loaded. This was not a Hyprland test and +the package was not installed to the root. The archive SHA-256 was +`6122aec6efa24194c5dca9733fd8a8936d92e8c99058f9c96d7cb0eb83b8a7fc`. + +The test root had `a630_sqe.fw` owned by `linux-firmware-qcom +20260916-1`; `a630_zap.mbn` was extracted and reassembled from this phone's +own vendor firmware, as described above. The exact kernel release, boot-image +hash and kernel source revision for this console session were not retained. +The raw `eglinfo` and `tools/phone-smoke --json` output were not retained. The +contemporaneous summary says the GPU render node and display passed, while the +session check reported Hyprland and the shell were not running. Retained build +metadata ties the package PKGBUILD checksum to Mesa commit +`83aa88ec413644dfc2336e6d09ee0a06481edd01`. The boot image SHA-256 and exact +kernel source revision for this console session were not retained, so this +renderer result cannot be correlated with a particular kernel image. Do not +describe this as a Hyprland renderer test. + +The missing Omarchy Hyprland files were copied from the test root's standard +user skeleton without overwriting existing files. `omamobile-setup-user` then +completed in the disposable test account; the monitor config contains scale 3, +and the earlier minimal config was kept as a recovery copy. Restarting SDDM +started Hyprland and the Omarchy shell automatically. A subsequent +`phone-smoke` confirmed the display, GPU, session, touch, buttons, Bluetooth +and thermal checks, with no failed units or new kernel errors. The root check +remains expectedly non-persistent, and lock IPC stayed intermittent. A +`phone-demo shot --wake` attempt did not complete, so visible desktop content +was not confirmed. No UFS write. + The original 10-29 count of 92 `/dev/block/by-name/` entries was not saved as a 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 @@ -54,7 +430,7 @@ event (`ABS_MT_TRACKING_ID=-1`). No UFS partition was written. The node is now proposed disabled in kernel PR #249 at `0d548847248512b1e8e1d40d66a85b81fe5ed471`; enabling it with the repository overlay [`device/dipper/overlays/fts5-touchscreen.dtso`](overlays/fts5-touchscreen.dtso), -blob `f09381d59a110d02a8b8819f585e304efb1870a3`, rebuilds the tested node. +blob `f09381d59a110d02a8b8819f585e304efb1870a3`, is meant to rebuild the tested node; the boot image was not retained for comparison. Both proposed sources postdate the historical boots. Then booted a RAM image with the same FTS5 node enabled directly in the kernel @@ -366,3 +742,66 @@ The upstream v8 cover letter states it was tested on Xiaomi Mi 8: [controller-ready fix](https://lists.openwall.net/linux-kernel/2026/09/25/2214), [binding update](https://lists.openwall.net/linux-kernel/2026/09/25/2212). Firmware loading, low-power touch and wake-on-touch/AP-SLPI handoff are not implemented. +# 2026-11-19 — Dipper boot argument for systemd's firstboot prompt + +The default RAM-only boot image command line now includes +`systemd.firstboot=off`, following the owner's review of #839. This is +Dipper-specific and leaves the shared firstboot package unchanged. The +argument is present in the generated boot manifest, but it has not yet been +verified on the phone. The firstboot prompt and the Omarchy firstboot service +still need a clean on-device run after the NFS reset/fallback path is resolved. + +## 2026-11-19 — guarded on-device backup comparison + +Booted the rescue image `5e0370e4933232f2e56440ab19e0950981a99bb96113619313d462df1c64cd70` +with `fastboot boot` (RAM only). Its `omamobile.initramfs` argument held PID 1 +in the initramfs, and its empty UFS allowlist left every partition read-only. +Before hashing, the phone reported `ro=1` for all six UFS disks and all 84 +backed-up partitions; partition names, nodes and sizes matched the 11-09 +manifest. SHA-256 was calculated from each phone partition and compared with +the raw-source hashes captured with the 11-09 compressed backup: **83 of 84 +matched**. Only `logfs` differed. No partition was mounted or written during +this comparison. The full hashes and comparison table remain off-repository. + +Between the 11-09 capture and this check, the phone ran Android, the older +installed Linux system and multiple RAM/NFS boot attempts. The 11-13 check +only re-hashed backup files; it did not compare the phone. The NFS attempts +between 11-13 and 11-16 also fell back into the older writable install at +least eight times, as counted in the owner's review. The exact boot sequence +and cause of the `logfs` change are not established. The other 83 backed-up +partitions, including `persist`, `modemst1` and `modemst2`, matched byte for +byte at this check. + +The rescue boot exposed `/chosen/pureason` as big-endian `0x000800a1`, with +an empty pstore. This boot followed a manual entry to fastboot, so the value +does not establish the cause of the earlier NFS resets. The roughly one-minute +reset cause remains unknown; the fallback path is recorded below. +The rescue image lacked `reboot-to`; a previously built static AArch64 helper +was copied into `/run` (RAM) and `reboot-to bootloader` returned the phone to +fastboot. The bootloader again identified the product as `dipper`. No UFS +partition was flashed during this comparison. + +## 2026-11-19 — RAM-rescue fallback image preflight + +An initial RAM-rescue image without an NFS request exposed a storage-guard +defect: all 85 partition flags were `ro=1`, but the `sda` disk flag was `0` +and its whole-disk node was removed. It was never flashed. The shared init +fix is proposed separately in omarchy-mobile#919; with no writable allowlist, +it marks the whole disk read-only and checks it at hand-over. + +A second RAM-only image, SHA-256 +`06a8cc368ce86ae6ba570208d0291c642f143019283dd0a88d99ef2365d746b3`, +included #919's exact `initramfs/init`, `ram-rescue` mode, no NFS request, +disabled automatic USB-failure panic, and a static `reboot-to` in RAM. +`fastboot boot` reached an SSH shell on kernel `7.3.0-rc6-omamobile-push1`; +`/` remained rootfs, all six UFS disk flags and all 85 partition flags read +`ro=1`, and the built-in `reboot-to bootloader` returned to fastboot. After +verifying the existing boot partition matched the 11-09 backup, flashed this +image to the single `boot` partition. `reboot-to bootloader` and then a plain +`fastboot reboot` returned to this persistent rescue image; all six disks and +85 partitions again reported `ro=1`. No userdata or other partition was +written. The 11-09 raw boot image remains available as the restore source; +its raw SHA-256 is `e9ef7bff84d181e09de286a95b9487ec5fcb5c0cc53db3ae780d6a64ceb4fbe8`. +The persistent rescue fallback now works. The cause of the earlier NFS reset +is still unknown; the next NFS test can collect its reset evidence without +falling into the older writable userdata system. diff --git a/device/dipper/device.conf b/device/dipper/device.conf index 22f7407ab..f39979e3f 100644 --- a/device/dipper/device.conf +++ b/device/dipper/device.conf @@ -5,7 +5,10 @@ CODENAME=dipper NAME="Xiaomi Mi 8" SOC=sdm845 COMPATIBLE="xiaomi,dipper" +# Dipper firmware paths, Qualcomm userspace and Freedreno runtime support. +PACKAGE=omamobile-device-dipper BOOT_METHOD=ram-only BOOT_IMAGES="" UFS_RW="" +DTB_OVERLAYS="fts5" PANEL_SIZE=1080x2248 diff --git a/device/dipper/kernel.config b/device/dipper/kernel.config index f24173e2f..2d2e46cbd 100644 --- a/device/dipper/kernel.config +++ b/device/dipper/kernel.config @@ -25,8 +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 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. +# The FTS5 node from PR #249 stays disabled in the base tree; the device's +# `fts5` overlay enables it. Keep the driver built in for its early probe. CONFIG_TOUCHSCREEN_STMFTS=y # Console log into the stock ramoops region: the only way to read an early hang @@ -42,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: built in for the follow-up FTS5 node; PR #220 does not enable it yet. +# i2c: built in for the Dipper FTS5 node and its early probe. 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 @@ -57,6 +57,8 @@ CONFIG_SPI_QCOM_GENI=m CONFIG_DRM_MSM=m CONFIG_DRM_SIMPLEDRM=y CONFIG_SYSFB_SIMPLEFB=y +# Keep Dipper's EA8074 panel available to the MSM display stack. +CONFIG_DRM_PANEL_SAMSUNG_EA8074=m # 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 diff --git a/device/dipper/overlays/fts5.dtso b/device/dipper/overlays/fts5.dtso new file mode 100644 index 000000000..509a0d604 --- /dev/null +++ b/device/dipper/overlays/fts5.dtso @@ -0,0 +1,8 @@ +// SPDX-License-Identifier: GPL-2.0 +/* Enable the FTS5 node, which is disabled in the base DTS. */ +/dts-v1/; +/plugin/; + +&touchscreen { + status = "okay"; +}; diff --git a/docs/DEVICES.md b/docs/DEVICES.md index 22a8d46a7..7906baa8f 100644 --- a/docs/DEVICES.md +++ b/docs/DEVICES.md @@ -32,6 +32,7 @@ The status of each device, as verified on real hardware. Rows in the matrix have | Pixel 7 ([notes](../device/panther/NOTES.md)) | panther | gs201 (Tensor G2) | WIP (slot B, not marked successful; Arch and Hyprland boot; `boot` and `init_boot` carry AVB footers, which a phone whose `vbmeta_b` is stock's needs to start slot B (device-panther 0.1.6, [#396](https://github.com/derekross/omarchy-mobile/pull/396), [notes](../device/panther/NOTES.md#2026-11-02-avb-footers-on-boot-and-init_boot)); `reboot-to bootloader` reaches fastboot with `reboot=warm`, merged, [kernel #198](https://github.com/derekross/linux-omarchy-mobile/pull/198); [BRINGUP-M1](../device/panther/BRINGUP-M1.md); board file merged, [kernel #108](https://github.com/derekross/linux-omarchy-mobile/pull/108)) | testing (UFS behind the read-only guard; Arch on `userdata`; merged, [kernel #108](https://github.com/derekross/linux-omarchy-mobile/pull/108)) | WIP (simple-framebuffer: console and the Hyprland desktop; brightness and display off/on over DCS through the S6E3FC3 panel driver and device-panther 0.1.4, merged, [kernel #177](https://github.com/derekross/linux-omarchy-mobile/pull/177); [DISPLAY-PLAN](../device/panther/DISPLAY-PLAN.md)) | testing (Panthor on the Mali-G710; Hyprland renders on it; merged through [kernel #134](https://github.com/derekross/linux-omarchy-mobile/pull/134), with the always-on rule in device-panther 0.1.1, [#145](https://github.com/derekross/omarchy-mobile/pull/145); [notes](../device/panther/NOTES.md#2026-10-28-the-gpu-and-the-haptics-power-off-and-usb-after-a-replug)) | WIP (FocalTech FT3658: touches drive Hyprland and unlock the PIN screen on a test kernel; the driver, [kernel #109](https://github.com/derekross/linux-omarchy-mobile/pull/109), and the touch node, [kernel #134](https://github.com/derekross/linux-omarchy-mobile/pull/134), are merged; stock's interrupt pull-up and CS delay, [kernel #166](https://github.com/derekross/linux-omarchy-mobile/pull/166), the driver's review fixes, [kernel #133](https://github.com/derekross/linux-omarchy-mobile/pull/133), and the kernel option with the touch notes, [#149](https://github.com/derekross/omarchy-mobile/pull/149), are merged) | testing (gpio-keys: power, volume; merged, [kernel #108](https://github.com/derekross/linux-omarchy-mobile/pull/108)) | testing (USB and SSH; merged, [kernel #108](https://github.com/derekross/linux-omarchy-mobile/pull/108); a replug comes back through `omamobile-usb-rescue` in device-panther 0.1.3, on the MAX77759's I2C bus, merged, [kernel #167](https://github.com/derekross/linux-omarchy-mobile/pull/167); [notes](../device/panther/NOTES.md#2026-10-29-usb-comes-back-after-a-replug-u1)) | no | testing (BCM4389 on the APM UART through hci_bcm with the phone's own patch, merged, [kernel #196](https://github.com/derekross/linux-omarchy-mobile/pull/196): a BLE mouse drives the shell, and headphones play over A2DP with their AVRCP buttons, on its author's Pixel 7; the Bluetooth address and the rest of the package side aren't merged yet; headset calls, suspend and power not tested) | WIP (MAX77759 fuel gauge with stock's battery model on a test kernel: percentage, capacity and temperature in upower and the bar; merged, [kernel #171](https://github.com/derekross/linux-omarchy-mobile/pull/171) and the driver fix [#170](https://github.com/derekross/linux-omarchy-mobile/pull/170); a second unit's Lishen pack isn't matched by that model yet, [notes](../device/panther/NOTES.md#2026-11-03-a-second-unit-angelrenefm); [BATTERY-PLAN](../device/panther/BATTERY-PLAN.md)) | no | testing (CS40L26 with the phone's own firmware, `tools/extract-vendor-firmware -d panther`; merged through [kernel #134](https://github.com/derekross/linux-omarchy-mobile/pull/134), with the feedbackd rule in device-panther 0.1.1, [#145](https://github.com/derekross/omarchy-mobile/pull/145); [notes](../device/panther/NOTES.md#2026-10-28-the-gpu-and-the-haptics-power-off-and-usb-after-a-replug)) | testing (LM3644 rear flash, 36 steps, from the node merged in [kernel #197](https://github.com/derekross/linux-omarchy-mobile/pull/197) and the bring-up overlay `torch.dtso`, [#426](https://github.com/derekross/omarchy-mobile/pull/426): lit on a second Pixel 7; the quick-settings tile not checked) | no | no | no | no | no | no | no (the package's camera start and DMA heap rule are merged, device-panther 0.1.9, [#443](https://github.com/derekross/omarchy-mobile/pull/443), inert until the camera device tree is proposed) | no (s2idle by default since [kernel #134](https://github.com/derekross/linux-omarchy-mobile/pull/134) and device-panther 0.1.1; not run yet) | WIP (the sensor's node, disabled, is merged, [kernel #207](https://github.com/derekross/linux-omarchy-mobile/pull/207); with a bring-up overlay and the package side, which is in review ([#458](https://github.com/derekross/omarchy-mobile/pull/458)), a finger enrolled and unlocked its author's Pixel 7, also after a reboot) | | OnePlus 13 ([notes](../device/dodge/NOTES.md)) | dodge | sm8750 (Snapdragon 8 Elite) | testing (kernel [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; [BRINGUP](../device/dodge/BRINGUP-M1.md), [notes](../device/dodge/NOTES.md#2026-10-28-matrix-evidence)) | testing ([notes](../device/dodge/NOTES.md#2026-10-28-matrix-evidence)) | testing (msm/dpu; warm-boot drop fixed; [notes](../device/dodge/NOTES.md#2026-10-28-matrix-evidence)) | testing (Adreno 830 / gpu2; Vulkan untested; [notes](../device/dodge/NOTES.md#2026-10-28-matrix-evidence)) | testing ([notes](../device/dodge/NOTES.md#2026-10-28-matrix-evidence)) | testing ([notes](../device/dodge/NOTES.md#2026-10-28-matrix-evidence)) | testing (CDC NCM + SSH; gadget stuck after replug until reboot; kernel [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; [notes](../device/dodge/NOTES.md#2026-10-28-matrix-evidence)) | testing (WCN7860 / ath12k; [notes](../device/dodge/NOTES.md#2026-10-28-matrix-evidence)) | testing (pairing; A2DP untested; kernel [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; [notes](../device/dodge/NOTES.md#2026-10-28-matrix-evidence)) | testing (gauge; charging path not claimed; kernel [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; [notes](../device/dodge/NOTES.md#2026-10-28-matrix-evidence)) | no | no | no | no | - | testing (speakers, earpiece, mics; headset plug untested; [notes](../device/dodge/NOTES.md#2026-10-28-matrix-evidence)) | testing (accel, prox, compass; autorotate; [notes](../device/dodge/NOTES.md#2026-10-28-matrix-evidence)) | testing (LTE data; calls/SMS untested; opt-in flag; [modem](../device/dodge/modem/README.md), [notes](../device/dodge/NOTES.md#2026-10-28-matrix-evidence)) | no | no | WIP (s2idle not default; [notes](../device/dodge/NOTES.md#2026-10-28-matrix-evidence)) | no | | OnePlus 6 ([notes](../device/enchilada/NOTES.md)) | enchilada | SDM845 (Snapdragon 845) | WIP (RAM-only `fastboot boot` of a header-v0 image; kernel: Linux 7.1-rc1 from the sdm845-mainline tree, not linux-omarchy-mobile; the firewall failure booted from `boot_b` after `--set-active=b`, the firewall fix and GPU results were `fastboot boot`s, all three with the Arch root on `userdata`; stock is not on slot A, a §3.1 event: [notes](../device/enchilada/NOTES.md#slots-and-what-is-on-them-contributingmd-31); [#432](https://github.com/derekross/omarchy-mobile/issues/432)) | WIP (UFS behind the read-only guard; `boot_b` is on LUN `sde` and stays read-only; [notes](../device/enchilada/NOTES.md#2026-11-04-ram-only-first-light)) | WIP (msm DRM framebuffer console; [notes](../device/enchilada/NOTES.md#2026-11-04-ram-only-first-light)) | no (needs the phone's own zap shader; [notes](../device/enchilada/NOTES.md#2026-11-05-adreno-630-needs-this-phones-zap-shader)) | no | no | testing (NCM + ACM + SSH; [notes](../device/enchilada/NOTES.md#2026-11-04-ram-only-first-light)) | no (modem/rmtfs plan first) | no | no | no | no | no | no | - | no | no | no | no | no | no | no | +| Xiaomi Mi 8 | dipper | sdm845 (Snapdragon 845) | WIP ([bring-up notes](../device/dipper/BRINGUP-M1.md)) | WIP (guard logs all 85 partitions read-only; direct readback pending) | WIP (EA8074 panel tested by hand on an unpublished kernel; driver #218 is still in review and not in the default image, [notes](../device/dipper/NOTES.md)) | WIP (Adreno 630 renderer tested in the old userdata install; kernel release not recorded; Hyprland rendering pending, [#500](https://github.com/derekross/omarchy-mobile/pull/500)) | WIP (FTS5 events captured; Hyprland delivery pending, [notes](../device/dipper/NOTES.md)) | WIP (GPIO buttons registered) | WIP (USB NCM and SSH worked in rescue boots; current Omarchy NFS root not yet usable) | no | WIP (HCI detected; Dipper firmware missing) | no | no | no | no | no | no | no | no | no | no | no | no | | *Template* | *codename* | *SoC* | | | | | | | | | | | | | | | | | | | | | | | ## cheetah (Pixel 7 Pro) in detail @@ -79,7 +80,6 @@ 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), [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) merged, 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 were proposed in [#25](https://github.com/derekross/omarchy-mobile/pull/25), paused by its author and closed on 2026-11-11; it can be reopened | | 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/docs/RELEASES.md b/docs/RELEASES.md index 9ace1d840..057d55dd3 100644 --- a/docs/RELEASES.md +++ b/docs/RELEASES.md @@ -77,7 +77,7 @@ Bring-up tools (`*-stage`, `display-hz`, `usbc-deadman`) stay per plan: they pok | `OS_VERSION`, `OS_PATCH_LEVEL` | `17.0.0`, `2026-07` | The `init_boot` header values (the `boot` header's, on a device without `init_boot`) | | `AVB_FOOTERS` | (zuma, the Pixel 7a and the Pixel 7 Pro: `boot:0x4000000 init_boot:0x800000`) | Optional. For a phone whose `vbmeta_b` chains these partitions, as stock's does: libavb takes a chained partition with no AVB footer as invalid metadata, which an unlocked bootloader doesn't let through (zuma; the Pixel 7a; the Pixel 7 Pro, device/cheetah/NOTES.md 2026-10-28). A `vbmeta_b` that lists them as hash descriptors, or has verification disabled, never reads the footers. `image:partition_size`, each a `BOOT_IMAGES` entry, once; the size is the slot's partition size in bytes (stock's footer, `avbtool info_image`, or `fastboot getvar partition-size:_b`), a multiple of 4096. `images` adds a hash footer to each, padding it to that size, signed with AOSP's test key (an unlocked bootloader accepts any key); needs `external/avb` under `SRC_DIR` (or `AVBTOOL`, `AVB_KEY`) and `openssl` | | `AVB_ROLLBACK_INDEX`, `AVB_SECURITY_PATCH` | `1791158400`, `2026-10-05` | Required with `AVB_FOOTERS`, refused without it: stock's rollback index and `com.android.build..security_patch` from its footers. Never set the index above stock's: an index the bootloader stores locks stock's own images out of slot A. The `os_version` property is `OS_VERSION`'s major | -| `BOOT_METHOD` | `android-v4` (default when omitted) | Generic images, flash, push and installer accept only `android-v4`; other methods are refused before phone access. `ram-only` marks a probe with no persistent install support. `android-v0` (enchilada) is a header-v0 phone: `images` packs one `boot.img` for `fastboot boot`, and fastboot, flash, push and the installer refuse it | +| `BOOT_METHOD` | `android-v4` (default when omitted) | `ram-only` marks a probe with no persistent install support: initramfs/image builds, flash, push and installer refuse it; `fastboot` is allowed only to request `reboot-to bootloader` from Linux, and stops without a crash fallback if that request is ignored. `android-v0` (enchilada) is a header-v0 phone: `images` packs one `boot.img` for `fastboot boot`, and fastboot, flash, push and the installer refuse it. Other methods are refused before phone access unless listed here | | `PAGESIZE`, `BASE`, `KERNEL_OFFSET`, `RAMDISK_OFFSET`, `SECOND_OFFSET`, `TAGS_OFFSET` | (enchilada: `4096`, `0x00000000`, `0x00008000`, `0x01000000`, `0x00f00000`, `0x00000100`) | `android-v0` only, all required: the header-v0 page size and load offsets, numbers in decimal or lower-case hex. `images` packs the gzip `Image` with the `DTB` appended as the kernel, the initramfs as the ramdisk and `CMDLINE` as the command line. `BOOT_IMAGES` is `boot` alone and `boot_b` must be on `UFS_RW` | | `BOOT_IMAGES` | `boot init_boot vendor_boot vendor_kernel_boot dtbo` | The images written to slot B (the `_b` suffix is added by the tools and is not configurable). `boot`, `vendor_boot` and `dtbo` are always there. Without `init_boot`, `boot` carries the empty generic ramdisk and the OS version; without `vendor_kernel_boot`, `vendor_boot` carries the DTB and the initramfs (the Pixel 6: `boot vendor_boot dtbo`) | | `BOOT_UPDATE_AUTO_WRITE` | (unset; defaults to `yes`) | Optional: `yes` or `no`. The installer records it as `AUTO_WRITE` in `/etc/omamobile/boot-update.conf`; `no` keeps an installed development root from writing slot B through package updates. It does not change the installer's own allowed writes | diff --git a/packages/omamobile-device-dipper/LICENSE b/packages/omamobile-device-dipper/LICENSE new file mode 100644 index 000000000..aecd59624 --- /dev/null +++ b/packages/omamobile-device-dipper/LICENSE @@ -0,0 +1,21 @@ +MIT License + +Copyright (c) 2026 Derek Ross + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/packages/omamobile-device-dipper/PKGBUILD b/packages/omamobile-device-dipper/PKGBUILD new file mode 100644 index 000000000..be63a1784 --- /dev/null +++ b/packages/omamobile-device-dipper/PKGBUILD @@ -0,0 +1,26 @@ +# SPDX-License-Identifier: MIT +pkgname=omamobile-device-dipper +pkgver=$(cat "${startdir:-.}/version") +pkgrel=1 +pkgdesc="Omarchy Mobile support for the Xiaomi Mi 8 (dipper)" +arch=(aarch64) +url="https://github.com/derekross/omarchy-mobile" +license=(MIT) +depends=(bash systemd omamobile-keyring linux-firmware-qcom mesa qrtr pd-mapper tqftpserv) +provides=(omamobile-device) +conflicts=(omamobile-device) +backup=(etc/pacman.d/omamobile-mirrorlist) +install=omamobile-device-dipper.install +makedepends=(gcc) + +build() { + "$startdir/build" "$srcdir" +} + +check() { + "$startdir/test/all" +} + +package() { + "$startdir/install" "$pkgdir" "$srcdir" +} diff --git a/packages/omamobile-device-dipper/README.md b/packages/omamobile-device-dipper/README.md new file mode 100644 index 000000000..118939013 --- /dev/null +++ b/packages/omamobile-device-dipper/README.md @@ -0,0 +1,48 @@ + +# omamobile-device-dipper + +This package configures the Mi 8's USB network, keeps Android partitions out +of desktop storage tools, transfers the hardware watchdog to systemd, and +provides a `reboot-to` helper. + +The runtime and reboot watchdog timeouts are 30 seconds, below the Dipper +`qcom_wdt` driver's 31-second limit. + +It declares Mesa for the Freedreno graphics stack and the Qualcomm +QRTR userspace packages needed by the WLAN and modem stacks. Their services +are not enabled here. + +The Dipper DTS requests `a630_zap.mbn`, `ipa_fws.mbn`, `adsp.mbn`, +`cdsp.mbn`, `mba.mbn`, `modem.mbn` and `venus.mbn` under +`qcom/sdm845/Xiaomi/dipper/`. The WCN3990 Bluetooth driver also needs +`Xiaomi/dipper/crnv21.bin` and `Xiaomi/dipper/crbtfw21.tlv`. Obtain these +files from the owner's own phone or firmware image; none is included here. +Run `tools/extract-vendor-firmware -d dipper /path/to/local-backup` on a +local directory containing copied `vendor/`, `modem/` and `bluetooth/` +partition contents. It preserves the modem `.bNN` segments required by the +Qualcomm loader. `linux-firmware-qcom` supplies +generic Qualcomm firmware such as `a630_sqe.fw`; it does not supply these +Dipper-specific files. The +`[omamobile]` repository mirrorlist is installed for future package updates. +QRTR, `pd-mapper` and `tqftpserv` are dependencies, but their services are +not enabled here. `rmtfs` is not installed until its modem storage role has +a gated device plan. + +The package installs the same device descriptor used by the build tools. + +Dipper support remains RAM-boot only. The single `boot` partition and UFS +storage are not written by this package. + +Suspend is untested and must stay disabled while booting an NFS root, since the +USB link carries the root filesystem. + +The USB route uses metric 1000 for Dipper's NFS-root session, where USB carries +the root filesystem. The Pixel profiles use 2000 so Wi-Fi (metric 600) and +cellular (metric 700) stay preferred over USB. + +## Build and test + +```sh +tools/build-packages --local dipper packages/omamobile-device-dipper +packages/omamobile-device-dipper/test/all +``` diff --git a/packages/omamobile-device-dipper/build b/packages/omamobile-device-dipper/build new file mode 100755 index 000000000..1ddf89489 --- /dev/null +++ b/packages/omamobile-device-dipper/build @@ -0,0 +1,9 @@ +#!/bin/bash +# SPDX-License-Identifier: MIT +# Compile this package's reboot-to helper for the installed system. +set -euo pipefail +cd -- "$(dirname -- "${BASH_SOURCE[0]}")" +out=${1:-build} +mkdir -p "$out" +${CC:-cc} ${CFLAGS:--O2} -Wall -Wextra -o "$out/reboot-to" \ + reboot-to.c ${LDFLAGS:-} diff --git a/packages/omamobile-device-dipper/device.conf b/packages/omamobile-device-dipper/device.conf new file mode 100644 index 000000000..446753c26 --- /dev/null +++ b/packages/omamobile-device-dipper/device.conf @@ -0,0 +1,13 @@ +# 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" +# Dipper firmware paths, Qualcomm userspace and Freedreno runtime support. +PACKAGE=omamobile-device-dipper +BOOT_METHOD=ram-only +BOOT_IMAGES="" +UFS_RW="" +PANEL_SIZE=1080x2248 diff --git a/packages/omamobile-device-dipper/etc/omamobile-mirrorlist b/packages/omamobile-device-dipper/etc/omamobile-mirrorlist new file mode 100644 index 000000000..f9be3d0e9 --- /dev/null +++ b/packages/omamobile-device-dipper/etc/omamobile-mirrorlist @@ -0,0 +1,18 @@ +# SPDX-License-Identifier: MIT +# Where pacman gets Omarchy Mobile's packages ([omamobile] in /etc/pacman.conf). +# +# The one active Server line is the channel this phone follows: +# stable what has run on the Pixel 7 Pro; phones installed from a +# release follow it +# development every day's build, first; for builders and testers +# local the repository on the phone itself, /var/lib/omamobile/repo, +# filled from a build machine by tools/repo-push +# +# Switch with: sudo omamobile-update channel development (or stable, local) +# See which: omamobile-update check +# +# pacman keeps a changed copy of this file across upgrades (backup= in the +# device package); a new default then arrives as omamobile-mirrorlist.pacnew. +Server = https://pkgs.omamobile.org/stable/$arch +#Server = https://pkgs.omamobile.org/development/$arch +#Server = file:///var/lib/omamobile/repo/$arch diff --git a/packages/omamobile-device-dipper/install b/packages/omamobile-device-dipper/install new file mode 100755 index 000000000..2b642b8e6 --- /dev/null +++ b/packages/omamobile-device-dipper/install @@ -0,0 +1,25 @@ +#!/bin/bash +# SPDX-License-Identifier: MIT +# Stage Dipper's device package files. +set -euo pipefail +cd -- "$(dirname -- "${BASH_SOURCE[0]}")" +destination=${1:?Usage: ./install ABSOLUTE_DESTDIR} +build=${2:-build} +[[ $destination == /* && $destination != "/" ]] || { echo "Use an absolute staging directory" >&2; exit 1; } + +install -Dm755 "$build/reboot-to" "$destination/usr/bin/reboot-to" +install -Dm644 vendor/udev/rules.d/10-omamobile-storage.rules \ + "$destination/usr/lib/udev/rules.d/10-omamobile-storage.rules" +install -Dm644 vendor/systemd/network/20-usb-gadget.network \ + "$destination/usr/lib/systemd/network/20-usb-gadget.network" +install -Dm644 vendor/systemd/system.conf.d/10-omamobile-watchdog.conf \ + "$destination/usr/lib/systemd/system.conf.d/10-omamobile-watchdog.conf" +install -Dm644 vendor/systemd/logind.conf.d/10-omamobile-power-key.conf \ + "$destination/usr/lib/systemd/logind.conf.d/10-omamobile-power-key.conf" +install -Dm644 vendor/NetworkManager/conf.d/10-omamobile-usb.conf \ + "$destination/usr/lib/NetworkManager/conf.d/10-omamobile-usb.conf" +install -Dm644 "$(dirname -- "${BASH_SOURCE[0]}")/version" \ + "$destination/usr/share/omamobile/device-dipper/version" +install -Dm644 etc/omamobile-mirrorlist "$destination/etc/pacman.d/omamobile-mirrorlist" +install -Dm644 device.conf "$destination/usr/share/omamobile/device.conf" +install -Dm644 LICENSE "$destination/usr/share/licenses/omamobile-device-dipper/LICENSE" diff --git a/packages/omamobile-device-dipper/omamobile-device-dipper.install b/packages/omamobile-device-dipper/omamobile-device-dipper.install new file mode 100644 index 000000000..96da5786e --- /dev/null +++ b/packages/omamobile-device-dipper/omamobile-device-dipper.install @@ -0,0 +1,62 @@ +# SPDX-License-Identifier: MIT +# Add the [omamobile] repository to pacman.conf, before [omarchy] so its +# builds (e.g. Mesa with Mali-G710 support) win. Added once; never removed +# automatically, so a user's edits stay. +add_repository() { + local conf=/etc/pacman.conf + grep -q '^\[omamobile\]' "$conf" && return + local entry='[omamobile]\nInclude = /etc/pacman.d/omamobile-mirrorlist\n' + if grep -q '^\[omarchy\]' "$conf"; then + sed -i "0,/^\[omarchy\]/s//${entry//\//\\/}\n[omarchy]/" "$conf" + elif grep -q '^\[core\]' "$conf"; then + sed -i "0,/^\[core\]/s//${entry//\//\\/}\n[core]/" "$conf" + else + printf '\n[omamobile]\nInclude = /etc/pacman.d/omamobile-mirrorlist\n' >>"$conf" + fi +} + +# --- the [omamobile] channel (identical in every device package) --- +# The mirrorlist names the channel (stable, development or local). It is a +# backup= file, so pacman keeps a changed copy; an unchanged one, though, is +# replaced by the new default. Phones from before 2026-11-01 read the +# repository on the phone (file:///var/lib/omamobile/repo, filled by +# tools/repo-push), unchanged, and would silently move to stable: such a phone +# keeps reading its own repository, and is told how to switch. +OMAMOBILE_MIRRORLIST=/etc/pacman.d/omamobile-mirrorlist +OMAMOBILE_LOCAL_MARK=/var/lib/omamobile/.mirrorlist-was-local +OMAMOBILE_LOCAL_SERVER='Server = file:///var/lib/omamobile/repo/$arch' + +remember_local_channel() { + [[ -f $OMAMOBILE_MIRRORLIST ]] || return 0 + if grep -qxF "$OMAMOBILE_LOCAL_SERVER" "$OMAMOBILE_MIRRORLIST"; then + mkdir -p "${OMAMOBILE_LOCAL_MARK%/*}" && : > "$OMAMOBILE_LOCAL_MARK" + fi +} + +keep_local_channel() { + [[ -e $OMAMOBILE_LOCAL_MARK ]] || return 0 + rm -f "$OMAMOBILE_LOCAL_MARK" + [[ -f $OMAMOBILE_MIRRORLIST ]] || return 0 + grep -qxF "$OMAMOBILE_LOCAL_SERVER" "$OMAMOBILE_MIRRORLIST" && return 0 + # Comment out every Server line, then turn the local one back on + sed -i -E 's|^([[:space:]]*Server[[:space:]]*=)|#\1|' "$OMAMOBILE_MIRRORLIST" + sed -i 's|^#Server = file:///var/lib/omamobile/repo/\$arch$|Server = file:///var/lib/omamobile/repo/$arch|' "$OMAMOBILE_MIRRORLIST" + grep -qxF "$OMAMOBILE_LOCAL_SERVER" "$OMAMOBILE_MIRRORLIST" || + printf '%s\n' "$OMAMOBILE_LOCAL_SERVER" >>"$OMAMOBILE_MIRRORLIST" + echo "==> [omamobile] stays on this phone's own repository (/var/lib/omamobile/repo)." + echo " Installed phones follow the stable channel at pkgs.omamobile.org; switch with" + echo " sudo omamobile-update channel stable (or development)" +} + +pre_upgrade() { + remember_local_channel +} + +post_install() { + add_repository +} + +post_upgrade() { + add_repository + keep_local_channel +} diff --git a/packages/omamobile-device-dipper/reboot-to.c b/packages/omamobile-device-dipper/reboot-to.c new file mode 100644 index 000000000..ddf52e234 --- /dev/null +++ b/packages/omamobile-device-dipper/reboot-to.c @@ -0,0 +1,25 @@ +// SPDX-License-Identifier: MIT +// Request a reboot reason understood by the Qualcomm bootloader. +#include +#include +#include +#include + +#define LINUX_REBOOT_MAGIC1 0xfee1dead +#define LINUX_REBOOT_MAGIC2 672274793 +#define LINUX_REBOOT_CMD_RESTART2 0xA1B2C3D4 + +int main(int argc, char **argv) +{ + const char *reason = argc > 1 ? argv[1] : "bootloader"; + + if (argc > 2 || reason[0] == '-') { + fprintf(stderr, "usage: reboot-to [REASON]\n"); + return 2; + } + sync(); + syscall(SYS_reboot, LINUX_REBOOT_MAGIC1, LINUX_REBOOT_MAGIC2, + LINUX_REBOOT_CMD_RESTART2, reason); + perror("reboot"); + return 1; +} diff --git a/packages/omamobile-device-dipper/test/all b/packages/omamobile-device-dipper/test/all new file mode 100755 index 000000000..d7047bfc1 --- /dev/null +++ b/packages/omamobile-device-dipper/test/all @@ -0,0 +1,40 @@ +#!/bin/bash +# SPDX-License-Identifier: MIT +set -euo pipefail +cd -- "$(dirname -- "${BASH_SOURCE[0]}")/.." +fail() { printf 'not ok - %s\n' "$1" >&2; exit 1; } +tmp=$(mktemp -d); trap 'rm -rf "$tmp"' EXIT +package_dir=$PWD + +bash -n build install omamobile-device-dipper.install || fail "package scripts parse" +./build "$tmp/build" +(cd "$tmp" && "$package_dir/install" "$tmp/root" "$tmp/build") +[[ -x "$tmp/root/usr/bin/reboot-to" ]] || fail "reboot-to is staged" +[[ -f "$tmp/root/usr/share/omamobile/device-dipper/version" ]] || fail "device version is staged" +grep -q 'depends=(bash systemd omamobile-keyring linux-firmware-qcom mesa qrtr pd-mapper tqftpserv)' PKGBUILD || fail "runtime dependencies are declared" +grep -q '^install=omamobile-device-dipper.install$' PKGBUILD || fail "repository hook is declared" +grep -q '^backup=(etc/pacman.d/omamobile-mirrorlist)$' PKGBUILD || fail "mirrorlist is preserved across upgrades" +for path in \ + usr/lib/udev/rules.d/10-omamobile-storage.rules \ + usr/lib/systemd/network/20-usb-gadget.network \ + usr/lib/systemd/system.conf.d/10-omamobile-watchdog.conf \ + usr/lib/systemd/logind.conf.d/10-omamobile-power-key.conf \ + usr/lib/NetworkManager/conf.d/10-omamobile-usb.conf \ + etc/pacman.d/omamobile-mirrorlist \ + usr/share/omamobile/device.conf \ + usr/share/licenses/omamobile-device-dipper/LICENSE; do + [[ -f "$tmp/root/$path" ]] || fail "install stages $path" +done +if [[ -f ../../device/dipper/device.conf ]]; then + cmp -s device.conf ../../device/dipper/device.conf || fail "packaged descriptor matches the device descriptor" +fi +grep -q '^post_install()' omamobile-device-dipper.install || fail "package install adds the [omamobile] repo" +grep -q '^post_upgrade()' omamobile-device-dipper.install || fail "package upgrade keeps the [omamobile] repo" +grep -q 'KERNEL=="sd\[a-f\]", MODE="0000"' "$tmp/root/usr/lib/udev/rules.d/10-omamobile-storage.rules" || fail "all UFS whole-disk nodes are inaccessible" +grep -q 'KERNEL=="sd\[a-f\]\[0-9\]\*", ENV{UDISKS_IGNORE}="1"' "$tmp/root/usr/lib/udev/rules.d/10-omamobile-storage.rules" || fail "all UFS partitions are hidden from desktop tools" +grep -q '^Address=172.16.42.1/24$' "$tmp/root/usr/lib/systemd/network/20-usb-gadget.network" || fail "usb0 keeps the initramfs address" +grep -q '^RuntimeWatchdogSec=30s$' "$tmp/root/usr/lib/systemd/system.conf.d/10-omamobile-watchdog.conf" || fail "runtime watchdog stays within the qcom_wdt limit" +grep -q '^RebootWatchdogSec=30s$' "$tmp/root/usr/lib/systemd/system.conf.d/10-omamobile-watchdog.conf" || fail "reboot watchdog stays within the qcom_wdt limit" +[[ ! -e "$tmp/root/usr/lib/systemd/system/omamobile-dipper-identity.service" ]] || fail "identity service stays disabled" +[[ ! -e "$tmp/root/usr/lib/systemd/system/omamobile-tailscale-join.service" ]] || fail "tailnet service is not included" +printf 'ok - Dipper package files and dependencies\n' diff --git a/packages/omamobile-device-dipper/vendor/NetworkManager/conf.d/10-omamobile-usb.conf b/packages/omamobile-device-dipper/vendor/NetworkManager/conf.d/10-omamobile-usb.conf new file mode 100644 index 000000000..e3f911f9b --- /dev/null +++ b/packages/omamobile-device-dipper/vendor/NetworkManager/conf.d/10-omamobile-usb.conf @@ -0,0 +1,4 @@ +# SPDX-License-Identifier: MIT +# systemd-networkd owns the USB gadget link; NetworkManager manages other links. +[keyfile] +unmanaged-devices=interface-name:usb0 diff --git a/packages/omamobile-device-dipper/vendor/systemd/logind.conf.d/10-omamobile-power-key.conf b/packages/omamobile-device-dipper/vendor/systemd/logind.conf.d/10-omamobile-power-key.conf new file mode 100644 index 000000000..58b47c253 --- /dev/null +++ b/packages/omamobile-device-dipper/vendor/systemd/logind.conf.d/10-omamobile-power-key.conf @@ -0,0 +1,5 @@ +# SPDX-License-Identifier: MIT +# A short press opens Omarchy's menu; the PMIC handles a forced reset. +[Login] +HandlePowerKey=ignore +HandlePowerKeyLongPress=ignore diff --git a/packages/omamobile-device-dipper/vendor/systemd/network/20-usb-gadget.network b/packages/omamobile-device-dipper/vendor/systemd/network/20-usb-gadget.network new file mode 100644 index 000000000..cadd6fc5e --- /dev/null +++ b/packages/omamobile-device-dipper/vendor/systemd/network/20-usb-gadget.network @@ -0,0 +1,14 @@ +# SPDX-License-Identifier: MIT +# Keep the USB gadget address set by the initramfs after switch_root. +[Match] +Name=usb0 + +[Network] +Address=172.16.42.1/24 +DNS=1.1.1.1 +DNS=9.9.9.9 +ConfigureWithoutCarrier=yes + +[Route] +Gateway=172.16.42.2 +Metric=1000 diff --git a/packages/omamobile-device-dipper/vendor/systemd/system.conf.d/10-omamobile-watchdog.conf b/packages/omamobile-device-dipper/vendor/systemd/system.conf.d/10-omamobile-watchdog.conf new file mode 100644 index 000000000..eb34c8f07 --- /dev/null +++ b/packages/omamobile-device-dipper/vendor/systemd/system.conf.d/10-omamobile-watchdog.conf @@ -0,0 +1,5 @@ +# SPDX-License-Identifier: MIT +# SDM845's qcom_wdt supports at most 31 seconds at its 32764 Hz clock. +[Manager] +RuntimeWatchdogSec=30s +RebootWatchdogSec=30s diff --git a/packages/omamobile-device-dipper/vendor/udev/rules.d/10-omamobile-storage.rules b/packages/omamobile-device-dipper/vendor/udev/rules.d/10-omamobile-storage.rules new file mode 100644 index 000000000..8c04ecb6e --- /dev/null +++ b/packages/omamobile-device-dipper/vendor/udev/rules.d/10-omamobile-storage.rules @@ -0,0 +1,4 @@ +# SPDX-License-Identifier: MIT +# Dipper's UFS spans sda through sdf. Keep every whole disk and partition hidden. +SUBSYSTEM=="block", KERNEL=="sd[a-f]", MODE="0000", ENV{UDISKS_IGNORE}="1" +SUBSYSTEM=="block", KERNEL=="sd[a-f][0-9]*", ENV{UDISKS_IGNORE}="1" diff --git a/packages/omamobile-device-dipper/version b/packages/omamobile-device-dipper/version new file mode 100644 index 000000000..17e51c385 --- /dev/null +++ b/packages/omamobile-device-dipper/version @@ -0,0 +1 @@ +0.1.1 diff --git a/tests/dipper-probe b/tests/dipper-probe index 033977958..a250053d2 100755 --- a/tests/dipper-probe +++ b/tests/dipper-probe @@ -13,9 +13,15 @@ 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() +descriptor = Path('device/dipper/device.conf').read_text() +overlay = Path('device/dipper/overlays/fts5.dtso').read_text() assert 'OUT=${OUT:-$repo/out/dipper}' in builder assert 'modules_install' not in builder assert 'FIRMWARE_DIR' not in builder +assert 'source "$repo/device/dipper/device.conf"' in builder +assert 'DTB_OVERLAYS="fts5"' in descriptor +assert '&touchscreen' in overlay and 'status = "okay"' in overlay +assert '"$fdtoverlay" -i "$dtb" -o "$packdtb"' 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', @@ -61,6 +67,7 @@ with tempfile.TemporaryDirectory() as tmp: check=True, capture_output=True, text=True) manifest = json.loads((out / 'BOOT-MANIFEST.json').read_text()) assert manifest['hardware_boot_tested'] is False + assert 'systemd.firstboot=off' in manifest['cmdline'] assert (out / 'boot.img').read_bytes().startswith(b'ANDROID!') kernel.write_bytes(b'k' * 0xF80001) result = subprocess.run(['python3', 'tools/dipper/build-boot.py', '--kernel', str(kernel), diff --git a/tools/dipper/build b/tools/dipper/build index 3bf10e30e..0d06417e9 100755 --- a/tools/dipper/build +++ b/tools/dipper/build @@ -14,6 +14,7 @@ repo=$(cd "$here/../.." && pwd) KERNEL_DIR=${KERNEL_DIR:-$repo/../linux} KERNEL_OUT=${KERNEL_OUT:-$KERNEL_DIR} OUT=${OUT:-$repo/out/dipper} +source "$repo/device/dipper/device.conf" die() { echo "error: $*" >&2; exit 1; } : "${SSH_PUBKEY:?set SSH_PUBKEY to your authorized public key}" ALPINE=${ALPINE:-alpine:3.22} @@ -58,7 +59,25 @@ docker run --rm --platform linux/arm64 \ # Pack a copy of the DTB so nothing we do can dirty the kernel tree. packdtb=$OUT/sdm845-xiaomi-dipper.dtb -cp "$dtb" "$packdtb" +if [[ -n ${DTB_OVERLAYS:-} ]]; then + dtc=$KERNEL_OUT/scripts/dtc/dtc + fdtoverlay=$KERNEL_OUT/scripts/dtc/fdtoverlay + [[ -x $dtc && -x $fdtoverlay ]] || die "kernel build has no dtc/fdtoverlay" + overlay_dir=$OUT/overlays + mkdir -p "$overlay_dir" + overlays=() + for ov in $DTB_OVERLAYS; do + [[ $ov =~ ^[a-z0-9-]+$ ]] || die "bad DTB overlay name: $ov" + src=$repo/device/dipper/overlays/$ov.dtso + [[ -f $src ]] || die "no overlay $src" + out=$overlay_dir/$ov.dtbo + "$dtc" -q -@ -I dts -O dtb -o "$out" "$src" || die "overlay $ov does not compile" + overlays+=("$out") + done + "$fdtoverlay" -i "$dtb" -o "$packdtb" "${overlays[@]}" || die "applying Dipper overlays failed" +else + cp "$dtb" "$packdtb" +fi kernel_image=$image if command -v zopfli >/dev/null; then echo "compressing the kernel with zopfli for dipper's ABL size limit" diff --git a/tools/dipper/build-boot.py b/tools/dipper/build-boot.py index d1210b2e8..f30b2538d 100755 --- a/tools/dipper/build-boot.py +++ b/tools/dipper/build-boot.py @@ -30,7 +30,7 @@ # 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") + "panic=10 printk.devkmsg=on rootwait systemd.firstboot=off") # dipper's boot partition, measured: 65536 blocks of 1 KiB. BOOT_PARTITION_BYTES = 64 * 1024 * 1024 # This ABL refuses a larger kernel with only