diff --git a/bin/omamobile b/bin/omamobile index b43e609ad..7dfcc4561 100755 --- a/bin/omamobile +++ b/bin/omamobile @@ -123,8 +123,8 @@ load_device() { fi done < "$file" case $DEV_BOOT_METHOD in - android-v4|qcom-abl) ;; - *) die "$file: unsupported BOOT_METHOD=$DEV_BOOT_METHOD; this command supports android-v4 and qcom-abl" ;; + android-v4|android-v0|qcom-abl) ;; + *) die "$file: unsupported BOOT_METHOD=$DEV_BOOT_METHOD; this command supports android-v4, android-v0 and qcom-abl" ;; esac [[ $DEV_CODENAME == "$DEVICE" ]] || die "$file: CODENAME=$DEV_CODENAME, expected $DEVICE" # Safety: the guard's allowlist may name slot B's boot images and userdata @@ -143,7 +143,25 @@ load_device() { done [[ $seen_rw == *" userdata "* ]] || die "$file: UFS_RW must include userdata" - if [[ $DEV_BOOT_METHOD == qcom-abl ]]; then + if [[ $DEV_BOOT_METHOD == android-v0 ]]; then + # One header-v0 boot.img: a gzip kernel with the board DTB appended, the + # shared initramfs and CMDLINE, at the load offsets the descriptor gives + # (enchilada). No dtbo, no vendor_boot, no device package needed yet: + # images makes it for `fastboot boot`; flash, push, fastboot and the + # installer refuse it until a slot-B install has a CONTRIBUTING.md §3.1 + # entry. + for key in CODENAME SOC DTB BOOT_IMAGES UFS_RW INITRAMFS_INIT PANEL_SIZE; do + p="DEV_$key" + [[ -n ${!p:-} ]] || die "$file: $key is missing" + done + for key in PAGESIZE BASE KERNEL_OFFSET RAMDISK_OFFSET SECOND_OFFSET TAGS_OFFSET; do + p="DEV_$key" + [[ ${!p:-} =~ ^(0x[0-9a-f]+|[0-9]+)$ ]] || die "$file: $key is missing or not a number" + done + [[ $DEV_PAGESIZE =~ ^(2048|4096|8192|16384)$ ]] || die "$file: PAGESIZE must be 2048, 4096, 8192 or 16384" + [[ $DEV_BOOT_IMAGES == boot ]] || die "$file: android-v0 BOOT_IMAGES may hold only boot" + slot_b_allowed boot || die "$file: boot_b is not in UFS_RW" + elif [[ $DEV_BOOT_METHOD == qcom-abl ]]; then for key in CODENAME SOC PACKAGE DTB BOOT_IMAGES UFS_RW INITRAMFS_INIT PANEL_SIZE; do p="DEV_$key" [[ -n ${!p:-} ]] || die "$file: $key is missing" @@ -781,6 +799,8 @@ cmd_images() { if [[ $DEV_BOOT_METHOD != qcom-abl ]]; then [[ -f $tools/mkbootimg.py ]] || die "no mkbootimg.py in $tools: run tools/fetch-toolchain, or set SRC_DIR to an Android checkout (or MKBOOTIMG_DIR)" + fi + if [[ $DEV_BOOT_METHOD == android-v4 ]]; then [[ -f $MKDTBOIMG ]] || die "no mkdtboimg.py at $MKDTBOIMG: run tools/fetch-toolchain, or set SRC_DIR to an Android checkout (or MKDTBOIMG)" fi @@ -803,6 +823,26 @@ cmd_images() { dtb="$img/$DEV_CODENAME-overlaid.dtb" fi + if [[ $DEV_BOOT_METHOD == android-v0 ]]; then + # This ABL gunzips the kernel and takes the DTB appended to it; the + # ramdisk is the shared initramfs. gzip -n keeps no name or time, so + # the bytes depend only on the inputs. + say "Boot image (header v0, DTB appended to the gzip kernel): $DEV_DTB" + gzip -9 -n -c "$boot/Image" > "$img/Image.gz" + cat "$img/Image.gz" "$dtb" > "$img/Image.gz-dtb" + python3 "$tools/mkbootimg.py" --header_version 0 \ + --kernel "$img/Image.gz-dtb" --ramdisk "$KERNEL_OUT/initramfs.cpio.lz4" \ + --cmdline "${DEV_CMDLINE:-}" --pagesize "$DEV_PAGESIZE" --base "$DEV_BASE" \ + --kernel_offset "$DEV_KERNEL_OFFSET" --ramdisk_offset "$DEV_RAMDISK_OFFSET" \ + --second_offset "$DEV_SECOND_OFFSET" --tags_offset "$DEV_TAGS_OFFSET" \ + --output "$img/boot.img" || die "mkbootimg failed" + rm -f "$img/Image.gz" + printf '%s\n' "$DEV_CODENAME" > "$img/DEVICE" + ls -lh "$img"/*.img + sha256sum "$img/boot.img" + return 0 + fi + say "Kernel: Image.lz4" lz4 -l -9 -f -q "$boot/Image" "$img/Image.lz4" @@ -1058,6 +1098,10 @@ cmd_fastboot() { # Qualcomm ABL panic path is uncharacterized on dodge (sysrq-c fallthrough # when reboot-to bootloader is ignored). Refuse before any phone I/O; use # the buttons instead (see device/$DEVICE/BRINGUP-M1.md). + # android-v0 (enchilada): no slot-B install yet, so a crash here would + # land on whatever the phone's other slot holds; use the buttons. + [[ $DEV_BOOT_METHOD != android-v0 ]] || + die "fastboot refuses BOOT_METHOD=android-v0 (RAM-only: reach fastboot by the buttons, see device/$DEVICE/NOTES.md)" [[ $DEV_BOOT_METHOD != qcom-abl ]] || die "fastboot refuses BOOT_METHOD=qcom-abl (panic path uncharacterized on this ABL; use the buttons — see device/$DEVICE/BRINGUP-M1.md)" in_fastboot && { say "Already in fastboot"; return 0; } @@ -1093,6 +1137,9 @@ cmd_flash() { # successful and refill retries; the bit-54 mark has no §3.1 entry yet. # Refuse here; day-2 updates use push once that path is viable, and the # installer PR can reopen flash with the rest. + # android-v0: RAM-only until a slot-B install has its §3.1 entry + [[ $DEV_BOOT_METHOD != android-v0 ]] || + die "flash refuses BOOT_METHOD=android-v0 (RAM-only: fastboot boot \$KERNEL_OUT/images/boot.img)" [[ $DEV_BOOT_METHOD != qcom-abl ]] || die "flash refuses BOOT_METHOD=qcom-abl (no in-tree day-2 update path yet; see device/$DEVICE/BRINGUP-M1.md)" images_for_device "$img" @@ -1130,6 +1177,8 @@ cmd_push() { # Same class of refusal as flash: boot_b is on sde here, and there is no # in-tree day-2 rewrite path for qcom-abl yet. Refuse before any phone I/O # (modules-push would otherwise rewrite the running root's modules). + [[ $DEV_BOOT_METHOD != android-v0 ]] || + die "push refuses BOOT_METHOD=android-v0 (RAM-only: fastboot boot \$KERNEL_OUT/images/boot.img)" [[ $DEV_BOOT_METHOD != qcom-abl ]] || die "push refuses BOOT_METHOD=qcom-abl (no in-tree day-2 update path yet; see device/$DEVICE/BRINGUP-M1.md)" images_for_device "$img" diff --git a/device/enchilada/NOTES.md b/device/enchilada/NOTES.md index 5e9723616..96e8deb34 100644 --- a/device/enchilada/NOTES.md +++ b/device/enchilada/NOTES.md @@ -29,8 +29,8 @@ tried yet; it is next. **Slot A does not hold stock Android.** This is a §3.1 event, recorded here as the maintainer asked on #432. Putting stock back on slot A is -outside the project: this tree only writes slot B and `userdata`, and -never `vbmeta`. If it is done, it is the owner's own step, with +outside the project ([the maintainer's decision on #432](https://github.com/derekross/omarchy-mobile/issues/432#issuecomment-6708103355)): +this tree only writes slot B and `userdata`, and never `vbmeta`. If it is done, it is the owner's own step, with OnePlus's own images, and it is recorded on #432 (slot flags before and after, what was flashed and from which image, then a fresh read-only radio backup). The owner has decided not to restore it, so @@ -66,30 +66,27 @@ three steps of 2026-11-05: that reply was posted at 16:13 (21:13 UTC), and `flash boot_b` (netfilter kernel), `--set-active=a` and the package install into `userdata` ran from 16:15 to about 16:20, before I had read it. Since then the only commands sent to the phone have been the read-only -backup, one `fastboot boot` (2026-11-05 16:35) and `getvar` (below). No +backup, one `fastboot boot` (2026-11-05 16:35), `getvar` and one rescue +boot to read the slot flags again (below). No slot flag is written again until this phone has a per-device entry in CONTRIBUTING.md. -**Slot flags** (`fastboot getvar all`, read-only): +**Slot flags** (read-only; `fastboot getvar all`, except the last row): | Read | `current-slot` | A: successful / unbootable / retry-count | B: successful / unbootable / retry-count | | --- | --- | --- | --- | | 2026-11-04, before any write of this port | a | no / no / 6 | yes / no / 7 | -| 2026-11-07, now | a | no / no / 5 | no / no / 7 | +| 2026-11-07 | a | no / no / 5 | no / no / 7 | +| 2026-11-07, after one more rescue boot, read in the rescue from `sde`'s GPT attributes (`sfdisk --dump`) | a | no / no / 5 | no / no / 7 | Between the two reads, B lost its successful mark (left by the third-party build; `--set-active=b` clears it and nothing of this port marks a slot) and A's retry count went from 6 to 5. Neither slot is marked unbootable. -Slot A is not marked successful, so each boot of the rescue may spend one -of its tries. If ABL works as on other Qualcomm phones, `--set-active=a` -on 2026-11-05 reset A's count to 7, and the rescue boots since (including -the reboot after a `fastboot boot` panics with no USB host) took it to 5. -At 0 ABL would switch to slot B and run B's tries down too, and since -nothing here may mark a slot, the phone would then stop in fastboot and -need a `--set-active` to come back. This is not confirmed yet: one more -`getvar` after the next rescue boot will tell. Until then, rescue boots -are kept few. +Slot A is not marked successful, but a rescue boot does not spend one of +its tries here: after one more rescue boot A was still at 5 and B at 7 +([#432](https://github.com/derekross/omarchy-mobile/issues/432#issuecomment-6716747930)). What took A from 6 to 5 between the first two reads is not +known. Neither slot is near 0. **The slot-A rescue.** It is not the shared init and has no initramfs (an empty ramdisk): the kernel mounts `system_a` from the `root=` that ABL diff --git a/device/enchilada/device.conf b/device/enchilada/device.conf index 40d415f20..a9e0e4d0c 100644 --- a/device/enchilada/device.conf +++ b/device/enchilada/device.conf @@ -4,12 +4,11 @@ # # RAM-only bring-up: this ABL boots an Android boot image header v0 holding # a gzip kernel with the DTB appended (no dtbo, no vendor_boot), booted with -# `fastboot boot`, so nothing is written. No packer in this tree makes that -# image yet, so images, flash, push and the installer all refuse -# BOOT_METHOD=android-v0 before touching a phone (tests/boot-method). The -# header-v0 packer is a separate change; flash, push and the installer keep -# refusing it until the slot-B install and its CONTRIBUTING.md §3.1 entry -# are agreed. +# `fastboot boot`, so nothing is written. `omamobile images` packs that +# boot.img from the header fields below (tests/images-layout); fastboot, +# flash, push and the installer refuse BOOT_METHOD=android-v0 before +# touching a phone (tests/boot-method), and keep refusing it until the +# slot-B install and its CONTRIBUTING.md §3.1 entry are agreed. # # Storage: userdata is on sda, but boot_* sit on LUN sde, so the shared # init's sda-only guard keeps boot_b read-only (the same split as dodge). diff --git a/docs/DEVICES.md b/docs/DEVICES.md index 6deb59bec..c21371bfc 100644 --- a/docs/DEVICES.md +++ b/docs/DEVICES.md @@ -30,7 +30,7 @@ The status of each device, as verified on real hardware. Rows in the matrix have | Pixel 8a ([notes](../device/akita/NOTES.md)) | akita | zuma (Tensor G3) | WIP ([#1](https://github.com/derekross/omarchy-mobile/issues/1): slot B into the initramfs with USB and SSH, no Arch root yet; `reboot-to bootloader` reaches fastboot; the first-light board file is merged, [kernel #192](https://github.com/derekross/linux-omarchy-mobile/pull/192); [BRINGUP-M1](../device/akita/BRINGUP-M1.md), [notes](../device/akita/NOTES.md#2026-11-03-first-light-m13-and-the-console-m14)) | WIP (UFS at HS-G4 behind the read-only guard, from the initramfs only, nothing run on `userdata`; merged, [kernel #206](https://github.com/derekross/linux-omarchy-mobile/pull/206); the device package and storage plan are in review, [#456](https://github.com/derekross/omarchy-mobile/pull/456)) | WIP (simple-framebuffer: the boot console over Omarchy's splash; merged with [kernel #192](https://github.com/derekross/linux-omarchy-mobile/pull/192); [notes](../device/akita/NOTES.md#2026-11-03-first-light-m13-and-the-console-m14)) | no | no | no | testing (USB and SSH from the initramfs; merged with [kernel #192](https://github.com/derekross/linux-omarchy-mobile/pull/192)) | no | no | no | no | no | no | no | no | no | no | no | no | no | no | no | | 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 and GPU results booted 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 | +| 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 | | *Template* | *codename* | *SoC* | | | | | | | | | | | | | | | | | | | | | | | ## cheetah (Pixel 7 Pro) in detail @@ -80,5 +80,5 @@ Devices we'd like to support, with the closest starting point. Open an issue to | 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 | | POCO F3 | alioth | SM8250 (Snapdragon 870) | the first non-Pixel port: a guarded installer and root image in review ([#25](https://github.com/derekross/omarchy-mobile/pull/25)) | | OnePlus 13 | dodge | SM8750 (Snapdragon 8 Elite) | **WIP, community port**, in the matrix above: device files, notes and the qcom-abl boot images merged ([#111](https://github.com/derekross/omarchy-mobile/pull/111)); its kernel stays in the contributor's fork ([mrlund/linux-omarchy-mobile `dodge-v3-20261101`](https://github.com/mrlund/linux-omarchy-mobile/tree/dodge-v3-20261101); [kernel #115](https://github.com/derekross/linux-omarchy-mobile/pull/115) closed: the SoC series is out of this tree's scope); the guarded installer follows in a later pull request | -| OnePlus 6 | enchilada | SDM845 (Snapdragon 845) | **WIP, community port: [#432](https://github.com/derekross/omarchy-mobile/issues/432)**, in the matrix above: descriptor and notes; RAM-only (`fastboot boot`) until the slot-B install and its CONTRIBUTING.md §3.1 entry are agreed; the header-v0 packer and a LUN-aware `UFS_RW` follow in their own pull requests | +| 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 a LUN-aware `UFS_RW` follows in its own pull request | | PinePhone Pro | pinephone-pro | Rockchip RK3399S | No port in this tree yet; mainline's `rk3399-pinephone-pro.dts` is already in our kernel. Prior art: [Omarchy on the PinePhone Pro](https://github.com/FlorencioJP/omarchy-mobile-pinephone-pro) | diff --git a/docs/RELEASES.md b/docs/RELEASES.md index 27941295c..ac96ac586 100644 --- a/docs/RELEASES.md +++ b/docs/RELEASES.md @@ -76,7 +76,8 @@ 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 | +| `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 | +| `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`) | | `UFS_RW` | `boot_b … dtbo_b userdata` | The storage guard's allowlist, packed into the initramfs as `/etc/omamobile-ufs-rw`. Only slot B's boot images (`boot_b`, `init_boot_b`, `vendor_boot_b`, `vendor_kernel_boot_b`, `dtbo_b`) and `userdata` are accepted, `userdata` and every `BOOT_IMAGES` entry must be on it, and each name only once. The init fails closed: a missing, empty or malformed file, or any other name in it, leaves every partition read-only | | `INITRAMFS_INIT` | `/initramfs/init` | The init script. A leading `/` is relative to the repo root, so devices share one script. Any other value is relative to the descriptor | diff --git a/tests/boot-method b/tests/boot-method index f83b84aa6..b82730452 100755 --- a/tests/boot-method +++ b/tests/boot-method @@ -19,7 +19,7 @@ done export PATH="$t/bin:$PATH" CALLS="$t/calls" unset KERNEL_OUT KERNEL_DIR KERNEL_BASE WORK || true fail() { echo "not ok - $*" >&2; cat "$t/log" >&2; exit 1; } -for method in ram-only uboot-ext4 android-v0 unknown ''; do +for method in ram-only uboot-ext4 unknown ''; do printf 'CODENAME=probe\nBOOT_METHOD="%s"\nBOOT_IMAGES=""\nUFS_RW=""\n' "$method" > "$t/repo/device/probe/device.conf" cp "$t/repo/device/probe/device.conf" "$t/bundle/device.conf" for cmd in images flash push; do @@ -42,20 +42,40 @@ if "$t/repo/tools/install-phone" --device flame > "$t/log" 2>&1; then fail "flam grep -q 'unsupported BOOT_METHOD=ram-only;' "$t/log" || fail "flame fails for the wrong reason" echo 'ok - the shipped flame descriptor has no persistent installer path' -# The shipped enchilada descriptor: android-v0 has no packer here, so every -# path that would make or write an image refuses it before phone access. +# The shipped enchilada descriptor: android-v0 images get past the +# descriptor checks (no kernel build here, so they stop at "build the +# kernel first"); fastboot, flash and push refuse it as RAM-only, and the +# installer still refuses the method. None of it reaches a phone. mkdir -p "$t/repo/device/enchilada" cp device/enchilada/device.conf "$t/repo/device/enchilada/" -for cmd in images flash push; do +if DEVICE=enchilada KERNEL_OUT="$t/no-kernel" "$t/repo/bin/omamobile" images > "$t/log" 2>&1; then fail "enchilada images succeeds without a kernel"; fi +grep -q 'build the kernel first' "$t/log" || fail "enchilada images fails for the wrong reason" +for cmd in fastboot flash push; do if DEVICE=enchilada "$t/repo/bin/omamobile" "$cmd" > "$t/log" 2>&1; then fail "enchilada $cmd succeeds"; fi - grep -q 'unsupported BOOT_METHOD=android-v0;' "$t/log" || fail "enchilada $cmd fails for the wrong reason" + grep -q "$cmd refuses BOOT_METHOD=android-v0" "$t/log" || fail "enchilada $cmd fails for the wrong reason" done for dry in '' --dry-run; do if "$t/repo/tools/install-phone" --device enchilada $dry --work "$t/work" > "$t/log" 2>&1; then fail "enchilada installs"; fi grep -q 'unsupported BOOT_METHOD=android-v0;' "$t/log" || fail "enchilada installer fails for the wrong reason" done [[ ! -e $t/calls && ! -e $t/work ]] || fail "the enchilada descriptor accessed a phone or prepared an image" -echo 'ok - the shipped enchilada descriptor is refused by images/flash/push and both installer modes' +echo 'ok - enchilada images reach the kernel check; fastboot/flash/push and both installer modes refuse android-v0' + +# Header fields must be present and numeric; BOOT_IMAGES is boot only and +# boot_b must be writable. +mkdir -p "$t/repo/device/v0probe" +v0bad() { # sed expression, expected message + sed -e "s/^CODENAME=.*/CODENAME=v0probe/" -e "$1" device/enchilada/device.conf > "$t/repo/device/v0probe/device.conf" + if DEVICE=v0probe KERNEL_OUT="$t/no-kernel" "$t/repo/bin/omamobile" images > "$t/log" 2>&1; then fail "v0 descriptor accepted: $1"; fi + grep -q "$2" "$t/log" || fail "v0 descriptor '$1' fails for the wrong reason" +} +v0bad '/^PAGESIZE=/d' 'PAGESIZE is missing or not a number' +v0bad 's/^TAGS_OFFSET=.*/TAGS_OFFSET=0x10g/' 'TAGS_OFFSET is missing or not a number' +v0bad 's/^PAGESIZE=.*/PAGESIZE=4097/' 'PAGESIZE must be' +v0bad 's/^BOOT_IMAGES=.*/BOOT_IMAGES="boot dtbo"/' 'BOOT_IMAGES may hold only boot' +v0bad 's/^UFS_RW=.*/UFS_RW=userdata/' 'boot_b is not in UFS_RW' +[[ ! -e $t/calls ]] || fail "a v0 descriptor check accessed a phone" +echo 'ok - android-v0 header fields, BOOT_IMAGES and UFS_RW are checked' # qcom-abl is accepted by images only when device/$DEVICE/chainload/ exists # (installer still refuses until a later PR). flash and push both refuse diff --git a/tests/images-layout b/tests/images-layout index 1955f54ab..9a70d97c4 100755 --- a/tests/images-layout +++ b/tests/images-layout @@ -15,7 +15,9 @@ # gives boot and init_boot hash footers at their partition sizes (when # external/avb is under $SRC_DIR); without the zuma keys the gs201 and gs101 # images match the tool at $IMAGES_BASELINE (default 1e7a998, the last tool -# before them) byte for byte. Only the image tests skip, when AOSP's mkbootimg +# before them) byte for byte; an android-v0 (header v0) descriptor yields +# one boot.img: the gzip kernel with its DTB appended, the initramfs, the +# descriptor's load offsets and CMDLINE. Only the image tests skip, when AOSP's mkbootimg # isn't under $SRC_DIR, or no dtc is found: $DTC, then dtc on PATH, then a # kernel build's scripts/dtc/dtc ($KERNEL_OUT, or ~/android/mainline/out*). set -euo pipefail @@ -328,6 +330,50 @@ cmp -s "$K/images/dtb.img" "$dts/zuma-eight.dtb" || fail "zuma layout: dtb.img i unpack vendor_kernel_boot cmp -s "$t/u/vendor_kernel_boot/dtb" "$dts/zuma-eight.dtb" || fail "zuma layout: vendor_kernel_boot carries the DTB" pass "zuma-style descriptor (SOC_COMPATIBLE): the DTB once, in vendor_kernel_boot" + +# android-v0 (enchilada-style): one header-v0 boot.img, a gzip kernel with +# the DTB appended, the initramfs as its ramdisk, at the descriptor's load +# offsets; nothing else is made, and the bytes repeat run to run +mkdir -p "$R/device/vzero" "$K/arch/arm64/boot/dts/qcom" +cat > "$R/device/vzero/device.conf" <<'EOF2' +CODENAME=vzero +NAME="Test vzero" +SOC=sdm845 +COMPATIBLE="oneplus,vzero" +BOOT_METHOD=android-v0 +DTB=qcom/sdm845-vzero.dtb +INITRAMFS_INIT=initramfs/init +PANEL_SIZE=1080x2280 +PAGESIZE=4096 +BASE=0x00000000 +KERNEL_OFFSET=0x00008000 +RAMDISK_OFFSET=0x01000000 +SECOND_OFFSET=0x00f00000 +TAGS_OFFSET=0x00000100 +BOOT_IMAGES=boot +UFS_RW="boot_b userdata" +CMDLINE="console=tty0 panic=10 omamobile.initramfs" +EOF2 +printf '/dts-v1/;\n/ {\n\tcompatible = "oneplus,vzero", "qcom,sdm845";\n\t#address-cells = <2>;\n\t#size-cells = <2>;\n\tchosen { };\n};\n' \ + | "$dtc" -q -I dts -O dtb -o "$K/arch/arm64/boot/dts/qcom/sdm845-vzero.dtb" - +om vzero images || { cat "$t/log"; fail "images builds the android-v0 layout"; } +[[ $(built) == "boot.img " ]] || fail "android-v0 layout: boot.img only (got $(built))" +unpack boot +# (mkbootimg leaves the second-stage address 0 when there is no second +# stage, so SECOND_OFFSET does not show in the header) +[[ $(field boot 'boot image header version') == 0 ]] || fail "android-v0 layout: header version 0" +[[ $(field boot 'page size') == 4096 ]] || fail "android-v0 layout: page size 4096 (got $(field boot 'page size'))" +[[ $(field boot 'kernel load address') == 0x00008000 && $(field boot 'ramdisk load address') == 0x01000000 && + $(field boot 'kernel tags load address') == 0x00000100 ]] \ + || { cat "$t/u/boot.txt"; fail "android-v0 layout: load addresses from BASE and the offsets"; } +[[ $(field boot 'command line args') == "console=tty0 panic=10 omamobile.initramfs" ]] || fail "android-v0 layout: CMDLINE" +cmp -s "$t/u/boot/kernel" <(gzip -9 -n -c "$K/arch/arm64/boot/Image"; cat "$K/arch/arm64/boot/dts/qcom/sdm845-vzero.dtb") \ + || fail "android-v0 layout: the kernel is the gzip Image with the DTB appended" +cmp -s "$t/u/boot/ramdisk" "$K/initramfs.cpio.lz4" || fail "android-v0 layout: the ramdisk is the initramfs" +[[ $(cat "$K/images/DEVICE") == vzero ]] || fail "images records the device" +vzero_sum=$(sha256sum < "$K/images/boot.img") +om vzero images && [[ $(sha256sum < "$K/images/boot.img") == "$vzero_sum" ]] || fail "android-v0 images are deterministic" +pass "android-v0 descriptor: one header-v0 boot.img (gzip kernel + DTB, initramfs, offsets, CMDLINE), deterministic" cp "$R/device/eight/device.conf" "$t/eight.conf" sed -i 's/b1-foplp:0x9865:1:1:0/b1-foplp:0x9865:1:2:0/' "$R/device/eight/device.conf" if om eight images; then fail "images refuses a DTB whose /soc_compatible differs from SOC_COMPATIBLE"; fi