diff --git a/device/bluejay/NOTES.md b/device/bluejay/NOTES.md index 0e804fbb2..f9761a39e 100644 --- a/device/bluejay/NOTES.md +++ b/device/bluejay/NOTES.md @@ -117,6 +117,12 @@ The question the notes left open, and that the maintainer wants settled before a From a retail 6a, read-only, before anything is written (CONTRIBUTING ยง5.1 first): `getvar all` (product, slot state, the partition list and sizes, `hw-revision`), `ro.boot.dtbo_idx`, the build id and security patch; with root or `bin/omamobile capture`, the live DT (which `soc_id`, `/chosen/bootargs`, every `reserved-memory` region against `/proc/iomem`). Post facts, never the files. Then the board DTS's DTB in a kernel build (`DEVICE=bluejay bin/omamobile images`, which now adds `boot`'s footer), the oriole initramfs path, and a human at the phone with the way back to slot A. +## 2026-11-02: the device package, 0.1.0, built but not run (no phone) + +- **`packages/omamobile-device-bluejay` 0.1.0 is the package `device.conf` names.** It is felix's first-light shape without the fold's lid and cover-touch parts, plus the suspend-to-idle drop-in: the storage udev rule, the usb0 address with USB as the last gateway, NetworkManager off usb0, logind ignoring the power key, `[Sleep]` on s2idle with no hibernation, the `[omamobile]` mirrorlist and pacman hook, `reboot-to` and a copy of the descriptor; `provides`/`conflicts=(omamobile-device)` and `depends` on `omamobile-keyring`, so `tools/build-rootfs` can build a 6a image with the repository configured. It enables no service, ships no modprobe policy and no `omamobile-bootctl` (marking slot B on the gs101 phones is on hold, [#252](https://github.com/derekross/omarchy-mobile/issues/252)), so `bin/omamobile initramfs` builds its freestanding helpers, as for oriole. +- **Why the sleep drop-in** [V]: raven's firmware advertises PSCI SYSTEM_SUSPEND, so the kernel offers `deep`, and Linux has no gs101 sleep sequence, so the phone doesn't wake from it ([raven's package](../../packages/omamobile-device-raven/vendor/systemd/sleep.conf.d/10-omamobile.conf), device/raven/SUSPEND-PLAN.md). Bluejay's `/chosen/bootargs` (kernel #179) don't set `mem_sleep_default=s2idle`, as oriole's don't, so the file is what keeps `systemctl suspend` on s2idle; the maintainer asked for it in the kernel #179 review. The file is raven's, byte for byte, and the package's test checks it. +- **What was checked** [V]: `test/all` (every copied file against cheetah's or raven's, the descriptor against `device/bluejay/device.conf`, no register write or probe in it, the staged tree with nothing that marks a slot, loads a driver or starts hardware) and `tests/packages`, on the laptop. Not checked: a build with `makepkg` on aarch64, an install on a 6a, and `tools/phone-smoke`, which wait for the first boot. + ## 2026-11-01: stage 0, part 1: facts from Google's GPL device trees (no phone, no factory image) ### Base DTB and `soc_id` @@ -160,7 +166,7 @@ The descriptor carries no comments; this table is its provenance. | --- | --- | --- | --- | | `CODENAME`, `NAME`, `SOC` | bluejay, Pixel 6a, gs101 | [V] | G/, the kernel binding | | `COMPATIBLE` | `google,gs101-bluejay` | [V] | the first-light DTS and its binding entry | -| `PACKAGE` | `omamobile-device-bluejay` | the package doesn't exist yet; `bin/omamobile initramfs` falls back when its `omamobile-bootctl.c` is missing, as for oriole | | +| `PACKAGE` | `omamobile-device-bluejay` | [V] | [`packages/omamobile-device-bluejay`](../../packages/omamobile-device-bluejay) 0.1.0 (2026-11-02 above); it has no `omamobile-bootctl.c`, so `bin/omamobile initramfs` builds its freestanding helpers, as for oriole | | `DTB` | `exynos/google/gs101-bluejay.dtb` | [V] | the Makefile line in [kernel #179](https://github.com/derekross/linux-omarchy-mobile/pull/179), merged; `DEVICE=bluejay bin/omamobile images` builds from a kernel after it | | `SOC_IDS` | `b0:0x9845001 a0:0x9845000` | [V] | S/ `gs101-b0.dts`, `gs101-a0.dts` | | `DTBO_SOURCE`, `DTBO_BOARD_ID`, `DTBO_BOARD_REV` | the empty overlay, 0x20506, 0x10000 | [V] for the MP 1.0 entry (index 9 of stock's `dtbo.img`), [I] that retail boots it | G/ `gs101-bluejay-mp1_0.dts`; F/ `dtbo.img` (2026-11-02) | diff --git a/docs/DEVICES.md b/docs/DEVICES.md index d8de37503..815a27b3f 100644 --- a/docs/DEVICES.md +++ b/docs/DEVICES.md @@ -71,7 +71,7 @@ Devices we'd like to support, with the closest starting point. Open an issue to | Pixel Tablet | tangorpro | gs201 | as panther; no modem | | Pixel 6 | oriole | gs101 | **WIP, community port: [#2](https://github.com/derekross/omarchy-mobile/issues/2)**; our preferred second device. Upstream mainline `gs101-oriole.dts` | | Pixel 6 Pro | raven | gs101 | upstream mainline `gs101-raven.dts`; shares oriole's port ([#2](https://github.com/derekross/omarchy-mobile/issues/2)). Boots our kernel from slot B to Omarchy's Hyprland on the Mali-G78 ([kernel #2](https://github.com/derekross/linux-omarchy-mobile/pull/2), [#3](https://github.com/derekross/linux-omarchy-mobile/pull/3)); its device package and plans ([#41](https://github.com/derekross/omarchy-mobile/pull/41)) and provisioning tools ([#22](https://github.com/derekross/omarchy-mobile/pull/22)) are merged | -| Pixel 6a | bluejay | gs101 | **WIP, community port: [#348](https://github.com/derekross/omarchy-mobile/issues/348)**; persistent Arch/Omarchy desktop on a development kernel ([notes](../device/bluejay/NOTES.md)); polling touch ([kernel #229](https://github.com/derekross/linux-omarchy-mobile/pull/229)), station Wi-Fi ([#227](https://github.com/derekross/linux-omarchy-mobile/pull/227), [#228](https://github.com/derekross/linux-omarchy-mobile/pull/228), [#230](https://github.com/derekross/linux-omarchy-mobile/pull/230)) and Panfrost GPU are development-kernel results, not release support; display is retained simpledrm, native panel modesetting unqualified; source/reproduction limits in [UPSTREAM](../device/bluejay/UPSTREAM.md) | +| Pixel 6a | bluejay | gs101 | **WIP, community port: [#348](https://github.com/derekross/omarchy-mobile/issues/348)**; persistent Arch/Omarchy desktop on a development kernel ([notes](../device/bluejay/NOTES.md)); polling touch ([kernel #229](https://github.com/derekross/linux-omarchy-mobile/pull/229)), station Wi-Fi ([#227](https://github.com/derekross/linux-omarchy-mobile/pull/227), [#228](https://github.com/derekross/linux-omarchy-mobile/pull/228), [#230](https://github.com/derekross/linux-omarchy-mobile/pull/230)) and Panfrost GPU are development-kernel results, not release support; display is retained simpledrm, native panel modesetting unqualified; source/reproduction limits in [UPSTREAM](../device/bluejay/UPSTREAM.md); its device package 0.1.0, nothing enabled, is in review ([#346](https://github.com/derekross/omarchy-mobile/pull/346)) | | Pixel 8, 8 Pro, 8a | shiba, husky, akita | zuma (Tensor G3) | **WIP, community port: [#1](https://github.com/derekross/omarchy-mobile/issues/1)**. 8 Pro (husky): WIP, in the matrix above; its device package and UFS plan are merged ([#42](https://github.com/derekross/omarchy-mobile/pull/42)), and its bootloader picks the base DTB by `/soc_compatible`, not `/soc_id`. 8a (akita): stage 0 stock facts and a descriptor from a retail phone ([notes](../device/akita/NOTES.md)); this phone's bootloader picks the IPOP base DTB where husky's picks FOPLP. WIP, in the matrix above: the first-light board file is merged ([kernel #192](https://github.com/derekross/linux-omarchy-mobile/pull/192)) and boots from slot B with USB networking, SSH and the framebuffer console ([BRINGUP-M1](../device/akita/BRINGUP-M1.md)); UFS is merged too ([kernel #206](https://github.com/derekross/linux-omarchy-mobile/pull/206)), and the device package with its storage plan is in review ([#456](https://github.com/derekross/omarchy-mobile/pull/456)) | | Pixel 9 family | tokay, caiman, komodo, comet, tegu | zumapro (Tensor G4) | 9a (tegu): in the matrix above; its SoC and board device tree is merged ([kernel #81](https://github.com/derekross/linux-omarchy-mobile/pull/81)), with the rest of its kernel work merging into linux-omarchy-mobile; tracking [#28](https://github.com/derekross/omarchy-mobile/issues/28) | | Pixel 10 family | mustang (10 Pro XL) | laguna (Tensor G5) | 10 Pro XL (mustang): stage 0 stock facts ([notes](../device/mustang/NOTES.md)), contributors welcome ([#18](https://github.com/derekross/omarchy-mobile/issues/18)) | diff --git a/packages/omamobile-device-bluejay/LICENSE b/packages/omamobile-device-bluejay/LICENSE new file mode 100644 index 000000000..aecd59624 --- /dev/null +++ b/packages/omamobile-device-bluejay/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-bluejay/PKGBUILD b/packages/omamobile-device-bluejay/PKGBUILD new file mode 100644 index 000000000..8ccec016a --- /dev/null +++ b/packages/omamobile-device-bluejay/PKGBUILD @@ -0,0 +1,26 @@ +# SPDX-License-Identifier: MIT +pkgname=omamobile-device-bluejay +pkgver=$(cat "${startdir:-.}/version") +pkgrel=1 +pkgdesc="Omarchy Mobile support for the Google Pixel 6a (bluejay): storage guard, USB networking, power key and suspend-to-idle" +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-bluejay.install +makedepends=(gcc) + +build() { + "$startdir/build" "$srcdir/build" +} + +check() { + "$startdir/test/all" +} + +package() { + "$startdir/install" "$pkgdir" "$srcdir/build" +} diff --git a/packages/omamobile-device-bluejay/README.md b/packages/omamobile-device-bluejay/README.md new file mode 100644 index 000000000..69df7d434 --- /dev/null +++ b/packages/omamobile-device-bluejay/README.md @@ -0,0 +1,22 @@ + +# omamobile-device-bluejay + +Omarchy Mobile's first userspace package for the Google Pixel 6a (codename bluejay, Tensor / gs101), the package `device/bluejay/device.conf` names. It hides the Android partitions from desktop tools, holds the USB address, keeps suspend on suspend-to-idle, and gives pacman the same `[omamobile]` repository as the Pixel 7 Pro. It does not drive the radio, the charger, or a camera, it enables no service, it loads no driver, and it does not mark a boot slot successful. + +**No Pixel 6a has run it.** Its board DTS ([kernel #179](https://github.com/derekross/linux-omarchy-mobile/pull/179)) is merged without a boot, and this package follows the same way: every file is a copy of one that runs on the Pixel 6 Pro (raven, the same SoC) or the Pixel 7 Pro, and `test/all` checks the copies. The first boot's `tools/phone-smoke` report goes to [issue #348](https://github.com/derekross/omarchy-mobile/issues/348), the 6a's own thread, and [device/bluejay/NOTES.md](../../device/bluejay/NOTES.md). + +| 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 | +| `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 may need a reboot: this package does not close the Type-C chip's USB2 switch again (raven's package does for its MAX77759, through a service; the 6a's chip, bus and address are unread) | +| `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. The long press stays the PMIC reset | +| `vendor/systemd/sleep.conf.d/10-omamobile.conf` | `/usr/lib/systemd/sleep.conf.d` | Suspend means suspend-to-idle: the firmware advertises PSCI SYSTEM_SUSPEND, so the kernel offers `deep`, but Linux has no gs101 sleep sequence and the Pixel 6 Pro doesn't wake from it. No hibernation. Same drop-in as the Pixel 6 Pro package; bluejay's bootargs don't set `mem_sleep_default`, as oriole's don't, so this file is what keeps a `systemctl suspend` on s2idle | +| `vendor/NetworkManager/conf.d/10-omamobile-usb.conf` | `/usr/lib/NetworkManager/conf.d` | Keeps NetworkManager off that link | +| `etc/omamobile-mirrorlist` | `/etc/pacman.d/omamobile-mirrorlist` | Where pacman finds the `[omamobile]` repository. Same file as the Pixel 7 Pro package | +| `omamobile-device-bluejay.install` | pacman hook | Adds `[omamobile]` to `pacman.conf` before `[omarchy]`, once. Same script as the Pixel 7 Pro package | +| `src/reboot-to.c` | `/usr/bin/reboot-to` | Reboot with a reason the bootloader understands. On a first boot the reason most likely isn't stored: the descriptor lists no `INITRAMFS_MODULES`, and raven's records that without its PMIC and reboot-mode modules `reboot-to bootloader` just boots slot B again, so fastboot is by the buttons. 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/bluejay/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: `omamobile-bootctl` and the boot-success marker (marking slot B on the gs101 phones is on hold, [#252](https://github.com/derekross/omarchy-mobile/issues/252); without the source, `bin/omamobile initramfs` builds its freestanding helpers, as for oriole), the USB rescue, Wi-Fi, the charger, haptics, the display's module options, cameras, any modprobe blacklist, and the slot-B image hook. Each comes in when a booted 6a has given it a runbook and the evidence. diff --git a/packages/omamobile-device-bluejay/build b/packages/omamobile-device-bluejay/build new file mode 100755 index 000000000..1d7d8eeb2 --- /dev/null +++ b/packages/omamobile-device-bluejay/build @@ -0,0 +1,7 @@ +#!/bin/bash +# SPDX-License-Identifier: MIT +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-bluejay/device.conf b/packages/omamobile-device-bluejay/device.conf new file mode 100644 index 000000000..78a133b2e --- /dev/null +++ b/packages/omamobile-device-bluejay/device.conf @@ -0,0 +1,22 @@ +# SPDX-License-Identifier: MIT +CODENAME=bluejay +NAME="Pixel 6a" +SOC=gs101 +COMPATIBLE="google,gs101-bluejay" +PACKAGE=omamobile-device-bluejay +DTB=exynos/google/gs101-bluejay.dtb +SOC_IDS="b0:0x9845001 a0:0x9845000" +DTBO_SOURCE=bluejay-m1-overlay.dts +DTBO_BOARD_ID=0x20506 +DTBO_BOARD_REV=0x10000 +VENDOR_CMDLINE="console=tty0 earlycon=exynos4210,0x10A00000 clk_ignore_unused pd_ignore_unused printk.devkmsg=on bootconfig" +VENDOR_PAGESIZE=0x800 +OS_VERSION=17.0.0 +OS_PATCH_LEVEL=2026-10 +AVB_FOOTERS="boot:0x4000000" +AVB_ROLLBACK_INDEX=1791158400 +AVB_SECURITY_PATCH=2026-10-05 +BOOT_IMAGES="boot vendor_boot dtbo" +UFS_RW="boot_b vendor_boot_b dtbo_b userdata" +INITRAMFS_INIT=/initramfs/init +PANEL_SIZE=1080x2400 diff --git a/packages/omamobile-device-bluejay/etc/omamobile-mirrorlist b/packages/omamobile-device-bluejay/etc/omamobile-mirrorlist new file mode 100644 index 000000000..f9be3d0e9 --- /dev/null +++ b/packages/omamobile-device-bluejay/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-bluejay/install b/packages/omamobile-device-bluejay/install new file mode 100755 index 000000000..723ee5b43 --- /dev/null +++ b/packages/omamobile-device-bluejay/install @@ -0,0 +1,24 @@ +#!/bin/bash +# SPDX-License-Identifier: MIT +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/systemd/sleep.conf.d/10-omamobile.conf \ + "$destination/usr/lib/systemd/sleep.conf.d/10-omamobile.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-bluejay/LICENSE" +install -Dm644 version "$destination/usr/share/omamobile/device-bluejay/version" diff --git a/packages/omamobile-device-bluejay/omamobile-device-bluejay.install b/packages/omamobile-device-bluejay/omamobile-device-bluejay.install new file mode 100644 index 000000000..96da5786e --- /dev/null +++ b/packages/omamobile-device-bluejay/omamobile-device-bluejay.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-bluejay/src/reboot-to.c b/packages/omamobile-device-bluejay/src/reboot-to.c new file mode 100644 index 000000000..f79e948ed --- /dev/null +++ b/packages/omamobile-device-bluejay/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-bluejay/test/all b/packages/omamobile-device-bluejay/test/all new file mode 100755 index 000000000..5902ef1f7 --- /dev/null +++ b/packages/omamobile-device-bluejay/test/all @@ -0,0 +1,125 @@ +#!/bin/bash +# SPDX-License-Identifier: MIT +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-bluejay.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 vendor/NetworkManager/conf.d/10-omamobile-usb.conf \ + ../omamobile-device-cheetah/vendor/NetworkManager/conf.d/10-omamobile-usb.conf \ + || fail "the NetworkManager drop-in drifted from the cheetah package" + pass "the NetworkManager drop-in matches the cheetah package" + cmp -s vendor/systemd/network/20-usb-gadget.network \ + ../omamobile-device-cheetah/vendor/systemd/network/20-usb-gadget.network \ + || fail "the usb0 network file drifted from the cheetah package" + pass "the usb0 network file matches the cheetah package" + cmp -s omamobile-device-bluejay.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 +if [[ -f ../omamobile-device-raven/vendor/systemd/sleep.conf.d/10-omamobile.conf ]]; then + cmp -s vendor/systemd/sleep.conf.d/10-omamobile.conf \ + ../omamobile-device-raven/vendor/systemd/sleep.conf.d/10-omamobile.conf \ + || fail "the sleep drop-in drifted from the raven package" + pass "the sleep drop-in matches the raven package (gs101)" +fi +grep -q 'omamobile-keyring' PKGBUILD || fail "pacman needs omamobile-keyring" +grep -q '^provides=(omamobile-device)$' PKGBUILD || fail "the package provides omamobile-device" +grep -q '^conflicts=(omamobile-device)$' PKGBUILD || fail "the package conflicts with every other device package" +grep -q '^install=omamobile-device-bluejay.install$' PKGBUILD \ + || fail "the pacman install script is not named" +[[ -f etc/omamobile-mirrorlist && -f omamobile-device-bluejay.install ]] \ + || fail "the pacman mirrorlist or install script is missing" +pass "pacman gets the keyring, the mirrorlist, the install script and the virtual device name" +if [[ -f ../../device/bluejay/device.conf ]]; then + cmp -s device.conf ../../device/bluejay/device.conf \ + || fail "device.conf drifted from the descriptor" + pass "device.conf matches the descriptor" +fi +grep -q '^PACKAGE=omamobile-device-bluejay$' device.conf || fail "the descriptor names this package" +grep -q '^COMPATIBLE="google,gs101-bluejay"$' device.conf || fail "the descriptor is bluejay's" +! grep -q '^SIMPLEFB_TRIG_CON=' device.conf || fail "the descriptor writes a display register before a booted 6a has read it" +! grep -q '^BRINGUP_PROBE=' device.conf || fail "the descriptor installs a register probe" +pass "the descriptor carries no register write and no probe" + +./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/systemd/sleep.conf.d/10-omamobile.conf \ + usr/lib/NetworkManager/conf.d/10-omamobile-usb.conf \ + usr/share/omamobile/device.conf \ + usr/share/omamobile/device-bluejay/version \ + usr/share/licenses/omamobile-device-bluejay/LICENSE \ + etc/pacman.d/omamobile-mirrorlist; do + [[ -f $tmp/root/$f ]] || fail "install stages $f" +done +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" +sleep="$tmp/root/usr/lib/systemd/sleep.conf.d/10-omamobile.conf" +grep -qx '\[Sleep\]' "$sleep" || fail "the sleep drop-in needs a [Sleep] header" +grep -q '^MemorySleepMode=s2idle$' "$sleep" \ + || fail "suspend must be s2idle: gs101 never wakes from deep" +grep -q '^AllowHibernation=no$' "$sleep" || fail "there is no swap to hibernate to" +grep -q '^PACKAGE=omamobile-device-bluejay$' "$tmp/root/usr/share/omamobile/device.conf" \ + || fail "the installed descriptor is bluejay" +[[ ! -d $tmp/root/usr/lib/systemd/system ]] || fail "install ships a system unit" +[[ ! -d $tmp/root/usr/lib/modprobe.d ]] || fail "install ships a modprobe policy" +for absent in usr/bin/omamobile-boot-success usr/bin/omamobile-bootctl \ + usr/bin/omamobile-usb-rescue usr/bin/omamobile-wifi-start \ + usr/bin/omamobile-charge-guard usr/bin/omamobile-aoc-start \ + usr/bin/omamobile-camera-start \ + usr/lib/systemd/logind.conf.d/10-omamobile-lid.conf; do + [[ ! -e $tmp/root/$absent ]] || fail "install includes $absent" +done +pass "install stages the udev rule, the USB link, the sleep and power-key policy and the mirrorlist, and nothing that marks a slot, loads a driver or starts hardware" + +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-bluejay/vendor/NetworkManager/conf.d/10-omamobile-usb.conf b/packages/omamobile-device-bluejay/vendor/NetworkManager/conf.d/10-omamobile-usb.conf new file mode 100644 index 000000000..252de6e15 --- /dev/null +++ b/packages/omamobile-device-bluejay/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-bluejay/vendor/systemd/logind.conf.d/10-omamobile-power-key.conf b/packages/omamobile-device-bluejay/vendor/systemd/logind.conf.d/10-omamobile-power-key.conf new file mode 100644 index 000000000..a1e2cb0eb --- /dev/null +++ b/packages/omamobile-device-bluejay/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-bluejay/vendor/systemd/network/20-usb-gadget.network b/packages/omamobile-device-bluejay/vendor/systemd/network/20-usb-gadget.network new file mode 100644 index 000000000..973c61db7 --- /dev/null +++ b/packages/omamobile-device-bluejay/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 (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-bluejay/vendor/systemd/sleep.conf.d/10-omamobile.conf b/packages/omamobile-device-bluejay/vendor/systemd/sleep.conf.d/10-omamobile.conf new file mode 100644 index 000000000..e7cd661eb --- /dev/null +++ b/packages/omamobile-device-bluejay/vendor/systemd/sleep.conf.d/10-omamobile.conf @@ -0,0 +1,10 @@ +# SPDX-License-Identifier: MIT +# The firmware advertises PSCI SYSTEM_SUSPEND, so the kernel offers "deep" +# sleep, but Linux has no gs101 SoC sleep sequence yet: entering it without +# one doesn't wake. Suspend means suspend-to-idle until SYS_SLEEP exists +# (device/raven/SUSPEND-PLAN.md). There is no swap to hibernate to. +[Sleep] +MemorySleepMode=s2idle +AllowHibernation=no +AllowHybridSleep=no +AllowSuspendThenHibernate=no diff --git a/packages/omamobile-device-bluejay/vendor/udev/rules.d/10-omamobile-storage.rules b/packages/omamobile-device-bluejay/vendor/udev/rules.d/10-omamobile-storage.rules new file mode 100644 index 000000000..89c02cf30 --- /dev/null +++ b/packages/omamobile-device-bluejay/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-bluejay/version b/packages/omamobile-device-bluejay/version new file mode 100644 index 000000000..6e8bf73aa --- /dev/null +++ b/packages/omamobile-device-bluejay/version @@ -0,0 +1 @@ +0.1.0