From 93de3d963c6d3a6a276a72472ec8a69f4d2b054c Mon Sep 17 00:00:00 2001 From: DarekM <149845949+aninmucek@users.noreply.github.com> Date: Fri, 6 Nov 2026 08:57:17 +0000 Subject: [PATCH 1/2] device-akita 0.1.0: the Pixel 8a's package, and its storage plan (M2) The Pixel 8a's UFS comes up behind the storage guard (gate c), and a fresh read-only backup is taken from our own kernel. - device/akita/BRINGUP-M2.md: stage 2's runbook (M2.1-M2.7) and the results of M2.1-M2.4. - device/akita/overlays/ufs-probe.dtso: the bring-up overlay for the first UFS boot, never default. - device.conf: NV_PARTS and NV_BACKUP_EXTRA, for tools/nv-backup, with their row in NOTES.md's provenance table. - packages/omamobile-device-akita 0.1.0: the generic set of the Pixel 8 Pro's first package. - device/akita/build-u3-root: husky's test-root builder, for M2.6. Co-Authored-By: Claude Opus 5.5 --- device/akita/BRINGUP-M2.md | 267 ++++++++++++++++++ device/akita/NOTES.md | 1 + device/akita/build-u3-root | 84 ++++++ device/akita/device.conf | 2 + device/akita/overlays/ufs-probe.dtso | 15 + packages/omamobile-device-akita/LICENSE | 21 ++ packages/omamobile-device-akita/PKGBUILD | 27 ++ packages/omamobile-device-akita/README.md | 18 ++ packages/omamobile-device-akita/build | 8 + packages/omamobile-device-akita/device.conf | 26 ++ .../etc/omamobile-mirrorlist | 18 ++ packages/omamobile-device-akita/install | 25 ++ .../omamobile-device-akita.install | 62 ++++ .../omamobile-device-akita/src/reboot-to.c | 24 ++ packages/omamobile-device-akita/test/all | 116 ++++++++ .../conf.d/10-omamobile-usb.conf | 5 + .../logind.conf.d/10-omamobile-power-key.conf | 7 + .../systemd/network/20-usb-gadget.network | 22 ++ .../udev/rules.d/10-omamobile-storage.rules | 8 + packages/omamobile-device-akita/version | 1 + 20 files changed, 757 insertions(+) create mode 100644 device/akita/BRINGUP-M2.md create mode 100755 device/akita/build-u3-root create mode 100644 device/akita/overlays/ufs-probe.dtso create mode 100644 packages/omamobile-device-akita/LICENSE create mode 100644 packages/omamobile-device-akita/PKGBUILD create mode 100644 packages/omamobile-device-akita/README.md create mode 100755 packages/omamobile-device-akita/build create mode 100644 packages/omamobile-device-akita/device.conf create mode 100644 packages/omamobile-device-akita/etc/omamobile-mirrorlist create mode 100755 packages/omamobile-device-akita/install create mode 100644 packages/omamobile-device-akita/omamobile-device-akita.install create mode 100644 packages/omamobile-device-akita/src/reboot-to.c create mode 100755 packages/omamobile-device-akita/test/all create mode 100644 packages/omamobile-device-akita/vendor/NetworkManager/conf.d/10-omamobile-usb.conf create mode 100644 packages/omamobile-device-akita/vendor/systemd/logind.conf.d/10-omamobile-power-key.conf create mode 100644 packages/omamobile-device-akita/vendor/systemd/network/20-usb-gadget.network create mode 100644 packages/omamobile-device-akita/vendor/udev/rules.d/10-omamobile-storage.rules create mode 100644 packages/omamobile-device-akita/version diff --git a/device/akita/BRINGUP-M2.md b/device/akita/BRINGUP-M2.md new file mode 100644 index 000000000..3ee6490f0 --- /dev/null +++ b/device/akita/BRINGUP-M2.md @@ -0,0 +1,267 @@ + +# akita M2: storage (UFS behind the guard, then the Arch root) + +**Status (2026-11-06):** draft; nothing is built or flashed yet. M1 is complete and merged ([BRINGUP-M1](BRINGUP-M1.md)): +- derekross/linux-omarchy-mobile#192 was rebase-merged on 2026-11-05, so its three commits are on `omamobile` under new ids, with the same patches: `cb2cd5e4b` (binding), `c7eb44543` (first light) and `0e2739a92` (framebuffer). +- #414 was squash-merged as `905aa91`. + +M2.1 is done and **M2.3 passed gate (c)** on 2026-11-06: UFS runs at HS-G4 on two lanes behind the guard ([Results](#results)). M2.1's kernel change is committed and signed off as `31d8b229d`, and its gate passes. M2.4 is done: a fresh backup from our kernel, verified and copied offline. M2.5 is done: `omamobile-device-akita` 0.1.0 and `build-u3-root`. M2.6, the Arch test root on `userdata`, is next. +- **Kernel:** branch `omamobile-zuma-akita-ufs`, on `omamobile` `29a7a9326`. It is checked out in the worktree `~/omamobile-kernel/wt-zuma-akita-dts` (reused, so the build stays incremental) and builds into `~/omamobile-kernel/out-zuma-akita-dts`. +- **This repository:** branch `device-akita-m2`. + +## Goal + +Stage 2 of CONTRIBUTING §5.4 ("Arch boots from UFS"), on husky's path ([UFS-PLAN](../husky/UFS-PLAN.md), U1-U4): + +1. **UFS behind the guard (gate c).** The UFS driver brings up the 8a's storage behind the read-only storage guard. The init's probe report lists every LUN and partition by name, and only `UFS_RW` is writable: slot B's five boot images and `userdata`. +2. **A fresh read-only backup, taken from our own kernel.** + - Stock Android kept running for about 43 hours after the clean stage-0 backup, and stock's modem stack writes `efs`, `persist` and `modem_userdata`. + - Magisk's root left with slot B's `init_boot` at M1.3, so stock can't take the backup any more. +3. **Arch on `userdata`.** First from a test root image (gate d), then Omarchy's root image from the signed repository (gate e). + +Slot A stays stock throughout. Only `*_b` boot images and `userdata` are written. `userdata` is written only in M2.6 and M2.7, by `tools/install-phone`, after the human's go. + +## What akita inherits from husky's stage 2 + +husky's UFS work is merged, and all of it belongs to zuma, not to husky's board ([UFS-PLAN](../husky/UFS-PLAN.md), Design): + +- The host and PHY bind Tensor G4's driver data through the fallback compatibles (`google,zuma-ufs` → `google,zumapro-ufs`; linux-omarchy-mobile#51). +- The zuma pin controllers, with the HSI2UFS and PERIC0 banks (#50). +- `zuma.dtsi`'s `ufs_0` and `ufs_0_phy`, disabled until a board enables them (#53). They come with: + - the reset and reference-clock pin groups; + - the UFS sysreg (IOCC at 0x710); + - the PMU isolation; + - `fixed-clock` stand-ins at stock's rates. + +So akita's kernel change is only the board's part: husky's three nodes (Design 1). + +## Path abbreviations + +As in [BRINGUP-M1](BRINGUP-M1.md): `R/` is the private stock capture, `L/` our kernel tree. `H/` is husky's [UFS-PLAN](../husky/UFS-PLAN.md). + +## Facts + +| What | akita | As husky's | Evidence | +| --- | --- | --- | --- | +| Host | `ufs@13200000`, SPI 466, the six regions at husky's addresses, `dma-coherent` | yes | R/live.dts [V] | +| CAL board | `brd-for-cal = 1` | yes | R/live.dts [V] | +| Link | HS-G4 on 2 lanes (`ufs,pmd-attr-gear` 4, `ufs,pmd-attr-lane` 2). `fastboot getvar` reads `storage-power-mode: lanes=2 gear=4 mode=FAST hs_series=SERIES_B` | yes. husky's UFS 4.0 part also links at HS-G4 on 2 lanes | R/live.dts, `getvar` [V] | +| Device | Samsung `KLUDG4UHGC-B0E1`, 128 GB, UFS 3.1, rev 3203 | no: husky's is UFS 4.0 | `getvar` (stage 0) [V] | +| Pins | `gph5-1` (reset) and `gph5-0` (reference clock, drive 2), function 2 | yes | R/live.dts [V] | +| VCC | `regulator-fixed` "ufs-vcc" on `gpp0-1`, active high | yes | R/live.dts [V] | +| Sysreg, isolation | `google,zuma-sysreg-ufs` at 0x13020000 (IOCC 0x710, mask 0x3); PMU 0x3ec0, mask 0x1 | yes | R/live.dts [V] | +| Partitions | 62 on four LUNs: `sda` 34, `sdb` 12, `sdc` 12, `sdd` 4. `userdata` is `sda34`, and `boot_b` to `dtbo_b` are `sda23`-`sda27` | yes for the count and the shape (husky: 62, `userdata` on `sda34`) | R/partitions-by-name.txt [V] | +| UniPro clock, CAL variant | stock's `mclk` and `evt` lines had already rotated out of R/'s kernel log | 178 MHz and the `evt0` tables, as on husky | [I] until M2.3's log | + +## Design + +1. **Kernel: one commit on `omamobile-zuma-akita-ufs`, on `omamobile`.** It adds husky's nodes, which match akita's live tree: + - `ufs_0_fixed_vcc_reg` on `gpp0-1`; + - `vcc-supply` and `status = "okay"` on `ufs_0`; + - `ufs_0_phy` switched on. + + No new binding or driver code. The nodes are enabled in the board file itself, under CONTRIBUTING §6.2's exception: a node whose pins, flags and driver are proven on another phone with the same SoC "may be added enabled in one commit, once it has passed on your phone". These are husky's. So the commit comes after M2.3, and the overlay below adds only the probe's `bootargs`. +2. **The first UFS boot is read-only and stays in the initramfs.** A bring-up overlay, `device/akita/overlays/ufs-probe.dtso`, sets the board's `bootargs` plus `omamobile.ufs-probe omamobile.initramfs`. That gives the probe listing and no hand-over to Arch, so nothing runs on `userdata`. `DTB_OVERLAYS="ufs-probe"` goes in `device.conf` for that build only, and comes out again afterwards. +3. **Nothing writes before the guard.** UFS is built in, so the disks appear before PID 1. In M2.3 they attached at 0.26 s, and `/init` started at 0.28 s. The init's first job is the guard, which flagged every partition by 0.61 s and removed `/dev/sda`. In between, the kernel only reads the partition tables, and nothing is mounted. `UFS_RW` is unchanged since stage 0. +4. **The fresh backup comes from our kernel.** + - `NV_PARTS="efs efs_backup modem_userdata persist modem_a modem_b"` and `NV_BACKUP_EXTRA="devinfo"` go in the descriptor, cheetah's values. Then `tools/nv-backup -d akita` copies the radio and calibration partitions read-only over SSH, and its `--check` can later show that nothing on Linux changed them. + - The rest of the stage-0 set is copied the same way, with each partition hashed on the phone and on the laptop. +5. **The device package comes first, in its own PR.** `omamobile-device-akita` starts with husky's generic first set: + - the storage rule; + - the USB gadget network; + - NetworkManager's drop-in; + - the power key; + - the mirror list and its install hook; + - `reboot-to`; + - the descriptor. + + The display start, the GPU clock, the USB rescue and the MAX77759 blacklist come later, each with the stage it belongs to. + +## Runbook + +Ask the human before every flash and reboot (AGENTS.md §1). + +**Slot B's retries.** Nothing marks slot B successful, so ABL counts every boot of B, clean ones too. Our first M1 boot left 2 of 3 (BRINGUP-M1 test 3), as husky's test K did. +- `bin/omamobile flash` and `tools/install-phone` both end with `--set-active=b`, so each one starts again at three. +- Before a third reboot without a flash: `reboot-to bootloader`, then `fastboot -s --set-active=b` and `fastboot -s reboot`. + +**If stock boots from slot A:** +- Once Arch is on `userdata`, stock can't read it, and recovery is expected to offer a factory reset [I]. **Decline it:** it erases `userdata`, which is the install. Volume Down + Power reaches fastboot. +- Then take a fresh read-only backup (M2.4) before any radio, PMIC, AoC or Trusty work, because a stock boot rewrites `efs`, `persist` and `modem_userdata`. + +### M2.1 Port (laptop only) + +- **What:** + - Design 1's kernel commit; + - the `ufs-probe` overlay; + - `NV_PARTS` and `NV_BACKUP_EXTRA` in the descriptor. +- **Pass:** + - `W=1`, `dtbs_check` and `checkpatch --strict` show nothing new (the two eUSB2 supply warnings only); + - the overlaid DTB's `bootargs` end in `omamobile.ufs-probe omamobile.initramfs`; + - `tools/nv-backup -d akita --list` names the seven partitions. +- **Risk:** none. + +### M2.2 Before the flash (laptop, and a read-only look at the phone) + +1. The phone runs the M1.4 images from slot B (`reboot-to bootloader` reaches fastboot, BRINGUP-M1 test 3), or it is already in fastboot. +2. The `fastboot getvar` values of BRINGUP-M1's M1.2 step 4, plus `slot-retry-count:b`. +3. The laptop's side, as in M1.2 steps 2 and 3: the `omamobile-phone` profile and the SSH key in the agent. + +- **Risk:** none (one reboot to fastboot). + +### M2.3 First UFS boot, read only (gate c) + +Build M2.1's kernel as in M1.1, with `DTB_OVERLAYS="ufs-probe"` in `device.conf` for this build only. Then `bin/omamobile flash`. + +- **Expect:** + - USB and SSH as in M1; + - `dmesg` shows the link up at HS-G4 on 2 lanes, series B [I: husky's `Power mode changed to : FAST series_B G_4 L_2`]; + - `/run/ufs-probe.txt` lists `sda`-`sdd` with every partition by name, all `ro=1` except `UFS_RW`; + - there's no `/dev/sda`. +- **Pass:** the listing matches R/partitions-by-name.txt by name and device node (62 partitions; `userdata` on `sda34`, slot B's images on `sda23`-`sda27`), and the guard's log shows each partition handled. +- **Stop if:** + - the link doesn't come up: keep `dmesg`, then `reboot-to bootloader`; + - any partition outside `UFS_RW` is writable: `reboot-to bootloader` at once, report it, and change nothing else. +- **Rollback:** `fastboot -s --set-active=a`, or flash the M1.4 known-good set. Nothing on UFS is written. +- **Risk:** medium, as husky's U2. A wrong table can fail the link (no harm) or hang the bus (a panic, then a reset). husky's first two tries failed for lack of the pins and VCC; akita has both from its first boot. + +### M2.4 A fresh read-only backup (in M2.3's boot) + +1. `tools/nv-backup -d akita ~/android/reference/akita-nv-`. The output holds the IMEI, so it stays private. +2. The rest of the stage-0 set, copied over SSH: the 63 images of `akita-backup-clean-20261102`, which are every partition except `userdata` and `super`, plus the whole `sdb`, `sdc` and `sdd` LUNs. Each is hashed on the phone before and after its copy and on the laptop, then compared with `akita-backup-clean-20261102`. Then make the second, offline copy (CONTRIBUTING §3.3). + +- **Expect:** + - the bootloaders, `mfg_data`, `pinfo`, `fips`, `blenv` and `modem_a`/`modem_b` match the clean backup; + - `efs`, `efs_backup`, `persist`, `modem_userdata`, `devinfo`, `misc`, `metadata` and others may differ. Stock ran for about 43 hours after the clean backup, and our flashes changed the slot flags. +- **Pass:** every copy's hashes agree on the phone and the laptop. The differences from the clean backup are named in Results. +- **Risk:** none: reads only, with the guard on. + +### M2.5 The device package (laptop only; its own PR) + +- **What:** `packages/omamobile-device-akita` (Design 5), and `device/akita/build-u3-root`, akita's copy of husky's test-root builder. +- **Pass:** the package's `test/all`, `tests/all` and `tools/pr-check`. +- **Risk:** none. + +### M2.6 Arch root on `userdata`, test image (gate d) + +M2.3's kernel without the overlay, so the init hands over to Arch: + +``` +KERNEL_OUT= bin/omamobile modules +device/akita/build-u3-root +KERNEL_OUT= tools/install-phone --device akita \ + --rootfs out/akita/u3-root/omamobile-rootfs-u3-akita-aarch64.img.zst \ + --bootloader-slots-match akita-17.0-15681527 --dry-run +``` + +Then run the same `install-phone` without `--dry-run`. It needs the human's go, because it erases `userdata`. That partition holds only stock's empty data since stage 0's wipe; no account was ever signed in. + +- **Expect:** `install-phone`'s checks pass. It writes slot B's five images and `userdata`, sets B active and reboots. The init finds `omamobile-root`, grows it to the whole partition (109.7 GiB, `partition-size:userdata` 0x1b6a215000), switches to Arch, and systemd reaches `running`. +- **Pass:** + - ssh as root with the installed key; + - `systemctl --failed` is empty; + - the guard's flags hold under Arch: only `UFS_RW` writable, `sdb`-`sdd` `ro`, no `/dev/sda`; + - `reboot-to bootloader` reaches fastboot; + - a second boot comes up the same. +- **Stop if:** + - there's no ssh after 2 minutes; + - any partition outside `UFS_RW` is writable: `reboot-to bootloader` at once. +- **Rollback:** + - flash M2.3's images with the overlay to stay in the initramfs; + - or `fastboot -s --set-active=a`, after which stock needs a factory reset, since its `userdata` is gone. +- **Risk:** low for the hardware, since the kernel is M2.3's. `userdata` is erased by design. Mind slot B's retries (above). + +### M2.7 Omarchy's root image (gate e) + +As husky's U4: +1. Build a fresh kernel from `omamobile`, with M2.1 merged, and tag it before it's flashed. +2. Fill `out/repo/aarch64` from the signed repository's development channel, checking each signature. +3. Run `DEVICE=akita tools/build-rootfs`, then `tools/install-phone --device akita --bootloader-slots-match akita-17.0-15681527`, with `--dry-run` first. + +The install needs the human's go, since it erases `userdata` again. + +- **Needs:** `omamobile-device-akita` in the signed `[omamobile]` repository. Only the maintainer can publish it. +- **Pass:** + - the user logs in over ssh; + - `systemctl --failed` is empty; + - the guard's flags hold; + - `reboot-to bootloader` works; + - `tools/phone-smoke`'s report goes to the pull request, naming what doesn't apply yet (no GPU or touch driver). +- **Watch for:** the clock. With no RTC driver and no network time, the clock starts early, and gpg can skip a new release key as "created in the future" (husky's U4 finding). Set it from the laptop over ssh before `pacman-key --populate`. +- **Risk:** low for the hardware. The trap is the fallback to stock after three boots (above). + +## Risks + +- **`userdata` is erased by design in M2.6 and M2.7.** It holds stock's empty data since stage 0's wipe. Stock on slot A then needs a factory reset to boot, which is why it must be declined while Arch lives there. +- **A UFS 3.1 part where husky's is 4.0.** The host and PHY tables are the SoC's. The link runs at husky's gear and lanes, as stock's does on this phone. The core writes device state at probe: `fDeviceInit` and the exception-event mask, plus the RTC attribute on UFS 4.0 parts only. None of that is partition data. +- **Inline encryption.** Stock's `userdata` is encrypted with wrapped keys, and nothing in M2.3 or M2.4 reads or writes it. +- **Not in M2:** hibern8 and system suspend (husky's U5 and U6, untested on Tensor G3 and G4), the buttons (stage 3), and the panel size the session needs (the review of #414). + +## Open questions + +- B0 or B1 silicon (still; see BRINGUP-M1). +- Plymouth under Arch. `splash` reaches the kernel on this phone (BRINGUP-M1, M1.4). Does a plain `plymouth quit` on simpledrm need husky's retain-splash drop-in? +- ~~Stock's UniPro clock and CAL variant, from M2.3's log rather than stock's.~~ The mainline driver doesn't print them, and the link came up at stock's mode with the stand-in rates (M2.3). + +## Results + +### 2026-11-06: the port (M2.1, laptop only) + +- **The kernel change:** `zuma-akita.dts` gains ``, `ufs_0_fixed_vcc_reg` (`regulator-fixed` "ufs-vcc" on `gpp0` 1, `GPIO_ACTIVE_HIGH`), `&ufs_0` with `vcc-supply` and `status = "okay"`, and `&ufs_0_phy` switched on, with husky's two comments. It is 25 lines, still uncommitted on `29a7a9326`. +- **Checks** [V]: + - `W=1` adds no warning; + - `dtbs_check` reports only the two eUSB2-PHY supply warnings, the same two husky's DTB has on this tree, so the UFS nodes validate against zuma's merged bindings; + - `checkpatch --strict` finds 0 errors, 0 warnings and 0 checks. +- **The built DTB** [V]: `/soc@0/ufs@13200000` is `okay` with its `vcc-supply` on `/regulator-ufs-vcc` (`gpio = <&gpp0 1 0>`), and its PHY is `okay`. That is husky's DTB node for node, only the phandles differ. +- **The overlay** [V]: `ufs-probe.dtso` compiles with `dtc -@` and applies onto that DTB with `fdtoverlay`. The overlaid `bootargs` are exactly the board's plus ` omamobile.ufs-probe omamobile.initramfs`, and the framebuffer and UFS nodes are unchanged. +- **The descriptor** [V]: + - `tools/nv-backup -d akita --list` checks `efs efs_backup modem_userdata persist modem_a modem_b` and copies `devinfo`; + - `DEVICE=akita bin/omamobile initramfs-config` still packs the same four files; + - `tests/device-overlays` and `tests/nv-backup` pass, and `tests/all` gives 418 ok, 0 not ok. + +### 2026-11-06: first UFS boot, read only (M2.3) + +The kernel was `7.3.0-rc6-omamobile-push1-g29a7a9326bf0-dirty`: `omamobile` at `29a7a9326` plus M2.1's uncommitted UFS change, with the `ufs-probe` overlay on the DTB. The incremental build took 11 minutes. All writes went to `*_b` only, through `bin/omamobile flash`. Tests 1-5 are BRINGUP-M1's. + +| # | Test | Seen | Meaning | +| --- | --- | --- | --- | +| 6 | `bin/omamobile fastboot` from the M1.4 kernel, after 58.8 h of uptime | `reboot-to bootloader` reached fastboot in 26 s. `getvar`: slot B `slot-successful:no` with 2 tries, slot A `yes` with 2, anti-rollback counters 3 | M1.4's kernel ran for 2.5 days on the cable without a hang | +| 7 | `bin/omamobile flash` with the M2.3 images | Five `OKAY`s; SSH at 4.96 s. `Power mode changed to : FAST series_B G_4 L_2` at 0.24 s. The device reads `SAMSUNG KLUDG4UHGC-B0E1` rev 3203, `sda` is 128 GB, and there are LUNs 0-3 plus three W-LUNs. No UFS error, reset or I/O error | The link runs at stock's gear, lanes and rate series | +| 8 | The guard, from SSH and the init's log | 4 disks and 62 partitions, every name on stock's node (R/partitions-by-name.txt): none moved, missing or extra. Exactly `UFS_RW` is writable (`sda23`-`sda27`, `sda34`); `sdb`-`sdd` are `ro`; `/dev/sda` is removed. The guard set 56 partitions read-only and left the 6 on the allowlist | **Gate (c) passed** | +| 9 | A 64 MiB direct read of `boot_b` | 1.5 GB/s | Data moves on the link. husky's UFS 4.0 part read 1.8 GB/s | + +Findings: + +- **The disks come before PID 1.** That is the reverse of what this plan first assumed (Design 3), but nothing writes in between. +- **`ufshcd_populate_vreg` finds no `vdd-hba`, `vccq` or `vccq2` supply**, and assumes each is on, as on husky (H/ NOTES). +- **The stand-in clock rates work.** The mainline driver prints neither the UniPro clock nor the CAL variant, but the link came up at stock's mode with `zuma.dtsi`'s rates. +- The logs are private (`~/android/reference/akita-m2-ufs-20261106/`). The images are kept as `~/omamobile-kernel/known-good/akita-m2.3-g29a7a9326bf0-dirty`, with their DTS and overlay. + +### 2026-11-06: a fresh read-only backup from our kernel (M2.4) + +This was in M2.3's boot, with the guard on and nothing mounted. M2.3's kernel change is now committed as `2d26e9ece` on `omamobile-zuma-akita-ufs`. Its DTS is the blob that booted (`bfa8b6f54e0e`). + +| # | Test | Seen | Meaning | +| --- | --- | --- | --- | +| 10 | `tools/nv-backup -d akita` | 7 partitions copied and each verified against a second read on the phone. 5 min 40 s for 721 MB: one SSH connection timed out, and 4 chunks of `modem_b` were read again. The laptop logged no USB event, and a 100 MB stream afterwards ran at 36 MB/s | A verified radio backup. The link stalls now and then under many short connections, and the tool's retries absorb that | +| 11 | All 63 stage-0 items hashed on the phone (18 s) and compared with the clean backup of 2026-11-02 | 47 are unchanged. 11 changed: `efs`, `efs_backup`, `persist`, `modem_userdata`, `metadata` and `trusty_persist` (stock Android, which ran for about 43 h after that backup); `devinfo`, `dram_train_b` and `klog` (the bootloader's slot flags, memory training and log); and the `sdd` and `sdc` LUNs, which hold `devinfo` and `dram_train_b`. The other 5 are slot B's boot images, ours since M1.3 | Nothing changed that stock or the bootloader doesn't write. Our kernels couldn't write: M1's had no UFS, and M2.3's runs behind the guard | +| 12 | The full set, with a private helper on the laptop (`akita-backup-linux`): unchanged items come from the clean backup, the radio items from test 10, and the rest are read in 8 MiB chunks; every file is checked against the phone's hash, and the phone is hashed again afterwards | 58 items, 1.4 GB, all verified, and the phone's hashes the same before and after. Afterwards: no UFS error, and the guard's flags unchanged | **The fresh backup.** M2.6's writes and any later check compare against it. Both new backups have an offline copy | + +The UFS change is committed and signed off as `31d8b229d`. `tools/kernel-pr-check --build OUT --merge origin/omamobile` passes: +- a clean merge; +- the sign-off; +- `checkpatch --strict` with 0 errors and 0 warnings; +- the 10 Google device trees with `W=1` and `dtbs_check`, no new warnings. + +### 2026-11-06: the device package (M2.5, laptop only) + +- **`packages/omamobile-device-akita` 0.1.0** is the generic set of the Pixel 8 Pro's first package (#42): + - the storage rule, the USB gadget network and NetworkManager's drop-in; + - the power key; + - the mirror list and its pacman hook; + - `reboot-to`; + - the descriptor. + + `reboot-to.c`, the storage rule, the mirror list, the hook and the power key are byte-identical to cheetah's, and the two network files to husky's. Its `test/all` checks all of that (15 ok). `install` stages exactly nine files, none of which marks a slot or starts the radio, the charger or a camera. +- **`device/akita/build-u3-root`** is husky's test-root builder with akita's names; only names differ. +- **Checks:** `tests/all` gives 418 ok, 0 not ok. `tests/packages` passes, the new package included, on a quiet CPU; five other packages' timing tests failed while a kernel build shared it. \ No newline at end of file diff --git a/device/akita/NOTES.md b/device/akita/NOTES.md index 8b73fb7f6..e9fe3aba0 100644 --- a/device/akita/NOTES.md +++ b/device/akita/NOTES.md @@ -111,6 +111,7 @@ The descriptor carries no comments; this table is its provenance. | `VENDOR_PAGESIZE` | 0x800 | [V] | F/ `vendor_boot` and `vendor_kernel_boot` headers | | `OS_VERSION`, `OS_PATCH_LEVEL` | 17.0.0, 2026-10 | [V] | F/ `init_boot` header; the build on both slots (R/) | | `BOOT_IMAGES`, `UFS_RW` | the five boot images; their `_b` names and `userdata` | [V] | R/ `/dev/block/by-name`; F/ | +| `NV_PARTS`, `NV_BACKUP_EXTRA` | `efs efs_backup modem_userdata persist modem_a modem_b`; `devinfo` | [V] | R/ `/dev/block/by-name` has all seven, none on `UFS_RW`. They are cheetah's values: the partitions of AGENTS.md §1's checksum check, plus `devinfo`, whose slot flags change with every flash. They let `tools/nv-backup` back them up read-only from our own kernel ([BRINGUP-M2](BRINGUP-M2.md), M2.4) | | `INITRAMFS_INIT` | the shared init | [V] | as husky | | `PANEL_SIZE` | 1080x2400 | [V] | R/ `dumpsys display`; G/ `zuma-akita-display.dtsi` | | `SIMPLEFB_TRIG_CON` | `0x19470030 0x3061` | [V] | DECON0 `TRIG_CON` read 0x3070 at handover on a booted 8a (2026-11-03, above); 0x3061 unmasks the trigger as on husky (H/), and with it the console reaches the panel (M1.4, above) | diff --git a/device/akita/build-u3-root b/device/akita/build-u3-root new file mode 100755 index 000000000..65fd74656 --- /dev/null +++ b/device/akita/build-u3-root @@ -0,0 +1,84 @@ +#!/bin/bash +# SPDX-License-Identifier: MIT +# akita's test root image (BRINGUP-M2.md, M2.6), the one M2.7's rollback +# reinstalls: Arch Linux ARM's base tarball, checked by tools/lib/alarm.sh, +# with omamobile-device-akita staged by its own build and install, and the +# kernel modules of the slot B images. It needs no signed repository and runs +# no pacman, so it has no desktop and no omamobile-firstboot. +# +# device/akita/build-u3-root KERNEL_OUT [OUT_DIR] +# +# KERNEL_OUT is the kernel build the slot B images come from, with its modules +# tarball (KERNEL_OUT=... bin/omamobile modules). OUT_DIR (default +# out/akita/u3-root) gets omamobile-rootfs-u3-akita-aarch64.img.zst, its +# .sha256 and its MANIFEST, for tools/install-phone --rootfs. The MANIFEST +# names the tarball, package and modules by version and sha256, as +# tools/build-rootfs's does: the tarball is "latest", so a rebuild can differ. Needs docker. The image is assembled in +# Debian's own x86 container, which cross-compiles reboot-to. +set -euo pipefail + +if [[ ${1:-} == --inside ]]; then + # In the container: /in/alarm.tar.gz, /in/pkg, /in/modules.tar.zst, /out. + export DEBIAN_FRONTEND=noninteractive + apt-get -qq update >/dev/null + apt-get -qq install -y --no-install-recommends libarchive-tools e2fsprogs zstd \ + gcc-aarch64-linux-gnu libc6-dev-arm64-cross >/dev/null + R=/work/root + mkdir -p $R + bsdtar -xpf /in/alarm.tar.gz -C $R + cp -r /in/pkg /work/pkg + CC=aarch64-linux-gnu-gcc LDFLAGS=-static /work/pkg/build /work/pkg-build + /work/pkg/install $R /work/pkg-build + mkdir -p $R/usr/lib/modules + zstd -dc /in/modules.tar.zst | tar -C $R/usr/lib/modules -xf - + # What install-phone writes into, and the phone's name + install -d -m 0755 $R/etc/omamobile + install -d -m 0700 $R/root/.ssh + echo akita >$R/etc/hostname + # No password logins: root and Arch Linux ARM's alarm account are locked, + # and install-phone puts the owner's key in root's authorized_keys + sed -i -E 's/^(root|alarm):[^:]*:/\1:!:/' $R/etc/shadow + # systemd makes the machine id at first boot + : >$R/etc/machine-id + size=$(($(du -sm $R | cut -f1) * 13 / 10 + 512)) + mke2fs -q -t ext4 -L omamobile-root -d $R /out/root.img "${size}M" + fsck=$(e2fsck -fn /out/root.img 2>&1) || { echo "$fsck" >&2; exit 1; } + chown "$OUT_UID:$OUT_GID" /out/root.img + exit 0 +fi + +repo=$(cd -- "$(dirname -- "${BASH_SOURCE[0]}")/../.." && pwd) +source "$repo/tools/lib/alarm.sh" +(($# >= 1 && $# <= 2)) || alarm_die "usage: device/akita/build-u3-root KERNEL_OUT [OUT_DIR]" +kout=$(readlink -f "$1") +out=${2:-$repo/out/akita/u3-root} +mkdir -p "$out" && out=$(readlink -f "$out") +[[ -f $kout/include/config/kernel.release ]] || alarm_die "no kernel build in $kout" +rel=$(<"$kout/include/config/kernel.release") +modules=$kout/modules-$rel.tar.zst +[[ -f $modules ]] || alarm_die "no $modules (run: KERNEL_OUT=$kout bin/omamobile modules)" +alarm_fetch + +name=omamobile-rootfs-u3-akita-aarch64 +rm -f "$out/root.img" +alarm_say "Assembling $name for $rel" +docker run --rm -e OUT_UID="$(id -u)" -e OUT_GID="$(id -g)" \ + -v "$ALARM_TARBALL:/in/alarm.tar.gz:ro" \ + -v "$repo/packages/omamobile-device-akita:/in/pkg:ro" \ + -v "$modules:/in/modules.tar.zst:ro" \ + -v "$(readlink -f "${BASH_SOURCE[0]}"):/in/build-u3-root:ro" \ + -v "$out:/out" \ + debian:trixie-slim bash /in/build-u3-root --inside +zstd -q -19 -T0 -f --rm "$out/root.img" -o "$out/$name.img.zst" +(cd "$out" && sha256sum "$name.img.zst" >"$name.img.zst.sha256") +commit=$(git -C "$repo" rev-parse --short=12 HEAD)$(git -C "$repo" diff --quiet HEAD -- device/akita packages/omamobile-device-akita tools/lib 2>/dev/null || echo "-dirty") +{ + echo "# akita's test root image (BRINGUP-M2, M2.6)" + echo "device: akita (Arch Linux ARM base + omamobile-device-akita)" + echo "built: $(date -u +%Y-%m-%dT%H:%M:%SZ)" + echo "repository commit: $commit" + echo "arch linux arm tarball sha256: $(sha256sum <"$ALARM_TARBALL" | cut -d' ' -f1)" + echo "omamobile-device-akita: $(<"$repo/packages/omamobile-device-akita/version")" + echo "kernel modules: $rel (tarball sha256 $(sha256sum <"$modules" | cut -d' ' -f1))" +} >"$out/$name.MANIFEST" +alarm_say "$out/$name.img.zst" diff --git a/device/akita/device.conf b/device/akita/device.conf index 9dd84a83d..66aa7c5db 100644 --- a/device/akita/device.conf +++ b/device/akita/device.conf @@ -19,6 +19,8 @@ OS_VERSION=17.0.0 OS_PATCH_LEVEL=2026-10 BOOT_IMAGES="boot init_boot vendor_boot vendor_kernel_boot dtbo" UFS_RW="boot_b init_boot_b vendor_boot_b vendor_kernel_boot_b dtbo_b userdata" +NV_PARTS="efs efs_backup modem_userdata persist modem_a modem_b" +NV_BACKUP_EXTRA="devinfo" INITRAMFS_INIT=/initramfs/init SIMPLEFB_TRIG_CON="0x19470030 0x3061" PANEL_SIZE=1080x2400 diff --git a/device/akita/overlays/ufs-probe.dtso b/device/akita/overlays/ufs-probe.dtso new file mode 100644 index 000000000..328599006 --- /dev/null +++ b/device/akita/overlays/ufs-probe.dtso @@ -0,0 +1,15 @@ +// SPDX-License-Identifier: GPL-2.0-only +/* + * Bring-up probe, never default: the first boot with UFS on (BRINGUP-M2, + * M2.3). The board file's bootargs, plus omamobile.ufs-probe (the init lists + * every LUN and partition, with the storage guard's read-only flags, in + * /run/ufs-probe.txt and the kernel log) and omamobile.initramfs (no + * hand-over to Arch, so nothing runs on userdata). Set DTB_OVERLAYS="ufs-probe" + * in device.conf for that build only. + */ +/dts-v1/; +/plugin/; + +&{/chosen} { + bootargs = "console=tty0 fbcon=font:TER16x32 reboot=warm panic=10 softlockup_panic=1 nmi_watchdog=panic sysctl.kernel.panic_on_rcu_stall=1 clk_ignore_unused pd_ignore_unused rdinit=/init omamobile.ufs-probe omamobile.initramfs"; +}; diff --git a/packages/omamobile-device-akita/LICENSE b/packages/omamobile-device-akita/LICENSE new file mode 100644 index 000000000..aecd59624 --- /dev/null +++ b/packages/omamobile-device-akita/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-akita/PKGBUILD b/packages/omamobile-device-akita/PKGBUILD new file mode 100644 index 000000000..4d4eecb6f --- /dev/null +++ b/packages/omamobile-device-akita/PKGBUILD @@ -0,0 +1,27 @@ +# SPDX-License-Identifier: MIT +# Maintainer: Derek Ross +pkgname=omamobile-device-akita +pkgver=$(cat "${startdir:-.}/version") +pkgrel=1 +pkgdesc="Omarchy Mobile support for the Google Pixel 8a (akita): storage guard and USB networking" +arch=(aarch64) +url="https://github.com/derekross/omarchy-mobile" +license=(MIT) +depends=(bash systemd omamobile-keyring) +provides=(omamobile-device) +conflicts=(omamobile-device) +backup=(etc/pacman.d/omamobile-mirrorlist) +install=omamobile-device-akita.install +makedepends=(gcc) + +build() { + "$startdir/build" "$srcdir/build" +} + +check() { + "$startdir/test/all" +} + +package() { + "$startdir/install" "$pkgdir" "$srcdir/build" +} diff --git a/packages/omamobile-device-akita/README.md b/packages/omamobile-device-akita/README.md new file mode 100644 index 000000000..2a4f96876 --- /dev/null +++ b/packages/omamobile-device-akita/README.md @@ -0,0 +1,18 @@ +# omamobile-device-akita + +Omarchy Mobile's first userspace package for the Google Pixel 8a (codename akita, Tensor G3 / zuma). Like the Pixel 8 Pro's first package, it hides the Android partitions from desktop tools, holds the USB address, and gives pacman the same `[omamobile]` repository as the Pixel 7 Pro. It does not drive the radio, the charger, or a camera, and it does not mark a boot slot successful. + +| Path | Installs to | What it does | +| --- | --- | --- | +| `vendor/udev/rules.d/10-omamobile-storage.rules` | `/usr/lib/udev/rules.d` | Hides `sda` and every Android partition except `userdata` from desktop tools. Same rule as the Pixel 7 Pro. The initramfs stops its guard loop before `switch_root`; the kernel's read-only flags are what remain ([BRINGUP-M2](../../device/akita/BRINGUP-M2.md) test 8) | +| `vendor/systemd/network/20-usb-gadget.network` | `/usr/lib/systemd/network` | Sets usb0 to 172.16.42.1/24 after handover, as the last gateway. A replug needs a reboot: this package does not close the MAX77759's USB2 switch again (the Pixel 8 Pro's rescue needs its `hsi2c_11` bus, which akita's board file doesn't have yet). Same file as the Pixel 8 Pro package | +| `vendor/systemd/logind.conf.d/10-omamobile-power-key.conf` | `/usr/lib/systemd/logind.conf.d` | A short power press does not power the phone off. Same drop-in as the Pixel 7 Pro. akita's forced-reset combination under our kernel is untested; on the Pixel 8 Pro it is Power + Volume Up held 15-30 s | +| `vendor/NetworkManager/conf.d/10-omamobile-usb.conf` | `/usr/lib/NetworkManager/conf.d` | Keeps NetworkManager off that link. Same file as the Pixel 8 Pro package | +| `etc/omamobile-mirrorlist` | `/etc/pacman.d/omamobile-mirrorlist` | Where pacman finds the `[omamobile]` repository. Same file as the Pixel 7 Pro package | +| `omamobile-device-akita.install` | pacman hook | Adds `[omamobile]` to `pacman.conf` before `[omarchy]`, once, and keeps the channel a phone follows. Same script as the Pixel 7 Pro package | +| `src/reboot-to.c` | `/usr/bin/reboot-to` | Reboot with a reason the bootloader understands (`reboot-to bootloader` reaches fastboot on akita, [BRINGUP-M1](../../device/akita/BRINGUP-M1.md) test 3). Same bytes as the Pixel 7 Pro package; the test checks | +| `device.conf` | `/usr/share/omamobile/device.conf` | The descriptor, the same bytes as `device/akita/device.conf` | + +`./build [DIR]` compiles `reboot-to` from this directory, `./install DESTDIR [DIR]` stages the files, and `test/all` checks the copies when it is run from the repository. + +Not in this package: the boot-success marker, Wi-Fi, the charger, cameras, the USB replug rescue, the display start and the slot-B image hook. Each one stays out until it has its own runbook. There is no lid drop-in: akita has no hinge. Whether Plymouth needs the Pixel 8 Pro's retain-splash drop-in on simpledrm is still open ([BRINGUP-M2](../../device/akita/BRINGUP-M2.md), open questions). diff --git a/packages/omamobile-device-akita/build b/packages/omamobile-device-akita/build new file mode 100755 index 000000000..5dacf6c60 --- /dev/null +++ b/packages/omamobile-device-akita/build @@ -0,0 +1,8 @@ +#!/bin/bash +# SPDX-License-Identifier: MIT +# Compile reboot-to into BUILDDIR (default: build). +set -euo pipefail +cd -- "$(dirname -- "${BASH_SOURCE[0]}")" +out=${1:-build} +mkdir -p "$out" +${CC:-cc} ${CFLAGS:--O2} -Wall -Wextra -o "$out/reboot-to" src/reboot-to.c ${LDFLAGS:-} diff --git a/packages/omamobile-device-akita/device.conf b/packages/omamobile-device-akita/device.conf new file mode 100644 index 000000000..66aa7c5db --- /dev/null +++ b/packages/omamobile-device-akita/device.conf @@ -0,0 +1,26 @@ +# SPDX-License-Identifier: MIT +# Each value's source is in NOTES.md, "What device.conf rests on". +CODENAME=akita +NAME="Pixel 8a" +SOC=zuma +COMPATIBLE="google,zuma-akita" +PACKAGE=omamobile-device-akita +DTB=exynos/google/zuma-akita.dtb +SOC_COMPATIBLE="b0-ipop:0x9865:1:0:1 b1-ipop:0x9865:1:1:1" +AVB_FOOTERS="boot:0x4000000 init_boot:0x800000" +AVB_ROLLBACK_INDEX=1791158400 +AVB_SECURITY_PATCH=2026-10-05 +DTBO_SOURCE=akita-m1-overlay.dts +DTBO_BOARD_ID=0x40406 +DTBO_BOARD_REV=0x10000 +VENDOR_CMDLINE="console=tty0 splash plymouth.graphical plymouth.force-scale=1 vt.global_cursor_default=0 clk_ignore_unused pd_ignore_unused printk.devkmsg=on bootconfig" +VENDOR_PAGESIZE=0x800 +OS_VERSION=17.0.0 +OS_PATCH_LEVEL=2026-10 +BOOT_IMAGES="boot init_boot vendor_boot vendor_kernel_boot dtbo" +UFS_RW="boot_b init_boot_b vendor_boot_b vendor_kernel_boot_b dtbo_b userdata" +NV_PARTS="efs efs_backup modem_userdata persist modem_a modem_b" +NV_BACKUP_EXTRA="devinfo" +INITRAMFS_INIT=/initramfs/init +SIMPLEFB_TRIG_CON="0x19470030 0x3061" +PANEL_SIZE=1080x2400 diff --git a/packages/omamobile-device-akita/etc/omamobile-mirrorlist b/packages/omamobile-device-akita/etc/omamobile-mirrorlist new file mode 100644 index 000000000..f9be3d0e9 --- /dev/null +++ b/packages/omamobile-device-akita/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-akita/install b/packages/omamobile-device-akita/install new file mode 100755 index 000000000..181078ecd --- /dev/null +++ b/packages/omamobile-device-akita/install @@ -0,0 +1,25 @@ +#!/bin/bash +# SPDX-License-Identifier: MIT +# Stage omamobile-device-akita into DESTDIR. Nothing is enabled that would +# mark a slot successful or start the radio, the charger, or a camera. +# ./install DESTDIR [BUILDDIR] +set -euo pipefail +cd -- "$(dirname -- "${BASH_SOURCE[0]}")" +destination=${1:?Usage: ./install DESTDIR [BUILDDIR]} +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/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 device.conf \ + "$destination/usr/share/omamobile/device.conf" +install -Dm644 etc/omamobile-mirrorlist \ + "$destination/etc/pacman.d/omamobile-mirrorlist" +install -Dm644 LICENSE "$destination/usr/share/licenses/omamobile-device-akita/LICENSE" +install -Dm644 version "$destination/usr/share/omamobile/device-akita/version" diff --git a/packages/omamobile-device-akita/omamobile-device-akita.install b/packages/omamobile-device-akita/omamobile-device-akita.install new file mode 100644 index 000000000..96da5786e --- /dev/null +++ b/packages/omamobile-device-akita/omamobile-device-akita.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-akita/src/reboot-to.c b/packages/omamobile-device-akita/src/reboot-to.c new file mode 100644 index 000000000..f79e948ed --- /dev/null +++ b/packages/omamobile-device-akita/src/reboot-to.c @@ -0,0 +1,24 @@ +// SPDX-License-Identifier: MIT +// reboot-to: reboot with a reason the Pixel bootloader understands, +// e.g. "reboot-to bootloader" lands in fastboot. +// The kernel's syscon-reboot-mode driver stores the reason in the PMU +// before the reset; busybox reboot can't pass one. +#include +#include +#include + +/* From (stable ABI); musl's sysroot has no kernel headers */ +#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"; + + 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-akita/test/all b/packages/omamobile-device-akita/test/all new file mode 100755 index 000000000..b49e002bb --- /dev/null +++ b/packages/omamobile-device-akita/test/all @@ -0,0 +1,116 @@ +#!/bin/bash +# SPDX-License-Identifier: MIT +# Tests for omamobile-device-akita. reboot-to is compiled from +# src/reboot-to.c in this directory, so a copied package still builds. +# Do not execute reboot-to. +set -euo pipefail +cd -- "$(dirname -- "${BASH_SOURCE[0]}")/.." +fail() { printf 'not ok - %s\n' "$1" >&2; exit 1; } +pass() { printf 'ok - %s\n' "$1"; } +tmp=$(mktemp -d); trap 'rm -rf "$tmp"' EXIT + +bash -n build || fail "build parses" +bash -n install || fail "install parses" +pass "scripts parse" + +grep -q '\.\./\.\.' build install && fail "build or install reaches outside the package directory" +pass "build and install stay inside the package directory" + +if [[ -f ../omamobile-device-cheetah/src/reboot-to.c ]]; then + cmp -s src/reboot-to.c ../omamobile-device-cheetah/src/reboot-to.c \ + || fail "reboot-to.c drifted from the cheetah package" + pass "reboot-to.c matches the cheetah source" + cmp -s vendor/udev/rules.d/10-omamobile-storage.rules \ + ../omamobile-device-cheetah/vendor/udev/rules.d/10-omamobile-storage.rules \ + || fail "the storage rule drifted from the cheetah package" + pass "the storage rule matches the cheetah package" + cmp -s etc/omamobile-mirrorlist ../omamobile-device-cheetah/etc/omamobile-mirrorlist \ + || fail "the mirrorlist drifted from the cheetah package" + pass "the mirrorlist matches the cheetah package" + cmp -s <(sed -n '/^# --- the \[omamobile\] channel/,$p' omamobile-device-akita.install) \ + <(sed -n '/^# --- the \[omamobile\] channel/,$p' ../omamobile-device-cheetah/omamobile-device-cheetah.install) \ + || fail "the install script's channel handling drifted from the cheetah package" + pass "the install script keeps the [omamobile] channel as the cheetah package does" + cmp -s vendor/systemd/logind.conf.d/10-omamobile-power-key.conf \ + ../omamobile-device-cheetah/vendor/systemd/logind.conf.d/10-omamobile-power-key.conf \ + || fail "the power-key drop-in drifted from the cheetah package" + pass "the power-key drop-in matches the cheetah package" + cmp -s omamobile-device-akita.install \ + ../omamobile-device-cheetah/omamobile-device-cheetah.install \ + || fail "the pacman install script drifted from the cheetah package" + pass "the pacman install script matches the cheetah package" +fi +# The USB link's two files come from the Pixel 8 Pro's package, the other +# zuma phone. +if [[ -f ../omamobile-device-husky/vendor/systemd/network/20-usb-gadget.network ]]; then + cmp -s vendor/systemd/network/20-usb-gadget.network \ + ../omamobile-device-husky/vendor/systemd/network/20-usb-gadget.network \ + || fail "the USB gadget network drifted from the husky package" + cmp -s vendor/NetworkManager/conf.d/10-omamobile-usb.conf \ + ../omamobile-device-husky/vendor/NetworkManager/conf.d/10-omamobile-usb.conf \ + || fail "the NetworkManager drop-in drifted from the husky package" + pass "the USB link's network files match the husky package" +fi +grep -q 'omamobile-keyring' PKGBUILD || fail "pacman needs omamobile-keyring" +grep -q '^install=omamobile-device-akita.install$' PKGBUILD \ + || fail "the pacman install script is not named" +[[ -f etc/omamobile-mirrorlist && -f omamobile-device-akita.install ]] \ + || fail "the pacman mirrorlist or install script is missing" +pass "pacman gets the keyring, the mirrorlist, and the install script" +if [[ -f ../../device/akita/device.conf ]]; then + cmp -s device.conf ../../device/akita/device.conf \ + || fail "device.conf drifted from the descriptor" + pass "device.conf matches the descriptor" +fi + +./build "$tmp/build" || fail "reboot-to compiles" +[[ -x $tmp/build/reboot-to ]] || fail "reboot-to is not executable" +pass "reboot-to compiles" + +./install "$tmp/root" "$tmp/build" +for f in usr/bin/reboot-to \ + usr/lib/udev/rules.d/10-omamobile-storage.rules \ + usr/lib/systemd/network/20-usb-gadget.network \ + usr/lib/systemd/logind.conf.d/10-omamobile-power-key.conf \ + usr/lib/NetworkManager/conf.d/10-omamobile-usb.conf \ + usr/share/omamobile/device.conf \ + usr/share/omamobile/device-akita/version \ + usr/share/licenses/omamobile-device-akita/LICENSE \ + etc/pacman.d/omamobile-mirrorlist; do + [[ -f $tmp/root/$f ]] || fail "install stages $f" +done +[[ $(find "$tmp/root" -type f -o -type l | wc -l) -eq 9 ]] \ + || fail "install stages exactly these nine files: $(cd "$tmp/root" && find . -type f -o -type l | sort | tr '\n' ' ')" +grep -q 'KERNEL=="sda", MODE="0000"' "$tmp/root/usr/lib/udev/rules.d/10-omamobile-storage.rules" \ + || fail "the whole-disk node is made inaccessible" +grep -q 'ID_PART_ENTRY_NAME}!="userdata"' "$tmp/root/usr/lib/udev/rules.d/10-omamobile-storage.rules" \ + || fail "userdata is the only partition desktop tools may see" +grep -q 'Address=172.16.42.1/24' "$tmp/root/usr/lib/systemd/network/20-usb-gadget.network" \ + || fail "usb0 keeps the initramfs address" +power="$tmp/root/usr/lib/systemd/logind.conf.d/10-omamobile-power-key.conf" +grep -qx '\[Login\]' "$power" \ + || fail "the power-key drop-in needs a [Login] header" +grep -q '^HandlePowerKey=ignore$' "$power" \ + || fail "a short press must not power the phone off" +grep -q '^HandlePowerKeyLongPress=ignore$' "$power" \ + || fail "the long press stays the PMIC reset" +grep -q '^PACKAGE=omamobile-device-akita$' "$tmp/root/usr/share/omamobile/device.conf" \ + || fail "the installed descriptor is akita" +for absent in usr/bin/omamobile-boot-success usr/bin/omamobile-bootctl \ + usr/lib/systemd/system/omamobile-boot-success.service \ + usr/bin/omamobile-wifi-start usr/bin/omamobile-charge-guard \ + usr/bin/omamobile-camera-start; do + [[ ! -e $tmp/root/$absent ]] || fail "install includes $absent" +done +pass "install stages the udev rule, the USB link and the mirrorlist, and nothing that marks a slot or starts the radio, the charger or a camera" +[[ ! -e $tmp/root/usr/lib/systemd/logind.conf.d/10-omamobile-lid.conf ]] \ + || fail "akita has no lid: no lid drop-in" +pass "no lid drop-in" + +# USB is the last gateway: its route outlives an unplug, so ahead of Wi-Fi +# it sent IPv4 into a dead cable (seen on raven, 2026-10-28). +net=vendor/systemd/network/20-usb-gadget.network +! sed -n '/^\[Network\]/,/^\[/p' "$net" | grep -q '^Gateway=' || fail "usb0 sets no default route in [Network] (metric 0)" +metric=$(sed -n '/^\[Route\]/,/^\[/{s/^Metric=//p}' "$net") +[[ ${metric:-0} -gt 700 ]] || fail "usb0's gateway goes after Wi-Fi (600) and mobile data (700)" +pass "USB is the last gateway" diff --git a/packages/omamobile-device-akita/vendor/NetworkManager/conf.d/10-omamobile-usb.conf b/packages/omamobile-device-akita/vendor/NetworkManager/conf.d/10-omamobile-usb.conf new file mode 100644 index 000000000..252de6e15 --- /dev/null +++ b/packages/omamobile-device-akita/vendor/NetworkManager/conf.d/10-omamobile-usb.conf @@ -0,0 +1,5 @@ +# SPDX-License-Identifier: MIT +# Omarchy Mobile: the USB gadget link to the host (usb0) is configured by +# systemd-networkd; NetworkManager manages everything else (Wi-Fi later). +[keyfile] +unmanaged-devices=interface-name:usb0 diff --git a/packages/omamobile-device-akita/vendor/systemd/logind.conf.d/10-omamobile-power-key.conf b/packages/omamobile-device-akita/vendor/systemd/logind.conf.d/10-omamobile-power-key.conf new file mode 100644 index 000000000..a1e2cb0eb --- /dev/null +++ b/packages/omamobile-device-akita/vendor/systemd/logind.conf.d/10-omamobile-power-key.conf @@ -0,0 +1,7 @@ +# SPDX-License-Identifier: MIT +# Omarchy Mobile: a short press of the power button opens Omarchy's system menu +# (bound in Hyprland by omamobile-setup-user), as Super + Escape does, instead +# of powering off. A long press still forces a reset in the PMIC hardware. +[Login] +HandlePowerKey=ignore +HandlePowerKeyLongPress=ignore diff --git a/packages/omamobile-device-akita/vendor/systemd/network/20-usb-gadget.network b/packages/omamobile-device-akita/vendor/systemd/network/20-usb-gadget.network new file mode 100644 index 000000000..a3050f612 --- /dev/null +++ b/packages/omamobile-device-akita/vendor/systemd/network/20-usb-gadget.network @@ -0,0 +1,22 @@ +# SPDX-License-Identifier: MIT +# Omarchy Mobile: USB networking to the host. The initramfs sets up the USB +# gadget (CDC NCM) before handing over to Arch; this gives it an address. +# The host shares its internet over this link (NetworkManager "shared" +# mode on 172.16.42.2), so it is also a gateway, the last one: Wi-Fi (600) +# and mobile data (700) go first. ConfigureWithoutCarrier keeps this route +# after an unplug (and usb0 keeps its carrier anyway), so at metric 0 IPv4 +# went into the dead cable once the phone left the desk: IPv4-only sites +# such as github.com failed on Wi-Fi while IPv6 ones loaded (seen on raven, +# 2026-10-28). DNS goes to public resolvers. +[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=2000 diff --git a/packages/omamobile-device-akita/vendor/udev/rules.d/10-omamobile-storage.rules b/packages/omamobile-device-akita/vendor/udev/rules.d/10-omamobile-storage.rules new file mode 100644 index 000000000..89c02cf30 --- /dev/null +++ b/packages/omamobile-device-akita/vendor/udev/rules.d/10-omamobile-storage.rules @@ -0,0 +1,8 @@ +# SPDX-License-Identifier: MIT +# Omarchy Mobile storage guard, continued in Arch. The initramfs marks every UFS +# partition read-only except slot B's boot images and userdata, and removes +# the whole-disk node of the main LUN. udev would recreate /dev/sda, so make +# the whole-disk node inaccessible and keep desktop tools from touching any +# Android partition. +SUBSYSTEM=="block", KERNEL=="sda", MODE="0000", ENV{UDISKS_IGNORE}="1" +SUBSYSTEM=="block", KERNEL=="sd[a-d][0-9]*", ENV{ID_PART_ENTRY_NAME}!="userdata", ENV{UDISKS_IGNORE}="1" diff --git a/packages/omamobile-device-akita/version b/packages/omamobile-device-akita/version new file mode 100644 index 000000000..6e8bf73aa --- /dev/null +++ b/packages/omamobile-device-akita/version @@ -0,0 +1 @@ +0.1.0 From d701474bd3b2c2dd6f3615c04560a44571b82b78 Mon Sep 17 00:00:00 2001 From: DarekM <149845949+aninmucek@users.noreply.github.com> Date: Sat, 7 Nov 2026 20:49:28 +0000 Subject: [PATCH 2/2] device-akita 0.1.0: suspend-to-idle, depmod, and #456's review notes - packages/omamobile-device-akita: the suspend-to-idle drop-in. The 8a's /sys/power/mem_sleep reads "s2idle [deep]", and Linux has no zuma SoC sleep sequence to wake from deep. It uses cheetah's settings, with a comment that names zuma; the test compares the settings. - device/akita/build-u3-root: install kmod and run depmod for the slot B kernel's release, so modprobe finds modules in the test root (found by a second tester on #456). - BRINGUP-M2.md: the status and the kernel citations now name linux-omarchy-mobile#206 and its DTS blob; --reinstall in the M2.6 and M2.7 commands; M2.6's results (gate d). - NOTES.md: the storage findings, and the per-phone partitions that NV_PARTS doesn't name. - ufs-probe.dtso: where its copied bootargs come from. Co-Authored-By: Claude Opus 5.5 --- device/akita/BRINGUP-M2.md | 46 +++++++++++++++---- device/akita/NOTES.md | 15 ++++++ device/akita/build-u3-root | 15 ++++-- device/akita/overlays/ufs-probe.dtso | 5 ++ packages/omamobile-device-akita/README.md | 1 + packages/omamobile-device-akita/install | 2 + packages/omamobile-device-akita/test/all | 14 +++++- .../systemd/sleep.conf.d/10-omamobile.conf | 12 +++++ 8 files changed, 94 insertions(+), 16 deletions(-) create mode 100644 packages/omamobile-device-akita/vendor/systemd/sleep.conf.d/10-omamobile.conf diff --git a/device/akita/BRINGUP-M2.md b/device/akita/BRINGUP-M2.md index 3ee6490f0..555d430f7 100644 --- a/device/akita/BRINGUP-M2.md +++ b/device/akita/BRINGUP-M2.md @@ -1,12 +1,12 @@ # akita M2: storage (UFS behind the guard, then the Arch root) -**Status (2026-11-06):** draft; nothing is built or flashed yet. M1 is complete and merged ([BRINGUP-M1](BRINGUP-M1.md)): +**Status (2026-11-07):** M2.1-M2.6 are done; M2.7 waits for the signed package. M1 is complete and merged ([BRINGUP-M1](BRINGUP-M1.md)): - derekross/linux-omarchy-mobile#192 was rebase-merged on 2026-11-05, so its three commits are on `omamobile` under new ids, with the same patches: `cb2cd5e4b` (binding), `c7eb44543` (first light) and `0e2739a92` (framebuffer). - #414 was squash-merged as `905aa91`. -M2.1 is done and **M2.3 passed gate (c)** on 2026-11-06: UFS runs at HS-G4 on two lanes behind the guard ([Results](#results)). M2.1's kernel change is committed and signed off as `31d8b229d`, and its gate passes. M2.4 is done: a fresh backup from our kernel, verified and copied offline. M2.5 is done: `omamobile-device-akita` 0.1.0 and `build-u3-root`. M2.6, the Arch test root on `userdata`, is next. -- **Kernel:** branch `omamobile-zuma-akita-ufs`, on `omamobile` `29a7a9326`. It is checked out in the worktree `~/omamobile-kernel/wt-zuma-akita-dts` (reused, so the build stays incremental) and builds into `~/omamobile-kernel/out-zuma-akita-dts`. +M2.1 is done and **M2.3 passed gate (c)** on 2026-11-06: UFS runs at HS-G4 on two lanes behind the guard ([Results](#results)). M2.1's kernel change is derekross/linux-omarchy-mobile#206, rebase-merged on 2026-11-07 as `75b9c0b73`. Its `zuma-akita.dts` is blob `bfa8b6f54e0e`, the DTS that booted in M2.3. M2.4 is done: a fresh backup from our kernel, verified and copied offline. M2.5 is done: `omamobile-device-akita` 0.1.0 and `build-u3-root`. **M2.6 passed gate (d)** on 2026-11-06: Arch Linux ARM runs from `userdata`, behind the guard, and comes up the same on a second boot. M2.7, Omarchy's image, needs `omamobile-device-akita` in the signed `[omamobile]` repository. A second retail 8a passed M2.3, M2.4 and M2.6 as well ([#456](https://github.com/derekross/omarchy-mobile/pull/456)). +- **Kernel:** linux-omarchy-mobile#206 (branch `omamobile-zuma-akita-ufs`), merged. Its builds used the worktree `~/omamobile-kernel/wt-zuma-akita-dts` (reused, so the build stays incremental) and `~/omamobile-kernel/out-zuma-akita-dts`. - **This repository:** branch `device-akita-m2`. ## Goal @@ -151,9 +151,11 @@ KERNEL_OUT= bin/omamobile modules device/akita/build-u3-root KERNEL_OUT= tools/install-phone --device akita \ --rootfs out/akita/u3-root/omamobile-rootfs-u3-akita-aarch64.img.zst \ - --bootloader-slots-match akita-17.0-15681527 --dry-run + --bootloader-slots-match akita-17.0-15681527 --reinstall --dry-run ``` +`--reinstall` is needed because after M2.3 the phone runs from slot B. `install-phone` refuses that unless the owner states that slot B holds Omarchy Mobile (our boot images) rather than stock Android after a system update. + Then run the same `install-phone` without `--dry-run`. It needs the human's go, because it erases `userdata`. That partition holds only stock's empty data since stage 0's wipe; no account was ever signed in. - **Expect:** `install-phone`'s checks pass. It writes slot B's five images and `userdata`, sets B active and reboots. The init finds `omamobile-root`, grows it to the whole partition (109.7 GiB, `partition-size:userdata` 0x1b6a215000), switches to Arch, and systemd reaches `running`. @@ -176,7 +178,7 @@ Then run the same `install-phone` without `--dry-run`. It needs the human's go, As husky's U4: 1. Build a fresh kernel from `omamobile`, with M2.1 merged, and tag it before it's flashed. 2. Fill `out/repo/aarch64` from the signed repository's development channel, checking each signature. -3. Run `DEVICE=akita tools/build-rootfs`, then `tools/install-phone --device akita --bootloader-slots-match akita-17.0-15681527`, with `--dry-run` first. +3. Run `DEVICE=akita tools/build-rootfs`, then `tools/install-phone --device akita --bootloader-slots-match akita-17.0-15681527 --reinstall` (slot B runs Omarchy Mobile since M2.6), with `--dry-run` first. The install needs the human's go, since it erases `userdata` again. @@ -207,7 +209,7 @@ The install needs the human's go, since it erases `userdata` again. ### 2026-11-06: the port (M2.1, laptop only) -- **The kernel change:** `zuma-akita.dts` gains ``, `ufs_0_fixed_vcc_reg` (`regulator-fixed` "ufs-vcc" on `gpp0` 1, `GPIO_ACTIVE_HIGH`), `&ufs_0` with `vcc-supply` and `status = "okay"`, and `&ufs_0_phy` switched on, with husky's two comments. It is 25 lines, still uncommitted on `29a7a9326`. +- **The kernel change:** `zuma-akita.dts` gains ``, `ufs_0_fixed_vcc_reg` (`regulator-fixed` "ufs-vcc" on `gpp0` 1, `GPIO_ACTIVE_HIGH`), `&ufs_0` with `vcc-supply` and `status = "okay"`, and `&ufs_0_phy` switched on, with husky's two comments. It is 25 lines, and is now linux-omarchy-mobile#206, merged as `75b9c0b73` (DTS blob `bfa8b6f54e0e`). - **Checks** [V]: - `W=1` adds no warning; - `dtbs_check` reports only the two eUSB2-PHY supply warnings, the same two husky's DTB has on this tree, so the UFS nodes validate against zuma's merged bindings; @@ -239,7 +241,7 @@ Findings: ### 2026-11-06: a fresh read-only backup from our kernel (M2.4) -This was in M2.3's boot, with the guard on and nothing mounted. M2.3's kernel change is now committed as `2d26e9ece` on `omamobile-zuma-akita-ufs`. Its DTS is the blob that booted (`bfa8b6f54e0e`). +This was in M2.3's boot, with the guard on and nothing mounted. M2.3's kernel change is linux-omarchy-mobile#206: its `zuma-akita.dts` is blob `bfa8b6f54e0e`, the DTS that booted. | # | Test | Seen | Meaning | | --- | --- | --- | --- | @@ -247,7 +249,7 @@ This was in M2.3's boot, with the guard on and nothing mounted. M2.3's kernel ch | 11 | All 63 stage-0 items hashed on the phone (18 s) and compared with the clean backup of 2026-11-02 | 47 are unchanged. 11 changed: `efs`, `efs_backup`, `persist`, `modem_userdata`, `metadata` and `trusty_persist` (stock Android, which ran for about 43 h after that backup); `devinfo`, `dram_train_b` and `klog` (the bootloader's slot flags, memory training and log); and the `sdd` and `sdc` LUNs, which hold `devinfo` and `dram_train_b`. The other 5 are slot B's boot images, ours since M1.3 | Nothing changed that stock or the bootloader doesn't write. Our kernels couldn't write: M1's had no UFS, and M2.3's runs behind the guard | | 12 | The full set, with a private helper on the laptop (`akita-backup-linux`): unchanged items come from the clean backup, the radio items from test 10, and the rest are read in 8 MiB chunks; every file is checked against the phone's hash, and the phone is hashed again afterwards | 58 items, 1.4 GB, all verified, and the phone's hashes the same before and after. Afterwards: no UFS error, and the guard's flags unchanged | **The fresh backup.** M2.6's writes and any later check compare against it. Both new backups have an offline copy | -The UFS change is committed and signed off as `31d8b229d`. `tools/kernel-pr-check --build OUT --merge origin/omamobile` passes: +The UFS change went out as linux-omarchy-mobile#206, signed off by the owner, and merged as `75b9c0b73`. `tools/kernel-pr-check --build OUT --merge origin/omamobile` passed on it: - a clean merge; - the sign-off; - `checkpatch --strict` with 0 errors and 0 warnings; @@ -262,6 +264,30 @@ The UFS change is committed and signed off as `31d8b229d`. `tools/kernel-pr-chec - `reboot-to`; - the descriptor. - `reboot-to.c`, the storage rule, the mirror list, the hook and the power key are byte-identical to cheetah's, and the two network files to husky's. Its `test/all` checks all of that (15 ok). `install` stages exactly nine files, none of which marks a slot or starts the radio, the charger or a camera. + `reboot-to.c`, the storage rule, the mirror list, the hook and the power key are byte-identical to cheetah's, and the two network files to husky's. Its `test/all` checks all of that. `install` stages nine files, none of which marks a slot or starts the radio, the charger or a camera. + + After review it also carries the suspend-to-idle drop-in (M2.6's `mem_sleep` finding). The drop-in's comment names zuma, and its settings are cheetah's, which the test checks. That makes ten files and 16 checks. - **`device/akita/build-u3-root`** is husky's test-root builder with akita's names; only names differ. -- **Checks:** `tests/all` gives 418 ok, 0 not ok. `tests/packages` passes, the new package included, on a quiet CPU; five other packages' timing tests failed while a kernel build shared it. \ No newline at end of file +- **Checks:** `tests/all` gives 418 ok, 0 not ok. `tests/packages` passes, the new package included, on a quiet CPU; five other packages' timing tests failed while a kernel build shared it. + +### 2026-11-06: Arch on `userdata`, test image (M2.6, gate d) + +- **Kernel:** `7.3.0-rc6-omamobile-push1-g31d8b229d0d0`: #206's head before it merged (`31d8b229d`), built clean with no overlay. Its DTS is blob `bfa8b6f54e0e`, as merged in `75b9c0b73`. +- **The test root:** built by `device/akita/build-u3-root` from the Arch Linux ARM base (sha256 `42a4eeaa…`), `omamobile-device-akita` 0.1.0 and this kernel's modules. Its MANIFEST names repository commit `93de3d963c6d`. +- **The install:** `tools/install-phone --device akita --rootfs … --bootloader-slots-match akita-17.0-15681527 --reinstall`, run by the owner after a dry run. + +| # | Test | Seen | Meaning | +| --- | --- | --- | --- | +| 13 | `tools/install-phone --dry-run` | All checks pass: fastboot, product, unlocked, both slots, image sizes, and slot B acknowledged as ours. It prints the five `*_b` flashes, then `userdata`, `--set-active=b` and `reboot`. Nothing is written | The installer's plan is exactly the runbook's | +| 14 | `tools/install-phone` | The init grows the root on `sda34` from 3411 MiB to 112290 MiB and switches to Arch. Root's SSH works with the installed key. `systemctl is-system-running` reads `running`, with no failed units and 27 running. `usb0` is 172.16.42.1/24 under `systemd-networkd`, and the device package is in place | **Arch runs from `userdata`** | +| 15 | The guard under Arch | 62 partitions, exactly `UFS_RW` writable; `sdb`-`sdd` `ro`; no `/dev/sda`. Only `sda34` is mounted (ext4, 107.9 G). The kernel log has no UFS or ext4 error | The guard's flags hold after `switch_root` | +| 16 | `bin/omamobile fastboot` from Arch, 282 s into the first boot | `reboot-to bootloader` reached fastboot in 25 s. `getvar`: slot B `slot-successful:no` with 2 tries, slot A unchanged | The reboot mode works from Arch too. `reboot-to` syncs before it resets | +| 17 | `fastboot --set-active=b` (B back to 3 tries), then `fastboot reboot` | SSH at 28 s, with systemd `running` 9 s into boot. `systemd-analyze`: 2.0 s kernel and initramfs plus 2.2 s userspace. As before: no failed units, 27 running, the guard's flags, `usb0`, the same four journal lines. ext4 mounted cleanly with no journal replay, and the root wasn't grown again | **Gate (d) passed:** a second boot comes up the same | + +Findings: + +- **The journal's four error lines are all harmless.** They are `exynos-clkout` (-22, as on husky), `unable to open an initial console` (ABL's `console=null`), and `systemd-gpt-auto-generator` exiting with 1 (there's no EFI root to discover). None needs a change. +- **The clock starts at systemd's built-in floor (Jul 24).** There is no RTC driver and no network time yet. Set it from the laptop before M2.7's `pacman-key --populate`, as husky's U4 found. +- **The kernel's default sleep is `deep`.** `/sys/power/mem_sleep` reads `s2idle [deep]` under Arch, and Linux has no zuma SoC sleep sequence to wake from it. `omamobile-device-akita` now carries the suspend-to-idle drop-in, with the Pixel 7 Pro's settings (`MemorySleepMode=s2idle`), so Omarchy's Suspend won't enter `deep`. The test image on the phone predates it. Suspend itself is still untested on Tensor G3 (husky's U6). +- **The test image had no module indexes.** There was no `modules.dep`, so `modprobe` found nothing. The kernel build installs its modules without depmod, and the image runs no pacman, whose kmod hook would make them. A second tester found this on #456, and this phone showed the same. Nothing at boot needs a module, which is why Arch still came up clean. `build-u3-root` now installs `kmod`, runs `depmod` for the slot B kernel's release, and fails the build if no `modules.dep` results. The rebuilt image has the full index set (`modules.dep` lists all 1820 modules) and the suspend drop-in. +- The logs are private (`~/android/reference/akita-m2-arch-20261106/`). The images and modules are kept as `~/omamobile-kernel/known-good/akita-m2.6-g31d8b229d0d0`. \ No newline at end of file diff --git a/device/akita/NOTES.md b/device/akita/NOTES.md index e9fe3aba0..614fdbee4 100644 --- a/device/akita/NOTES.md +++ b/device/akita/NOTES.md @@ -11,6 +11,21 @@ Sources: - `S/`: Google's GPL zuma SoC device tree, [kernel/devices/google/zuma](https://android.googlesource.com/kernel/devices/google/zuma/+/refs/tags/android-16.0.0_r0.10/dts/) at the same tag. - `H/`: [husky's notes](../husky/NOTES.md) and [descriptor](../husky/device.conf), for what the two zuma phones share. +## 2026-11-06: storage and the Arch root (M2) + +UFS with the storage guard (gate c) and Arch on `userdata` (gate d). The steps and results are in [BRINGUP-M2](BRINGUP-M2.md). The kernel side is linux-omarchy-mobile#206, merged as `75b9c0b73`. + +- **UFS links at stock's mode** [V]: `FAST series_B G_4 L_2`, with husky's three board nodes (VCC on `gpp0-1`). All 62 partitions appear on stock's device nodes, and the guard leaves exactly `UFS_RW` writable, in the initramfs and under Arch. +- **The disks attach before PID 1** [V]: at 0.26 s, with `/init` starting at 0.28 s, because UFS is built in. The guard has flagged every partition by 0.61 s, and nothing is mounted before then. +- **The kernel's default sleep is `deep`** [V]: `/sys/power/mem_sleep` reads `s2idle [deep]` under Arch. Linux has no zuma SoC sleep sequence, so `omamobile-device-akita` makes Suspend use `s2idle`, as the Pixel 7 Pro's package does. +- **`NV_PARTS` names the radio's partitions only** (the Pixel 7 Pro's list, all present on akita). Other per-phone partitions it doesn't name: + - `mfg_data`: factory data, which the Pixel 7 Pro's fingerprint stack reads a copy of ([cheetah's FINGERPRINT-PLAN](../cheetah/FINGERPRINT-PLAN.md)); + - `trusty_persist`: Trusty's persistent storage ([tegu's FINGERPRINT-PLAN](../tegu/FINGERPRINT-PLAN.md)); + - `pinfo`, `fips` and `blenv`, whose contents haven't been read [I]. + + None is on `UFS_RW`, so the guard keeps them read-only, and all are in M2.4's full backup. Since stage 0's clean backup, `mfg_data`, `pinfo`, `fips` and `blenv` are unchanged, and `trusty_persist` changed (stock ran) [V]. +- **A second retail 8a passed M2.3, M2.4 and M2.6** on the same branch, with the same link, partition map and guard results ([#456](https://github.com/derekross/omarchy-mobile/pull/456)). + ## 2026-11-03: first light (M1.3) and the console (M1.4) Our kernel booted from slot B with the first-light board file, which has USB and no framebuffer. A second boot added the framebuffer. The steps and the builds are in [BRINGUP-M1](BRINGUP-M1.md). diff --git a/device/akita/build-u3-root b/device/akita/build-u3-root index 65fd74656..e3a674eec 100755 --- a/device/akita/build-u3-root +++ b/device/akita/build-u3-root @@ -3,8 +3,9 @@ # akita's test root image (BRINGUP-M2.md, M2.6), the one M2.7's rollback # reinstalls: Arch Linux ARM's base tarball, checked by tools/lib/alarm.sh, # with omamobile-device-akita staged by its own build and install, and the -# kernel modules of the slot B images. It needs no signed repository and runs -# no pacman, so it has no desktop and no omamobile-firstboot. +# kernel modules of the slot B images, indexed by depmod. It needs no signed +# repository and runs no pacman, so it has no desktop and no +# omamobile-firstboot. # # device/akita/build-u3-root KERNEL_OUT [OUT_DIR] # @@ -22,7 +23,7 @@ if [[ ${1:-} == --inside ]]; then export DEBIAN_FRONTEND=noninteractive apt-get -qq update >/dev/null apt-get -qq install -y --no-install-recommends libarchive-tools e2fsprogs zstd \ - gcc-aarch64-linux-gnu libc6-dev-arm64-cross >/dev/null + gcc-aarch64-linux-gnu libc6-dev-arm64-cross kmod >/dev/null R=/work/root mkdir -p $R bsdtar -xpf /in/alarm.tar.gz -C $R @@ -31,6 +32,12 @@ if [[ ${1:-} == --inside ]]; then /work/pkg/install $R /work/pkg-build mkdir -p $R/usr/lib/modules zstd -dc /in/modules.tar.zst | tar -C $R/usr/lib/modules -xf - + # The kernel build installs its modules without depmod (its container has + # no kmod), and this image runs no pacman, whose kmod hook would make the + # indexes: without modules.dep, modprobe finds nothing. Index the slot B + # kernel's release only; the base tarball brings its own kernel's modules. + depmod -b $R "$REL" + [ -s $R/usr/lib/modules/$REL/modules.dep ] || { echo "depmod wrote no modules.dep for $REL" >&2; exit 1; } # What install-phone writes into, and the phone's name install -d -m 0755 $R/etc/omamobile install -d -m 0700 $R/root/.ssh @@ -62,7 +69,7 @@ alarm_fetch name=omamobile-rootfs-u3-akita-aarch64 rm -f "$out/root.img" alarm_say "Assembling $name for $rel" -docker run --rm -e OUT_UID="$(id -u)" -e OUT_GID="$(id -g)" \ +docker run --rm -e OUT_UID="$(id -u)" -e OUT_GID="$(id -g)" -e REL="$rel" \ -v "$ALARM_TARBALL:/in/alarm.tar.gz:ro" \ -v "$repo/packages/omamobile-device-akita:/in/pkg:ro" \ -v "$modules:/in/modules.tar.zst:ro" \ diff --git a/device/akita/overlays/ufs-probe.dtso b/device/akita/overlays/ufs-probe.dtso index 328599006..ef6a9614a 100644 --- a/device/akita/overlays/ufs-probe.dtso +++ b/device/akita/overlays/ufs-probe.dtso @@ -6,6 +6,11 @@ * /run/ufs-probe.txt and the kernel log) and omamobile.initramfs (no * hand-over to Arch, so nothing runs on userdata). Set DTB_OVERLAYS="ufs-probe" * in device.conf for that build only. + * + * An overlay replaces bootargs whole, so these are a copy: zuma-akita.dts's + * bootargs as of linux-omarchy-mobile#206 (omamobile 75b9c0b73), unchanged + * since the first-light board file (#192). If the board file's change, + * copy them again before reusing this, or the overlay silently reverts them. */ /dts-v1/; /plugin/; diff --git a/packages/omamobile-device-akita/README.md b/packages/omamobile-device-akita/README.md index 2a4f96876..102ca29b1 100644 --- a/packages/omamobile-device-akita/README.md +++ b/packages/omamobile-device-akita/README.md @@ -8,6 +8,7 @@ Omarchy Mobile's first userspace package for the Google Pixel 8a (codename akita | `vendor/systemd/network/20-usb-gadget.network` | `/usr/lib/systemd/network` | Sets usb0 to 172.16.42.1/24 after handover, as the last gateway. A replug needs a reboot: this package does not close the MAX77759's USB2 switch again (the Pixel 8 Pro's rescue needs its `hsi2c_11` bus, which akita's board file doesn't have yet). Same file as the Pixel 8 Pro package | | `vendor/systemd/logind.conf.d/10-omamobile-power-key.conf` | `/usr/lib/systemd/logind.conf.d` | A short power press does not power the phone off. Same drop-in as the Pixel 7 Pro. akita's forced-reset combination under our kernel is untested; on the Pixel 8 Pro it is Power + Volume Up held 15-30 s | | `vendor/NetworkManager/conf.d/10-omamobile-usb.conf` | `/usr/lib/NetworkManager/conf.d` | Keeps NetworkManager off that link. Same file as the Pixel 8 Pro package | +| `vendor/systemd/sleep.conf.d/10-omamobile.conf` | `/usr/lib/systemd/sleep.conf.d` | Suspend means suspend-to-idle. The kernel's default on the 8a is `deep` (`/sys/power/mem_sleep` reads `s2idle [deep]`), which Linux can't wake from on zuma yet. No hibernation: there is no swap. The settings are the Pixel 7 Pro's; the test checks. Suspend itself is still untested on Tensor G3 (the Pixel 8 Pro's UFS-PLAN, U6) | | `etc/omamobile-mirrorlist` | `/etc/pacman.d/omamobile-mirrorlist` | Where pacman finds the `[omamobile]` repository. Same file as the Pixel 7 Pro package | | `omamobile-device-akita.install` | pacman hook | Adds `[omamobile]` to `pacman.conf` before `[omarchy]`, once, and keeps the channel a phone follows. Same script as the Pixel 7 Pro package | | `src/reboot-to.c` | `/usr/bin/reboot-to` | Reboot with a reason the bootloader understands (`reboot-to bootloader` reaches fastboot on akita, [BRINGUP-M1](../../device/akita/BRINGUP-M1.md) test 3). Same bytes as the Pixel 7 Pro package; the test checks | diff --git a/packages/omamobile-device-akita/install b/packages/omamobile-device-akita/install index 181078ecd..17c516fdc 100755 --- a/packages/omamobile-device-akita/install +++ b/packages/omamobile-device-akita/install @@ -17,6 +17,8 @@ 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 vendor/systemd/sleep.conf.d/10-omamobile.conf \ + "$destination/usr/lib/systemd/sleep.conf.d/10-omamobile.conf" install -Dm644 device.conf \ "$destination/usr/share/omamobile/device.conf" install -Dm644 etc/omamobile-mirrorlist \ diff --git a/packages/omamobile-device-akita/test/all b/packages/omamobile-device-akita/test/all index b49e002bb..c46f8d81e 100755 --- a/packages/omamobile-device-akita/test/all +++ b/packages/omamobile-device-akita/test/all @@ -39,6 +39,11 @@ if [[ -f ../omamobile-device-cheetah/src/reboot-to.c ]]; then ../omamobile-device-cheetah/omamobile-device-cheetah.install \ || fail "the pacman install script drifted from the cheetah package" pass "the pacman install script matches the cheetah package" + # Its comment names zuma, cheetah's gs201: the settings are what must match + sleep=vendor/systemd/sleep.conf.d/10-omamobile.conf + [[ $(grep -v '^#' "$sleep") == "$(grep -v '^#' "../omamobile-device-cheetah/$sleep")" ]] \ + || fail "the sleep drop-in's settings drifted from the cheetah package" + pass "the sleep drop-in's settings match the cheetah package" fi # The USB link's two files come from the Pixel 8 Pro's package, the other # zuma phone. @@ -73,14 +78,19 @@ for f in usr/bin/reboot-to \ usr/lib/systemd/network/20-usb-gadget.network \ usr/lib/systemd/logind.conf.d/10-omamobile-power-key.conf \ usr/lib/NetworkManager/conf.d/10-omamobile-usb.conf \ + usr/lib/systemd/sleep.conf.d/10-omamobile.conf \ usr/share/omamobile/device.conf \ usr/share/omamobile/device-akita/version \ usr/share/licenses/omamobile-device-akita/LICENSE \ etc/pacman.d/omamobile-mirrorlist; do [[ -f $tmp/root/$f ]] || fail "install stages $f" done -[[ $(find "$tmp/root" -type f -o -type l | wc -l) -eq 9 ]] \ - || fail "install stages exactly these nine files: $(cd "$tmp/root" && find . -type f -o -type l | sort | tr '\n' ' ')" +[[ $(find "$tmp/root" -type f -o -type l | wc -l) -eq 10 ]] \ + || fail "install stages exactly these ten files: $(cd "$tmp/root" && find . -type f -o -type l | sort | tr '\n' ' ')" +grep -qx 'MemorySleepMode=s2idle' "$tmp/root/usr/lib/systemd/sleep.conf.d/10-omamobile.conf" \ + || fail "suspend must use s2idle: the kernel's default is deep, which zuma can't wake from yet" +grep -qx 'AllowHibernation=no' "$tmp/root/usr/lib/systemd/sleep.conf.d/10-omamobile.conf" \ + || fail "there is no swap to hibernate to" grep -q 'KERNEL=="sda", MODE="0000"' "$tmp/root/usr/lib/udev/rules.d/10-omamobile-storage.rules" \ || fail "the whole-disk node is made inaccessible" grep -q 'ID_PART_ENTRY_NAME}!="userdata"' "$tmp/root/usr/lib/udev/rules.d/10-omamobile-storage.rules" \ diff --git a/packages/omamobile-device-akita/vendor/systemd/sleep.conf.d/10-omamobile.conf b/packages/omamobile-device-akita/vendor/systemd/sleep.conf.d/10-omamobile.conf new file mode 100644 index 000000000..dba8611a5 --- /dev/null +++ b/packages/omamobile-device-akita/vendor/systemd/sleep.conf.d/10-omamobile.conf @@ -0,0 +1,12 @@ +# SPDX-License-Identifier: MIT +# The firmware advertises PSCI SYSTEM_SUSPEND, so the kernel offers "deep" +# sleep, and on the 8a it is the default (/sys/power/mem_sleep reads +# "s2idle [deep]", device/akita/BRINGUP-M2.md, M2.6). Linux has no zuma SoC +# sleep sequence yet, so entering it would not wake, as on the Pixel 7 Pro +# (device/cheetah/SUSPEND-PLAN.md, sections 1 and 5). Suspend means +# suspend-to-idle until one exists. There is no swap to hibernate to. +[Sleep] +MemorySleepMode=s2idle +AllowHibernation=no +AllowHybridSleep=no +AllowSuspendThenHibernate=no