From 869bf7aebced713da62bedd2114a932ea679d2e2 Mon Sep 17 00:00:00 2001 From: Derek Ross Date: Sun, 1 Nov 2026 20:26:10 -0500 Subject: [PATCH 1/3] publish-kernel: fast-forward omamobile and tag releases, never force-push MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Since 2026-10-30 the phone runs the published omamobile branch plus a curated local branch, and community pull requests merge into omamobile on GitHub. RELEASES §8 still said releases come from omamobile-int snapshots published with tools/publish-kernel, and run that way the tool found no local commit matching the published tree and fell back to a rebuild and a force push: from the stale local omamobile that drops every community commit, from omamobile-int it replaces the snapshot history with hundreds of unsigned commits. The model is now: omamobile on GitHub is the one source of the release kernel; community work lands by rebase merges, the maintainer's curated work as a fast-forward of a local release branch built on the current published tip; releases are annotated tags on it (kernel-YYYY.MM.DD, proposed); omamobile-int is a local test branch only. tools/publish-kernel is rewritten to match. It reads and fetches the published tip first (a failed read is never taken for a missing branch), pushes only when the branch contains it, and otherwise prints the rebase to run. It runs kernel-pr-check's commit and policy checks (new --no-checkpatch) on what it would publish and refuses merge commits. --tag creates an annotated tag naming the release uname and pushes it with the branch atomically, or alone on the published tip; --dry-run prints the exact push. The squash replay, --rebuild and every force push are gone; with no force flag, git refuses a non-fast-forward even when the remote moves during the run. The remote comes from PUBLISH_KERNEL_REMOTE for the test. kernel-pr-check now fails a Co-Authored-By trailer: CONTRIBUTING §6.2 and coding-assistants.rst credit an AI with Assisted-by in kernel commits. This takes over #286's safe read of the published tip (ls-remote exit 2 only means missing) and its test sandbox idea; its --rebuild and --force-with-lease paths have no place in a branch that only moves forward, so the two conflict in tools/publish-kernel and RELEASES §8. tests/publish-kernel runs the tool against a scratch bare repository with only the file protocol allowed, ssh disabled, replaced global and system configs and the GitHub URL rewritten into the scratch folder, and logs every push to prove none forces. Co-Authored-By: Claude Opus 5.5 Claude-Session: https://claude.ai/code/session_01BeEcdVeSfyLCbijF8XQF1d --- AGENTS.md | 6 +- CONTRIBUTING.md | 2 +- README.md | 2 +- device/cheetah/KERNEL-PUBLISH.md | 10 +- docs/RELEASES.md | 26 ++-- docs/ROADMAP.md | 4 +- tests/all | 5 +- tests/kernel-pr-check | 12 ++ tests/publish-kernel | 207 +++++++++++++++++++++++++++++++ tools/kernel-pr-check | 23 +++- tools/publish-kernel | 188 ++++++++++++++++++++-------- 11 files changed, 410 insertions(+), 75 deletions(-) create mode 100755 tests/publish-kernel diff --git a/AGENTS.md b/AGENTS.md index 03cdd380a..08282d2da 100644 --- a/AGENTS.md +++ b/AGENTS.md @@ -38,7 +38,7 @@ Omarchy Mobile runs native Omarchy (Arch Linux ARM, Hyprland, Omarchy's packages Plans record what already failed and why. - **Work offline and hand the human a runbook.** Write the code, build it, and run checkpatch, `W=1` and `dt-validate` yourself. Then add a gated runbook to the plan: the commands, Expect/Pass, a **stop condition**, a Rollback and a risk level for each step, read-only steps first. The human runs or approves each step. Record the results in the plan with the date and the kernel release (`uname -r`). - **Build with an explicit worktree and output directory:** `KERNEL_DIR=~/omamobile-kernel/wt-X KERNEL_OUT=~/omamobile-kernel/out-X bin/omamobile kernel`. Other agents build in parallel, and a shared output directory mixes their builds. On setups from before 2026-10-29 the kernel tree is `~/android/mainline`: use whichever exists (the tools find either). -- **Kernel branches:** one subsystem per branch (`omamobile-`). The human merges branches into the local integration branch `omamobile-int` that the phone runs. Curated, upstream-ready commits go to `omamobile`, the branch published to GitHub. Don't rebase or force-push branches someone else is merging from. +- **Kernel branches:** one subsystem per branch (`omamobile-`). `omamobile` on GitHub is the one source of the release kernel: community pull requests land there as rebase merges, the maintainer's curated, signed-off commits land as a fast-forward of a local release branch built on the current `github/omamobile` (`tools/publish-kernel`), and releases are tags on it (`kernel-`, [RELEASES](docs/RELEASES.md) §8). It is never rewritten or force-pushed. `omamobile-int` is a local integration branch for test kernels only, no longer published and no release source. Don't rebase or force-push branches someone else is merging from. - **Commit messages:** - Kernel commits are upstream-style: the subsystem prefix from `git log --oneline `, the why, and the evidence. AI agents never add `Signed-off-by:` (`Documentation/process/coding-assistants.rst`): the human signs off. - This repository uses an area prefix (`omamobile-gnss: …`, `device-cheetah 0.1.15: …`, `DISPLAY-PLAN: …`), a body that explains why, and the attribution trailer the session asks for. @@ -93,7 +93,7 @@ tools/phone-ssh CMD -> run anything; stream files with ssh 'cat > f' < f | `tools/phone-demo seed\|notify\|clear\|status\|shot\|record` | Fictional demo data for screenshots and videos ([docs/DEMO.md](docs/DEMO.md)): contacts, message threads, a call log and notifications in the session user's omatel stores, backed up first to `/var/lib/omamobile-demo/` and removed exactly by `clear`; `shot` and `record` capture the screen to `logs/demo/`. Changes what the phone shows and sends toasts: announce it, and `clear` before handing the phone back | | `tools/phone-install-package packages/X` | Build a package on the phone and install it | | `tools/pr-check [BASE]`, `tests/packages` | The pull-request gate CI runs (`.github/workflows/checks.yml`): identifiers, blobs, AI sign-offs and scripts that parse, then every package's `test/all`; run both before you push (CONTRIBUTING.md §6.5) | -| `tools/kernel-pr-check [-C KERNEL] [--build OUT] [--merge] BASE [HEAD]` | The same gate for linux-omarchy-mobile pull requests: a human Signed-off-by from the author, subsystem prefixes, `checkpatch --strict`, identifiers, and with `--build` the `W=1` builds of touched C files, device trees (new warnings only, against the base) and bindings. `--merge` builds the pull request merged onto BASE, as CI does, and reports a conflict as "rebase needed". Build it in the project container with the Android clang on `PATH` | +| `tools/kernel-pr-check [-C KERNEL] [--build OUT] [--merge] BASE [HEAD]` | The same gate for linux-omarchy-mobile pull requests: a human Signed-off-by from the author, no `Co-Authored-By` (the kernel takes `Assisted-by`), subsystem prefixes, `checkpatch --strict`, identifiers, and with `--build` the `W=1` builds of touched C files, device trees (new warnings only, against the base) and bindings. `--merge` builds the pull request merged onto BASE, as CI does, and reports a conflict as "rebase needed". Build it in the project container with the Android clang on `PATH` | | `tools/phone-ssh [--fresh\|--stop] CMD` | Run a command on the phone. `OMAMOBILE_SSH_SHARE=1` shares one connection (kept 60 s), so a key that needs a touch per connection asks once rather than about 25 times in `push`. A shared connection survives what happens to new ones, so a check that SSH still works after a USB or firewall step uses `--fresh` (`tools/usbc-deadman` always does) | | `tools/phone-smoke` | Read-only smoke test of a running phone, with a report for the pull request: boot slot, storage guard, root, kernel health, USB, session, then display, GPU, touch, radios, battery, sound, sensors and cameras as evidence. `--here` on the phone, `--json` for a machine | | `omamobile-update` (on the phone; `omamobile-omarchy`) | What `omarchy update` runs on the phone: Omarchy's own update with the phone's stand-ins (docs/RELEASES.md §5.4). `check --json` is read-only; an update changes the phone's packages and restarts the shell, so it is the human's call | @@ -103,7 +103,7 @@ tools/phone-ssh CMD -> run anything; stream files with ssh 'cat > f' < f | `tools/phone-provision` | After a fresh install: Google's files from the user's factory image and the phone's own data from the backup. `--fingerprint` copies Trusty's state but never starts the service | | `tools/build-packages`, `tools/repo-push` | Maintainer only: the signed `[omamobile]` repository, built on the laptop with no phone (needs `keys/`, never committed); the release key's layout is in [RELEASES](docs/RELEASES.md) §10 (`tools/release-key-init`, run once); `tools/repo-publish` publishes to `pkgs.omamobile.org` (development daily from `origin/main`, stable on the maintainer's go). `tools/repo-build` builds on a connected phone instead: an opt-in shortcut for Mesa, Hyprland and libcamera, never a requirement | | `tools/local-key-init`, `tools/fetch-published`, `--local` | A contributor's port: its own packages signed with a local key in `keys//`, the project's published packages fetched with their signatures checked, everything under `out//` (RELEASES §10, review lesson L-7). Never the maintainer's `keys/` or `out/repo` | -| `tools/publish-kernel` | Maintainer only: publish `omamobile` to GitHub on a squashed upstream base | +| `tools/publish-kernel [--dry-run] [--tag kernel-YYYY.MM.DD] [BRANCH]` | Maintainer only: fast-forward `omamobile` on GitHub to a local release branch and tag a release on it. Fetches first, never force-pushes, refuses a branch that lacks the published tip (rebase it), merge commits, and commits failing `kernel-pr-check`'s sign-off (`Assisted-by`, not `Co-Authored-By`), prefix, identifier and blob checks. Never run it without the human's go; `--dry-run` first | Logs from these tools land in `logs/` (gitignored). Quote the relevant lines in the plan, not whole logs, and check them for identifiers first. diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index cb07202ff..2c85cbd64 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -42,7 +42,7 @@ Omarchy Mobile runs native Omarchy on mobile devices: Arch Linux ARM, Hyprland a - `docker`: kernel builds run in the [`docker/Dockerfile`](docker/Dockerfile) environment (Ubuntu 24.04). - `adb`, `fastboot` (`android-tools`), `lz4`, `zstd`, `cpio`, `python3`, `ssh`, plus `unzip`, `debugfs` (e2fsprogs), `simg2img`/`lpunpack` and `erofs-utils` for firmware extraction. - **Android's prebuilt clang and the AOSP boot-image tools.** `bin/omamobile` takes clang from `CLANG_DIR`, and `mkbootimg` and `mkdtboimg.py` from `SRC_DIR` (`system/tools/mkbootimg`, `system/libufdt`). Today these come from a LineageOS checkout (`bin/lineage-ref sync`, about 400 GB). A smaller setup also works: the AOSP `platform/prebuilts/clang/host/linux-x86`, `platform/system/tools/mkbootimg` and `platform/system/libufdt` projects under `~/android` (plus `platform/external/avb` for a device with `AVB_FOOTERS`), with `CLANG_DIR` and `SRC_DIR` set in `omamobile.local.conf`. The initramfs build links against that clang's Android compiler-rt builtins. A lighter toolchain setup would make a good PR. -- **The kernel tree.** Clone [derekross/linux-omarchy-mobile](https://github.com/derekross/linux-omarchy-mobile) to `~/omamobile-kernel/linux`, or set `KERNEL_DIR`. Setups from before 2026-10-29 used `~/android/mainline` (the project began with Android-era names); the tools still find it, and moving is optional. Branch `omamobile-int` is what the phone runs today (every subsystem merged, work in progress included, as one snapshot commit); branch `omamobile` holds the curated, upstream-ready commits and lags behind it. Build `omamobile-int` to match this repository's packages and overlays; base your own kernel work on `omamobile`. +- **The kernel tree.** Clone [derekross/linux-omarchy-mobile](https://github.com/derekross/linux-omarchy-mobile) to `~/omamobile-kernel/linux`, or set `KERNEL_DIR`. Setups from before 2026-10-29 used `~/android/mainline` (the project began with Android-era names); the tools still find it, and moving is optional. Branch `omamobile` is the published kernel and the source of releases (tags `kernel-`, [RELEASES](docs/RELEASES.md) §8): community pull requests and the maintainer's curated work land there, and it only moves forward. Base your kernel work on it. Some cheetah drivers the packages use (AoC, Trusty, the modem) are still being curated into it; the `omamobile-int` branch on GitHub is an old integration snapshot (2026-10-18) that is no longer updated. - **Google's GPL kernel for your device**, as a reference for registers, clocks and power sequences (manifests at `android.googlesource.com/kernel/manifest`, branches named `android-gs--…`). The postmarketOS Tensor kernel is a useful second reference. - **The host side of USB networking:** give the laptop `172.16.42.2/24` on the phone's USB network interface. A NetworkManager profile with a manual address works (see "Host setup" in [NOTES.md](device/cheetah/NOTES.md)). diff --git a/README.md b/README.md index ff2ce4001..63a0fc5df 100644 --- a/README.md +++ b/README.md @@ -60,7 +60,7 @@ Large trees live outside the repo: the Android-side sources, images and captures | Path | Contents | | --- | --- | | `~/android/omamobile` | LineageOS 24.0 source. Includes Google's GPL Pixel 7 kernel at `out-kernel/google/gs-6.1` | -| `~/omamobile-kernel/linux` | Our kernel repo: branch `omamobile` on mainline v7.3-rc6 (remote `upstream` is Linus's tree), one commit per subsystem so patches can go upstream. Published to [derekross/linux-omarchy-mobile](https://github.com/derekross/linux-omarchy-mobile) by `tools/publish-kernel` (a squashed upstream base, our commits unchanged on top) | +| `~/omamobile-kernel/linux` | Our kernel repo: branch `omamobile` on mainline v7.3-rc6 (remote `upstream` is Linus's tree), one commit per subsystem so patches can go upstream. Published to [derekross/linux-omarchy-mobile](https://github.com/derekross/linux-omarchy-mobile) on a squashed upstream base; pull requests and the maintainer's fast-forwards (`tools/publish-kernel`) move it forward, and releases are tags on it | | `~/omamobile-kernel/pmos-tensor` | postmarketOS Tensor kernel, for reference | | `~/android/reference` | Captures from the phone. Contains serial numbers and partition backups: never commit | | `~/android/factory` | Verified stock factory images, used to restore the phone | diff --git a/device/cheetah/KERNEL-PUBLISH.md b/device/cheetah/KERNEL-PUBLISH.md index ac2445cc5..903fbe69d 100644 --- a/device/cheetah/KERNEL-PUBLISH.md +++ b/device/cheetah/KERNEL-PUBLISH.md @@ -1,7 +1,15 @@ # Publishing the kernel: candidate `omamobile-next` (cheetah / gs201) -Status (2026-10-19): **published.** `omamobile` is on GitHub +Status (2026-11-01): **process changed.** `omamobile` on GitHub is the one +source of the release kernel; `tools/publish-kernel` now only fast-forwards +it from a local release branch built on the published tip, checks sign-offs, +and tags releases (`kernel-`). It no longer replays, squashes or +force-pushes, and `omamobile-int` is no longer published. The commands +below (the replay and force push in 5.4) are history; see +[RELEASES](../../docs/RELEASES.md) §8. + +Earlier status (2026-10-19): **published.** `omamobile` is on GitHub (linux-omarchy-mobile, 146 commits on v7.3-rc6) and moves forward without rewriting published commits: `tools/publish-kernel` fast-forwards when the published tip's tree matches a local commit. Community kernel PRs are reviewed diff --git a/docs/RELEASES.md b/docs/RELEASES.md index 00c63cd51..d1566d624 100644 --- a/docs/RELEASES.md +++ b/docs/RELEASES.md @@ -21,6 +21,7 @@ The safety model in [CONTRIBUTING.md](../CONTRIBUTING.md) §3 and [AGENTS.md](.. 4. firmware, extracted from the user's factory image by a per-device map; 5. `omamobile-device-`, the userspace support package. - **One descriptor per device**, `device//device.conf`, holds the values of 2 and 3 and points at 4 and 5, so no tool carries a codename in its code. +- **One kernel source.** Releases are built from a tag on `linux-omarchy-mobile`'s published `omamobile` branch (§8). - **Releases** ship through the signed `[omamobile]` pacman repository: a `linux-omamobile` kernel package (`Image`, modules, all DTBs), device packages that pick their DTB and write slot B through a pacman hook, and, for first installs, per-device flashable bundles. ## 2. What is cheetah-specific today @@ -134,15 +135,15 @@ Step 1 changed no output for cheetah: `images` produced the same checksums for e One package for every device, in `[omamobile]`. -- **Source:** a tagged snapshot of `linux-omarchy-mobile`'s `omamobile-int` branch (§8), built with `kernel/configs/omamobile.config` on arm64 `defconfig`. +- **Source:** a release tag (`kernel-`) on `linux-omarchy-mobile`'s `omamobile` branch (§8), built from a clean checkout of the tag with `kernel/configs/omamobile.config` on arm64 `defconfig`. - **Contents**, following Arch Linux ARM's layout: - `/usr/lib/modules//vmlinuz`: the uncompressed arm64 `Image` (the hook compresses it with lz4 for `boot.img`); - `/usr/lib/modules//kernel/…`, `modules.*`: stripped modules, as `bin/omamobile modules` packs them today; - `/usr/lib/modules//dtbs/exynos/google/*.dtb`: every Google board DTB the tree builds; - `/usr/lib/modules//pkgbase`: `linux-omamobile`, as Arch kernels do. - **No initramfs, no boot images.** Those are per device and come from the device package's hook (§5). -- **Release string:** `CONFIG_LOCALVERSION` becomes `-omamobile` for release builds and `CONFIG_LOCALVERSION_AUTO` stays on, so `uname -r` is `7.3.0-rc6-omamobile-00453-g` and names the snapshot exactly. The `-push1` suffix stays for development builds, so a development kernel can never be mistaken for a packaged one. -- **pkgver:** the release with `-` folded into `.` (pacman forbids `-`): `7.3.0rc6.r453.g`, which sorts upward as the snapshot grows. `pkgrel` counts packaging-only changes. +- **Release string:** `CONFIG_LOCALVERSION` becomes `-omamobile` for release builds and `CONFIG_LOCALVERSION_AUTO` stays on. The published branch starts from a squashed commit, so no upstream tag is in its history and `setlocalversion` appends only the commit: `uname -r` is `7.3.0-rc6-omamobile-g` (`-dirty` if the checkout isn't clean), which names the tagged commit exactly. `tools/publish-kernel` prints it, and the tag's message records it. The `-push1` suffix stays for development builds, so a development kernel can never be mistaken for a packaged one. +- **pkgver:** the version without its `-` (pacman forbids `-`), then the number of commits in the tag's history and the commit: `7.3.0rc6.r.g` (`n` from `git rev-list --count kernel-`). `omamobile` only moves forward, so `n` grows from release to release and pkgver sorts upward. `pkgrel` counts packaging-only changes. - **Build:** cross-compiled in the existing docker environment on x86 (`bin/omamobile kernel` and `modules`, unchanged), then packed by a `PKGBUILD` that only copies the build output (`arch=(aarch64)`, no compile step), so it can run on the laptop under `makepkg --config` with `CARCH=aarch64`. Building the kernel on the phone is possible but slow; the decision is §11. - **Headers** (`linux-omamobile-headers`) can follow when something needs out-of-tree modules (DKMS); nothing does today. - **Old modules:** a pacman upgrade removes the previous release's modules. The hook therefore keeps one copy of the previous `/usr/lib/modules/` in `/var/lib/omamobile/boot/previous/` together with the previous slot-B images, so a rollback restores both (§5.3). @@ -278,7 +279,7 @@ The bundle's signed `SHA256SUMS` covers its `MANIFEST`, which names the exact ro | Thing | Version | Where it is recorded | | --- | --- | --- | -| Kernel | `uname -r`: `7.3.0-rc6-omamobile--g`; pkgver `7.3.0rc6.r.g` | tag `omamobile-int-` in linux-omarchy-mobile | +| Kernel | `uname -r`: `7.3.0-rc6-omamobile-g`; pkgver `7.3.0rc6.r.g` (§4) | annotated tag `kernel-` (`.1`, `.2` for a respin) on `omamobile` in linux-omarchy-mobile; the scheme is a proposal for the maintainer to confirm | | Packages | each package's `version` file, bumped in the commit that changes it (CONTRIBUTING §6.3) | the package | | Descriptor | none of its own; a change to it is a device-package change and bumps that package | `omamobile-device-` | | Bundle | calendar version ``, with `.1`, `.2` for a respin the same day | tag `release-` in this repository, covering every device released that day; `MANIFEST` pins the kernel tag, every package version and both commits | @@ -287,9 +288,12 @@ A release never contains a kernel or package that isn't in `[omamobile]` at the ## 8. The kernel branches -- **`omamobile-int`** is the snapshot the phone runs and that releases are built from. Before each release it is published as a snapshot (`tools/publish-kernel omamobile-int`) and tagged `omamobile-int-`, so anyone can rebuild a release's kernel. -- **`omamobile`** stays the curated, upstream-ready series. Before each release, a curation pass moves whatever has passed on the phone since the last one out of `omamobile-int` into `omamobile` as clean commits (the `omamobile-next` process in [KERNEL-PUBLISH](../device/cheetah/KERNEL-PUBLISH.md)), and `omamobile` is published. The release notes list how many commits `omamobile-int` still carries beyond `omamobile`; that number should shrink over time. -- Board DTS files for new devices land in the device's topic branch first, then in both branches as above. +- **`omamobile` on GitHub is the one source of the release kernel.** It starts from a squashed commit holding the upstream tag's tree (v7.3-rc6), with every commit after it unchanged, and it only moves forward: pull requests and release tags point at its commit ids, so nothing rewrites or force-pushes it. +- **Community pull requests** land there after review (`tools/kernel-pr-check`, CI), as rebase merges. +- **The maintainer's work** lands as a fast-forward: a local release branch (say `omamobile-release`) built on the current `github/omamobile` from curated, signed-off commits of the subsystem branches, tested on the phone, then pushed with `tools/publish-kernel omamobile-release`, or opened as a pull request like anyone else's. The tool fetches the published tip first and pushes only a fast-forward. If something was merged meanwhile, it stops: rebase the release branch (`git rebase FETCH_HEAD omamobile-release`), test what changed, and run it again. It also refuses merge commits, and any commit without the author's human `Signed-off-by`, with an AI's, or with `Co-Authored-By` (kernel commits credit an AI with `Assisted-by`), as well as identifiers and blobs (`tools/kernel-pr-check`'s commit and policy checks). `--dry-run` prints exactly what it would push. +- **A release is a tag on `omamobile`:** annotated, `kernel-` after the bundle's calendar version (§7; proposed, for the maintainer to confirm), on the commit the release kernel is built from. `tools/publish-kernel --tag kernel- [omamobile-release]` creates it and pushes it with the branch in one atomic push, or alone on the published tip. A release tag never moves; a respin the same day is `kernel-.1`. +- **`omamobile-int`** is a local integration and testing branch only: the subsystem branches merged, work in progress included, for test kernels. It is no longer published and is not a release source: what a release needs moves from it into the release branch as curated commits. The `omamobile-int` snapshots on GitHub (the last from 2026-10-18) are no longer updated. +- Board DTS files for new devices land in the device's topic branch first, then in `omamobile` through a pull request or the release branch. ## 9. Reproducibility and CI @@ -308,7 +312,7 @@ A release never contains a kernel or package that isn't in `[omamobile]` at the | Job | When | What | | --- | --- | --- | | lint | every push | `bash -n` and shellcheck on `bin/` and `tools/`, each package's `test/all`, descriptor checks for every `device/*/device.conf` | -| kernel | kernel tag, or nightly on `omamobile-int` | build `Image`, modules and all DTBs in the container; `dt-validate` (`CHECK_DTBS=y`) on each board DTB | +| kernel | kernel tag, or nightly on `omamobile` | build `Image`, modules and all DTBs in the container; `dt-validate` (`CHECK_DTBS=y`) on each board DTB | | images | after kernel | `DEVICE= bin/omamobile images`; build twice and compare checksums | | packages | release | `linux-omamobile` packed from the kernel job; aarch64 packages on an arm64 runner in an Arch Linux ARM container, or on the phone as today | | bundle | release | bundle and root image, **unsigned** | @@ -338,15 +342,15 @@ CI never holds the signing key and never sees a factory image. The maintainer do Per release, in order. Stop at any failed step. -1. **Kernel:** every subsystem branch meant for the release merged into `omamobile-int`; it boots on each released device, with `uname -r` and the result in that device's NOTES. -2. **Curate:** move what has passed into `omamobile` (§8); publish `omamobile` and the `omamobile-int` snapshot; tag `omamobile-int-`. +1. **Kernel:** a release branch on the current `github/omamobile` holds everything the release needs as curated, signed-off commits (§8); `tools/kernel-pr-check --build OUT --merge github/omamobile ` passes; it boots on each released device, with `uname -r` and the result in that device's NOTES. +2. **Publish and tag:** `tools/publish-kernel --dry-run --tag kernel- `, read what it would push, then run it without `--dry-run`. If it stops because `omamobile` moved, rebase, test what changed, and repeat. 3. **Build** the kernel from the tag in the pinned container, release `LOCALVERSION`; pack `linux-omamobile`. 4. **Images** for every device: `DEVICE= bin/omamobile initramfs --release`, then `DEVICE= bin/omamobile images`, twice, checksums equal. 5. **Packages:** every changed package has a bumped `version`, its `test/all` passes, `tools/build-packages` builds and signs them and the database on the laptop (`tools/repo-build` on a phone only as an opt-in shortcut). 6. **Test install** on each released device, attended: the bundle's `install` on a phone whose stock slot A and backups are known good; first boot, device package installed, `omarchy update` clean, then a package-hook kernel update and a reboot into it. 7. **Identifiers:** grep the bundle, the root image's file list, `MANIFEST` and the release notes for MAC addresses (`[0-9a-f]{2}(:[0-9a-f]{2}){5}`), serial numbers, SSIDs and account names; confirm no file from a factory image is in any artifact. 8. **Sign** the bundles and the root image; verify the signatures from a clean keyring. -9. **Tag** `release-` in this repository; publish the repository, the bundles and the notes (what changed, the kernel tag, `omamobile-int` minus `omamobile`, known issues, how to go back to stock). +9. **Tag** `release-` in this repository; publish the repository, the bundles and the notes (what changed, the kernel tag and its `uname -r`, known issues, how to go back to stock). ## 12. Decisions for the human diff --git a/docs/ROADMAP.md b/docs/ROADMAP.md index de67c55b0..c086ccbcf 100644 --- a/docs/ROADMAP.md +++ b/docs/ROADMAP.md @@ -151,7 +151,7 @@ The kernel package, the update path for slot B and the installer are designed to 1. **Device descriptor and `DEVICE=`** (done 2026-10-13): `device/cheetah/device.conf`; `bin/omamobile` reads the DTB, `soc_id`s, dtbo, boot image values and storage-guard allowlist from it, and checks the allowlist against the initramfs. Cheetah's images came out byte-identical. 2. **Shared initramfs**: one `init` with the per-device quirks (the guard list, cheetah's display trigger write, the USB name) generated from the descriptor, release builds without developer keys or bring-up probes, packed reproducibly; `bin/omamobile overlay` replaces the hand-written `ov` helper. **Mostly done 2026-10-19:** one shared `initramfs/init` for cheetah, felix and oriole, with the display trigger, the guard's allowlist and the USB name packed from the descriptor (test boot on cheetah passed). Left: the main LUN, release builds without developer keys, and `bin/omamobile overlay`. -3. **Kernel package**: `linux-omamobile` (`Image`, modules, every DTB) from a tagged `omamobile-int` snapshot, release `LOCALVERSION`, in `[omamobile]`; `omamobile-device` as the virtual package the device packages provide. +3. **Kernel package**: `linux-omamobile` (`Image`, modules, every DTB) from a release tag on the published `omamobile` branch, release `LOCALVERSION`, in `[omamobile]`; `omamobile-device` as the virtual package the device packages provide. 4. **Device package hook**: `omamobile-boot-update` in `omamobile-device-cheetah` builds the images on the phone and writes slot B through the same guarded, verified path as `push`, keeps the previous set for rollback, never reboots, and is opt-in so development phones keep `bin/omamobile push`. Firmware maps move from the extraction scripts into per-device files. 5. **Release bundles and the installer**: per-device slot-B images, a shared Arch root image, signed checksums, and an `install` script that checks the phone and the factory image, adds the user's own firmware and SSH key to a local copy of the root image, and flashes only `_b` and `userdata`. Replaces the "Installer: not started" row in §1. 6. **CI**: lint and package tests on every push; kernel, DTB validation and twice-built images per device on kernel tags; unsigned bundles on release. Pinned container and toolchain, so the maintainer can rebuild and compare before signing. @@ -159,7 +159,7 @@ The kernel package, the update path for slot B and the installer are designed to 8. **Builds local by default**: every package (Mesa and Hyprland included) and every image builds on the builder's own machine from the repos alone (`tools/build-packages` in the arm64 container, ccache, native arm64 CI runners for speed). Building on a connected phone (`tools/repo-build`) stays an opt-in shortcut, never a requirement. 9. **Second device bring-up as the proof**: a second Pixel (a gs201 sibling first, or a gs101 phone to test the smaller boot image set) built, packaged and installed by the same tools with nothing but its descriptor, DTS, firmware map and device package added. Under way, all community work: the Pixel Fold (felix) boots to its cover screen with its keys and GPU, the Pixel 6 Pro (raven) runs Omarchy on our kernel (its package in review), the Pixel 8 Pro (husky, zuma) boots with USB and SSH and its UFS plan in review, the Pixel 9a (tegu, zumapro) reached first light, the Pixel 7a (lynx) boots to its initramfs, the Pixel 6 (oriole) has its descriptor from a retail phone, and the Pixel 4 (flame, Snapdragon) boots from RAM; board packages now come from each descriptor's `ROOTFS_PACKAGES`, so a non-cheetah image no longer pulls cheetah's. -Alongside every release, **keep linux-omarchy-mobile's branches honest**: publish `omamobile-int` as a tagged snapshot for builders, and run a curation pass that moves what has passed on the phone into the upstream-ready `omamobile` branch (the `omamobile-next` process) and publishes it, so the gap between the two shrinks release by release. +Alongside every release, **keep linux-omarchy-mobile honest**: the release kernel is a tag on the published `omamobile` branch, so a curation pass moves what has passed on the phone out of the local `omamobile-int` into a release branch on `omamobile` before each release ([RELEASES](RELEASES.md) §8), and the gap between the phone's test kernel and the release shrinks release by release. ## 4. How to help diff --git a/tests/all b/tests/all index 4afae7bc4..0558e9bf3 100755 --- a/tests/all +++ b/tests/all @@ -10,7 +10,8 @@ # smoke test of the newest root image in out/ if there is one, the felix, # lynx and panther device packages' own tests, tools/alarm-wake-test's # check, and a contributor's local builds (tools/local-key-init, -# tools/fetch-published, --local). +# tools/fetch-published, --local), and tools/publish-kernel against a +# scratch remote. set -euo pipefail cd -- "$(dirname -- "${BASH_SOURCE[0]}")/.." for f in tools/install-phone tools/phone-provision tools/build-rootfs tools/build-packages tools/make-bundle \ @@ -24,7 +25,7 @@ sh -n device/flame/initramfs/init sh -n device/flame/initramfs/build bash -n tools/build-flame-probe echo "ok - scripts parse" -for t in tests/pr-check tests/kernel-pr-check tests/alarm-wake-test tests/install-phone tests/build-rootfs tests/phone-provision tests/initramfs-grow tests/images-layout tests/device-overlays tests/simplefb-trigger tests/initramfs-steps tests/storage-guard tests/usb-product tests/boot-method tests/make-bundle-keys tests/flame-probe packages/omamobile-firstboot/test/all packages/omamobile-device-felix/test/all packages/omamobile-device-lynx/test/all packages/omamobile-device-panther/test/all tests/local-builds tests/phone-install-package; do +for t in tests/pr-check tests/kernel-pr-check tests/alarm-wake-test tests/install-phone tests/build-rootfs tests/phone-provision tests/initramfs-grow tests/images-layout tests/device-overlays tests/simplefb-trigger tests/initramfs-steps tests/storage-guard tests/usb-product tests/boot-method tests/make-bundle-keys tests/flame-probe packages/omamobile-firstboot/test/all packages/omamobile-device-felix/test/all packages/omamobile-device-lynx/test/all packages/omamobile-device-panther/test/all tests/local-builds tests/phone-install-package tests/publish-kernel; do echo "# $t" "$t" done diff --git a/tests/kernel-pr-check b/tests/kernel-pr-check index 4b7497dd7..84085e0cf 100755 --- a/tests/kernel-pr-check +++ b/tests/kernel-pr-check @@ -70,6 +70,18 @@ git commit -q -am "drivers: a: style" -m "Signed-off-by: A Human &1) || nc_status=$? +[[ $nc_status == 0 ]] || { echo "$nc_out"; fail "--no-checkpatch: exit $nc_status, expected 0"; } +grep -c 'checkpatch: --no-checkpatch # SKIP' <<<"$nc_out" >/dev/null || { echo "$nc_out"; fail "--no-checkpatch: doesn't say it skipped"; } +echo "ok - --no-checkpatch skips checkpatch and still runs the rest" + +branch coauthor +echo x >> drivers/a.c +git commit -q -am "drivers: a: co-authored" -m "Signed-off-by: A Human " -m "Co-Authored-By: Claude Opus 5.5 " +run "a Co-Authored-By trailer" 1 "Co-Authored-By trailers" +echo "ok - a Co-Authored-By trailer fails (the kernel wants Assisted-by)" + # CI runs `kernel-pr-check -C linux` from the directory that contains the # kernel checkout. The path has to still work after the tool cds in. rel_status=0 diff --git a/tests/publish-kernel b/tests/publish-kernel new file mode 100755 index 000000000..d5c2fb6fc --- /dev/null +++ b/tests/publish-kernel @@ -0,0 +1,207 @@ +#!/bin/bash +# SPDX-License-Identifier: MIT +# tools/publish-kernel against a stand-in kernel clone and a bare repository +# in a scratch folder as the published remote, never GitHub. The maintainer +# runs this with push rights, so before anything runs: Git may speak only +# the file protocol, ssh is a command that fails, the global and system +# configs are replaced (the real GitHub URL is rewritten to a path that +# doesn't exist), configs passed in the environment are dropped, and the +# remote must resolve into the scratch folder. A git shim logs every push, +# and the test fails if any of them forces. +# +# Covers: a dry run changes nothing and prints the push, a fast-forward +# publishes, a branch that lacks the published tip is refused with the +# rebase to run, a missing or AI sign-off and a Co-Authored-By are refused, +# a merge commit is refused, a release tag is created and pushed (with a +# branch, and alone on the published tip), an existing tag is refused, and +# no code path forces a push. +set -euo pipefail +here=$(cd -- "$(dirname -- "${BASH_SOURCE[0]}")/.." && pwd) +t=$(mktemp -d) +trap 'rm -rf "$t"' EXIT +fail() { echo "not ok - $*" >&2; exit 1; } +bail() { echo "Bail out! $*" >&2; exit 2; } + +# ------------------------------------------------------------- isolation +unset GIT_CONFIG_PARAMETERS GIT_CONFIG_COUNT GIT_DIR GIT_WORK_TREE GIT_INDEX_FILE GIT_OBJECT_DIRECTORY GIT_ALTERNATE_OBJECT_DIRECTORIES +for v in $(compgen -v GIT_CONFIG_KEY_; compgen -v GIT_CONFIG_VALUE_); do unset "$v"; done +export GIT_CONFIG_NOSYSTEM=1 GIT_CONFIG_GLOBAL=$t/gitconfig GIT_ALLOW_PROTOCOL=file GIT_SSH_COMMAND=false GIT_TERMINAL_PROMPT=0 +github=$(sed -n 's/^remote=\${PUBLISH_KERNEL_REMOTE:-\(.*\)}$/\1/p' "$here/tools/publish-kernel") +[[ -n $github ]] || bail "tools/publish-kernel doesn't take its remote from PUBLISH_KERNEL_REMOTE" +cat > "$GIT_CONFIG_GLOBAL" <&1) == *"transport 'ssh' not allowed"* ]] || bail "Git protocols other than file are allowed" + +# The shim: log every push's arguments, then run the real git. With +# RACE_FROM set, another publisher's push lands just before the tool's. +realgit=$(command -v git) +mkdir "$t/bin" +cat > "$t/bin/git" <> "$t/pushes" + [[ -z \${RACE_FROM:-} ]] || "$realgit" -C "\$RACE_FROM" push -q "$t/remote.git" omamobile + break +done +exec "$realgit" "\$@" +EOF +chmod +x "$t/bin/git" +: > "$t/pushes" +export PATH=$t/bin:$PATH + +# ------------------------------------------------------------- fixture +# The published branch: a squashed base and a community commit. The local +# clone has a stand-in checkpatch for kernel-pr-check's tree check. +sob="Signed-off-by: A Human " +git init -q --bare "$r" +src=$t/community +git init -q "$src" +mkdir -p "$src/scripts" "$src/drivers" +printf '#!/usr/bin/perl\n' > "$src/scripts/checkpatch.pl"; chmod +x "$src/scripts/checkpatch.pl" +printf 'VERSION = 7\nPATCHLEVEL = 3\nSUBLEVEL = 0\nEXTRAVERSION = -rc6\n' > "$src/Makefile" +echo base > "$src/drivers/a.c" +git -C "$src" add -A && git -C "$src" commit -q -m "Linux 7.3-rc6" +echo community > "$src/drivers/b.c" +git -C "$src" add -A && git -C "$src" commit -q -m "drivers: b: a community change" -m "$sob" +"$realgit" -C "$src" push -q "$r" omamobile +k=$t/linux +git clone -q "$r" "$k" +export KERNEL_DIR=$k +kgit() { git -C "$k" "$@"; } +tip() { git -C "$r" rev-parse refs/heads/omamobile; } +change() { # branch message...: a commit on a new local branch from the published tip + local b=$1; shift + kgit fetch -q origin + kgit checkout -q -B "$b" origin/omamobile + echo "$b" >> "$k/drivers/a.c" + local m=(); for x in "$@"; do m+=(-m "$x"); done + kgit commit -q -a "${m[@]}" +} +publish() { # ok|fail pattern args...: the run's exit and a line it must print + local want=$1 pattern=$2 status=0; shift 2 + out=$("$here/tools/publish-kernel" "$@" 2>&1) || status=$? + [[ ($want == ok && $status == 0) || ($want == fail && $status != 0) ]] || { echo "$out" >&2; fail "publish-kernel $*: exit $status, expected $want"; } + [[ -z $pattern ]] || grep -c -- "$pattern" <<<"$out" >/dev/null || { echo "$out" >&2; fail "publish-kernel $*: doesn't say '$pattern'"; } +} + +# ------------------------------------------------------------- cases +p0=$(tip) +change rel "drivers: a: curated work" "$sob" "Assisted-by: LLM" +head=$(kgit rev-parse rel) +publish ok "Dry run" --dry-run --tag kernel-2026.11.05 rel +[[ $(tip) == "$p0" ]] || fail "a dry run moved the published branch" +! kgit rev-parse -q --verify refs/tags/kernel-2026.11.05 >/dev/null || fail "a dry run created a tag" +[[ ! -s $t/pushes ]] || fail "a dry run pushed" +grep -cF "git push --atomic --no-follow-tags file://$r $head:refs/heads/omamobile refs/tags/kernel-2026.11.05" <<<"$out" >/dev/null || { echo "$out"; fail "a dry run doesn't print the exact push"; } +grep -cF "uname -r 7.3.0-rc6-omamobile-g${head:0:12}" <<<"$out" >/dev/null || { echo "$out"; fail "a dry run doesn't name the release build's uname"; } +echo "ok - a dry run prints the exact push and the release uname, and changes nothing" + +publish ok "fast-forward" rel +[[ $(tip) == "$head" ]] || fail "the fast-forward didn't publish" +[[ $(git -C "$r" rev-parse "$head^") == "$p0" ]] || fail "the published history changed" +echo "ok - a release branch on the published tip is published as a fast-forward" + +# A community merge lands on GitHub while a stale release branch waits. +p1=$(tip) +git -C "$src" pull -q "$r" omamobile +echo more > "$src/drivers/c.c" +git -C "$src" add -A && git -C "$src" commit -q -m "drivers: c: merged on GitHub meanwhile" -m "$sob" +"$realgit" -C "$src" push -q "$r" omamobile +p2=$(tip) +kgit checkout -q -B stale "$p1" +echo stale >> "$k/drivers/a.c" +kgit commit -q -a -m "drivers: a: built on an old tip" -m "$sob" +publish fail "git rebase FETCH_HEAD stale" stale +[[ $(tip) == "$p2" ]] || fail "a branch without the published tip was pushed" +grep -c 'not be a fast-forward' <<<"$out" >/dev/null || { echo "$out"; fail "the refusal doesn't say why"; } +kgit rebase -q FETCH_HEAD stale +publish ok "fast-forward" stale +[[ $(git -C "$r" rev-parse "$(tip)^") == "$p2" ]] || fail "the rebased branch didn't publish on the new tip" +echo "ok - a branch that lacks the published tip is refused with the rebase to run, and publishes after it" + +p3=$(tip) +change nosob "drivers: a: unsigned" +publish fail "no human Signed-off-by" nosob +change aisob "drivers: a: AI signs" "$sob" "Signed-off-by: Claude " +publish fail "from an AI agent" aisob +change coauthor "drivers: a: co-authored" "$sob" "Co-Authored-By: Claude Opus 5.5 " +publish fail "Co-Authored-By trailers" coauthor +change coauthor-dry "drivers: a: co-authored" "$sob" "Co-Authored-By: Claude Opus 5.5 " +publish fail "Co-Authored-By trailers" --dry-run coauthor-dry +[[ $(tip) == "$p3" ]] || fail "a commit that fails the checks was published" +echo "ok - a missing or AI sign-off and a Co-Authored-By are refused, in a dry run too" + +change side "drivers: a: one side" "$sob" +kgit checkout -q -b merged origin/omamobile +echo other > "$k/drivers/d.c"; kgit add -A; kgit commit -q -m "drivers: d: other side" -m "$sob" +kgit merge -q --no-edit side +publish fail "merge commits" merged +[[ $(tip) == "$p3" ]] || fail "a merge was published" +echo "ok - a merge commit is refused" + +change tagged "drivers: a: release work" "$sob" "Assisted-by: LLM" +publish ok "Tagged kernel-2026.11.05" --tag kernel-2026.11.05 tagged +head=$(kgit rev-parse tagged) +[[ $(tip) == "$head" ]] || fail "the branch didn't move with the tag" +[[ $(git -C "$r" cat-file -t refs/tags/kernel-2026.11.05) == tag ]] || fail "the release tag isn't annotated" +[[ $(git -C "$r" rev-parse 'refs/tags/kernel-2026.11.05^{commit}') == "$head" ]] || fail "the release tag isn't on the published commit" +git -C "$r" cat-file tag refs/tags/kernel-2026.11.05 | grep -cF "uname -r 7.3.0-rc6-omamobile-g${head:0:12}" >/dev/null || fail "the tag doesn't name the release uname" +publish fail "exists already" --tag kernel-2026.11.05 tagged +kgit tag -d kernel-2026.11.05 >/dev/null +publish fail "a respin takes the next" --tag kernel-2026.11.05 tagged +publish fail "a release tag is kernel-YYYY.MM.DD" --tag v1.0 tagged +echo "ok - a release tag is created on the published commit and pushed with it; an existing or misnamed tag is refused" + +# A community merge after the release: tag the published tip alone. +git -C "$src" pull -q "$r" omamobile +echo later > "$src/drivers/e.c" +git -C "$src" add -A && git -C "$src" commit -q -m "drivers: e: merged after the release" -m "$sob" +"$realgit" -C "$src" push -q "$r" omamobile +p4=$(tip) +publish ok "Nothing to publish" +publish ok "Tagged kernel-2026.11.05.1" --tag kernel-2026.11.05.1 +[[ $(git -C "$r" rev-parse 'refs/tags/kernel-2026.11.05.1^{commit}') == "$p4" && $(tip) == "$p4" ]] || fail "the tag alone isn't on the published tip" +echo "ok - with no branch, --tag tags the published tip and moves nothing" + +kgit checkout -q -B gone origin/omamobile +mv "$r" "$r.gone" +publish fail "can't read omamobile" gone +mv "$r.gone" "$r" +git -C "$r" branch -q -m omamobile renamed +publish fail "has no omamobile branch" gone +git -C "$r" branch -q -m renamed omamobile +echo "ok - an unreadable remote or a missing branch stops before anything is pushed" + +# Another publisher moves the branch between the tool's fetch and its push: +# git itself refuses the push, and the tag goes nowhere. +git -C "$src" pull -q "$r" omamobile +echo race > "$src/drivers/f.c" +git -C "$src" add -A && git -C "$src" commit -q -m "drivers: f: merged during the run" -m "$sob" +change racing "drivers: a: racing" "$sob" +RACE_FROM=$src publish fail "the push was refused" --tag kernel-2026.11.06 racing +[[ $(tip) == $(git -C "$src" rev-parse HEAD) ]] || fail "the other publisher's commit was overwritten" +! git -C "$r" rev-parse -q --verify refs/tags/kernel-2026.11.06 >/dev/null || fail "the tag was pushed without its branch" +! kgit rev-parse -q --verify refs/tags/kernel-2026.11.06 >/dev/null || fail "the local tag of a refused push stayed" +echo "ok - a branch that moved during the run is not overwritten, and its tag isn't pushed" + +# ------------------------------------------------------------- no force +[[ -s $t/pushes ]] || fail "the push log is empty: the shim didn't run" +if grep -E -- '(^| )(-f|--force[^ ]*|--mirror|--delete|-d|--prune|\+[^ ]*)( |$)' "$t/pushes"; then + fail "a push above forced, deleted or mirrored" +fi +grep -E -- '--force|--mirror|--delete|push -f|[ "]\+refs|\+\$' "$here/tools/publish-kernel" && fail "tools/publish-kernel contains a forcing push" +grep -c -- '--atomic --no-follow-tags' "$t/pushes" >/dev/null || fail "the pushes weren't the tool's" +echo "ok - no push forced, deleted or mirrored ($(wc -l < "$t/pushes") pushes logged), and the tool has no forcing push" diff --git a/tools/kernel-pr-check b/tools/kernel-pr-check index efca37ea9..a02c7ee09 100755 --- a/tools/kernel-pr-check +++ b/tools/kernel-pr-check @@ -6,6 +6,8 @@ # # - every commit has a human Signed-off-by, one of them the author's (the # DCO), and none from an AI agent (an Assisted-by tag credits it); +# - no Co-Authored-By trailer: the kernel credits an AI with Assisted-by +# and a human co-author with Co-developed-by plus a sign-off; # - every subject has a subsystem prefix ("clk: samsung: ..."); # - scripts/checkpatch.pl --strict on each commit, against that commit's # bindings and MAINTAINERS: errors fail, warnings @@ -22,7 +24,7 @@ # clang, ld.lld and, for the schema checks, dtschema (`pip install # dtschema`); a missing tool skips its check and says so. # -# tools/kernel-pr-check [-C KERNEL] [--build OUT] [--merge] BASE [HEAD] +# tools/kernel-pr-check [-C KERNEL] [--build OUT] [--merge] [--no-checkpatch] BASE [HEAD] # # KERNEL defaults to $KERNEL_BASE/linux (~/omamobile-kernel/linux, or # ~/android/mainline/linux on older setups), HEAD to HEAD. It reads git and @@ -34,6 +36,9 @@ # still read only HEAD's own commits. Without it the builds compare HEAD # with its merge base, so a fix that reached BASE after the branch was cut # never shows (L-154). A merge that conflicts fails with "rebase needed". +# +# --no-checkpatch skips checkpatch: tools/publish-kernel runs the commit and +# policy checks this way, and leaves checkpatch to the full gate. set -uo pipefail # sort and comm must agree on the order, whatever the caller's locale. export LC_ALL=C @@ -48,17 +53,19 @@ fi kernel=$KERNEL_BASE/linux out="" merge=0 +checkpatch=1 while (($#)); do case $1 in -C) kernel=${2:?-C needs a kernel tree}; shift 2 ;; --build) out=${2:?--build needs an output directory}; shift 2 ;; --merge) merge=1; shift ;; - -h|--help) sed -n '3,35p' "$self"; exit 0 ;; + --no-checkpatch) checkpatch=0; shift ;; + -h|--help) sed -n '3,41p' "$self"; exit 0 ;; -*) echo "kernel-pr-check: unknown option $1" >&2; exit 2 ;; *) break ;; esac done -base=${1:?Usage: kernel-pr-check [-C KERNEL] [--build OUT] [--merge] BASE [HEAD]} +base=${1:?Usage: kernel-pr-check [-C KERNEL] [--build OUT] [--merge] [--no-checkpatch] BASE [HEAD]} head=${2:-HEAD} # -C may be relative to the caller's directory. This script changes into # the tree and then runs pr-check with the same path, so resolve it first. @@ -120,7 +127,7 @@ $(sed -n '2,/^$/p' <<<"$mtree" | sed '/^$/d; s/^/ /')" fi # ---------------------------------------------------------------- commits -sob_bad="" prefix_bad="" +sob_bad="" prefix_bad="" coauthor_bad="" for c in $commits; do short=$(git log -1 --format='%h %s' "$c") author=$(git log -1 --format='%ae' "$c") @@ -132,17 +139,22 @@ for c in $commits; do sob_bad+=" $short: no Signed-off-by from the author <$author>"$'\n' fi grep -qiE "$ai" <<<"$sobs" && sob_bad+=" $short: a Signed-off-by from an AI agent"$'\n' + git log -1 --format=%B "$c" | grep -ciE '^Co-authored-by:' >/dev/null && coauthor_bad+=" $short"$'\n' subject=$(git log -1 --format=%s "$c") [[ $subject =~ ^[A-Za-z0-9_./,+-]+(:[[:space:]][A-Za-z0-9_./,+-]+)*:[[:space:]] ]] || prefix_bad+=" $short"$'\n' done n=$(wc -w <<<"$commits") [[ -z $sob_bad ]] && pass "$n commits signed off by their authors, none by an AI" || fail "sign-offs (Documentation/process/submitting-patches.rst, coding-assistants.rst): ${sob_bad%$'\n'}" +[[ -z $coauthor_bad ]] && pass "no Co-Authored-By trailers" || fail "Co-Authored-By trailers (credit an AI with Assisted-by, a human co-author with Co-developed-by and a sign-off; coding-assistants.rst, submitting-patches.rst): +${coauthor_bad%$'\n'}" [[ -z $prefix_bad ]] && pass "subjects have subsystem prefixes" || fail "subjects without a subsystem prefix (see git log --oneline ): ${prefix_bad%$'\n'}" # ---------------------------------------------------------------- checkpatch # checkpatch as the base has it: a pull request can't change its own checker. +# (The section is not indented: its messages span lines.) +if ((checkpatch)); then cpdir=$(mktemp -d) trap 'rm -rf "$cpdir" ${mdir:+"$mdir"}' EXIT mkdir -p "$cpdir/checker" "$cpdir/tree/Documentation" @@ -179,6 +191,9 @@ done ${cp_errors%$'\n'}" # The warnings themselves, so a reviewer reads them without rerunning it. [[ -n $cp_warnings ]] && printf '%s' "$cp_warnings" +else + skip "checkpatch: --no-checkpatch" +fi # ---------------------------------------------------------------- policy policy=$("$repo/tools/pr-check" -C "$kernel" "$base" "$head" 2>&1); status=$? diff --git a/tools/publish-kernel b/tools/publish-kernel index dff306e4c..ed6634821 100755 --- a/tools/publish-kernel +++ b/tools/publish-kernel @@ -1,14 +1,49 @@ #!/bin/bash # SPDX-License-Identifier: MIT -# Publish our kernel branch to github.com/derekross/linux-omarchy-mobile. +# Publish the release kernel: move linux-omarchy-mobile's `omamobile` branch +# on GitHub forward to a local release branch, and tag a release on it +# (docs/RELEASES.md section 8). # -# Linux's full history is too big for a private repository (and a private repo -# can't be a fork of Linus's tree), so the published branch starts from one -# commit holding the exact upstream tag's tree, with our commits replayed on -# top unchanged. The trees are identical to the local branch, which keeps the -# real upstream history for sending patches. -# tools/publish-kernel [branch] [upstream-tag] (defaults: omamobile v7.3-rc6) +# `omamobile` on GitHub is the one source of the release kernel. Community +# pull requests land there (rebase merges); the maintainer's curated work +# lands as a fast-forward of a local release branch built on the current +# published tip. So this tool: +# - fetches the published tip first and pushes only when BRANCH contains +# it (a fast-forward); otherwise it stops and says how to rebase. It +# never force-pushes: pull requests and release tags point at the +# published commit ids; +# - checks every commit it would publish with tools/kernel-pr-check's +# commit checks (the author's human Signed-off-by, none from an AI, +# Assisted-by rather than Co-Authored-By, subject prefixes, identifiers +# and blobs) and refuses merge commits; checkpatch and the builds are the +# full gate's (RELEASES section 11, step 2); +# - with --tag, creates an annotated release tag on the published commit +# and pushes it with the branch, atomically; +# - with --dry-run, reads and checks everything and prints the commands it +# would run, changing nothing. +# +# tools/publish-kernel [--dry-run] [--tag kernel-YYYY.MM.DD] [BRANCH] +# +# BRANCH is a branch or commit in the kernel clone. Without it the published +# tip itself is used, which only does something with --tag (a release on a +# tip that community merges moved). The kernel clone is $KERNEL_DIR, else +# $KERNEL_BASE/linux; the remote is $PUBLISH_KERNEL_REMOTE, else GitHub. set -euo pipefail +self=$(readlink -f "${BASH_SOURCE[0]}") +repo=$(cd -- "$(dirname -- "$self")/.." && pwd) +usage="Usage: tools/publish-kernel [--dry-run] [--tag kernel-YYYY.MM.DD] [BRANCH]" +dry=0 tag="" +while (($#)); do + case $1 in + -n|--dry-run) dry=1; shift ;; + --tag) tag=${2:?--tag needs a name}; shift 2 ;; + -h|--help) sed -n '3,30p' "$self"; exit 0 ;; + -*) echo "publish-kernel: unknown option $1" >&2; echo "$usage" >&2; exit 2 ;; + *) break ;; + esac +done +(($# <= 1)) || { echo "$usage" >&2; exit 2; } +branch=${1:-} # The kernel clone, its worktrees and build outputs live in KERNEL_BASE: # ~/omamobile-kernel, or ~/android/mainline on setups from before 2026-10-29. @@ -17,55 +52,108 @@ if [[ -z ${KERNEL_BASE:-} ]]; then [[ -d $KERNEL_BASE || ! -d $HOME/android/mainline ]] || KERNEL_BASE=$HOME/android/mainline fi linux=${KERNEL_DIR:-$KERNEL_BASE/linux} -branch=${1:-omamobile} -tag=${2:-v7.3-rc6} -remote=git@github.com:derekross/linux-omarchy-mobile.git +remote=${PUBLISH_KERNEL_REMOTE:-git@github.com:derekross/linux-omarchy-mobile.git} +target=omamobile + +die() { echo "publish-kernel: $*" >&2; exit 1; } +# Release tags follow the bundle's calendar version (RELEASES section 7): +# kernel-2026.11.05, kernel-2026.11.05.1 for a respin the same day. +if [[ -n $tag && ! $tag =~ ^kernel-[0-9]{4}\.[0-9]{2}\.[0-9]{2}(\.[0-9]+)?$ ]]; then + echo "publish-kernel: a release tag is kernel-YYYY.MM.DD (kernel-YYYY.MM.DD.1 for a respin), not $tag" >&2 + exit 2 +fi +cd -- "$linux" || exit 2 +linux=$(pwd) + +# The published tip. ls-remote exits 2 only when the remote answered and has +# no such branch; any other failure is not taken for an answer. +st=0 +refs=$(git ls-remote --exit-code "$remote" "refs/heads/$target") || st=$? +((st != 2)) || die "$remote has no $target branch; this tool only moves an existing one forward" +((st == 0)) || die "can't read $target from $remote (git ls-remote exit $st); nothing published" +pub=$(awk -v r="refs/heads/$target" '$2 == r { print $1 }' <<<"$refs") +git fetch -q --no-tags "$remote" "refs/heads/$target" || die "can't fetch $target from $remote; nothing published" +[[ $(git rev-parse FETCH_HEAD) == "$pub" ]] || die "$target moved on $remote while it was read; run again" + +head=$pub +if [[ -n $branch ]]; then + head=$(git rev-parse -q --verify "$branch^{commit}") || { echo "publish-kernel: no branch or commit $branch in $linux" >&2; exit 2; } +fi +if [[ $head != "$pub" ]] && ! git merge-base --is-ancestor "$pub" "$head"; then + cat >&2 <&2; exit 1; } +new=$(git rev-list --reverse "$pub..$head") +n=$(wc -w <<<"$new") +if ((n)); then + merges=$(git rev-list --merges "$pub..$head") + [[ -z $merges ]] || die "merge commits in $branch since the published tip; publish a linear series (rebase it): +$(git log --no-walk --format=' %h %s' $merges)" + echo "# tools/kernel-pr-check --no-checkpatch on the $n commit(s) to publish" + "$repo/tools/kernel-pr-check" --no-checkpatch -C "$linux" "$pub" "$head" \ + || die "the commits to publish fail the checks above; nothing published" +fi -tree=$(git rev-parse "$tag^{tree}") -base=$(GIT_AUTHOR_NAME="Linus Torvalds" GIT_AUTHOR_EMAIL="torvalds@linux-foundation.org" \ - GIT_AUTHOR_DATE="$(git log -1 --format=%aD "$tag")" GIT_COMMITTER_DATE="$(git log -1 --format=%aD "$tag")" \ - git commit-tree "$tree" -m "Linux ${tag#v} +if [[ -n $tag ]]; then + ! git rev-parse -q --verify "refs/tags/$tag" >/dev/null || die "a local tag $tag exists already ($(git rev-parse --short=12 "$tag^{commit}"))" + st=0 + git ls-remote --exit-code --tags "$remote" "refs/tags/$tag" >/dev/null || st=$? + ((st != 0)) || die "$remote has a tag $tag already; a release tag never moves, so a respin takes the next .N" + ((st == 2)) || die "can't read tags from $remote (git ls-remote exit $st); nothing published" +fi -The tree of Linus Torvalds' $tag tag ($(git rev-parse "$tag^{commit}")), -squashed so this repository stays small. Omarchy Mobile's changes follow as -individual commits; they apply unchanged on top of the upstream tag.") +# What a release build of this commit reports (RELEASES section 4): the +# published branch has no upstream tag in its history, so setlocalversion +# appends -g and 12 hex digits, and pkgver counts commits to sort upward +# (the branch only ever moves forward). +mk=$(git show "$head:Makefile" 2>/dev/null || true) +mkv() { awk -v k="$1" '$1 == k && $2 == "=" { print $3; exit }' <<<"$mk"; } +kver="" +[[ -z $(mkv VERSION) ]] || kver="$(mkv VERSION).$(mkv PATCHLEVEL).$(mkv SUBLEVEL)$(mkv EXTRAVERSION)" +uname="$kver-omamobile-g${head:0:12}" +pkgver="${kver//-/}.r$(git rev-list --count "$head").g${head:0:12}" -# Published commit ids must stay put: pull requests are based on them, and a -# full replay gives every commit a new id. So when the published tip has the -# tree of a commit on the local branch, replay only the commits after it, on -# top of the published tip, and push a fast-forward. Only when no such commit -# exists (local history rewritten) is the branch rebuilt and force-pushed. -pub= -git fetch -q "$remote" "refs/heads/$branch" 2>/dev/null && pub=$(git rev-parse FETCH_HEAD) -from= -if [[ -n $pub ]]; then - ptree=$(git rev-parse "$pub^{tree}") - for c in $(git rev-list "$tag..$branch"); do - [[ $(git rev-parse "$c^{tree}") == "$ptree" ]] && { from=$c; break; } - done +refspecs=() +[[ $head == "$pub" ]] || refspecs+=("$head:refs/heads/$target") +[[ -z $tag ]] || refspecs+=("refs/tags/$tag") +if ((${#refspecs[@]} == 0)); then + echo "Nothing to publish: ${branch:-the published tip} is $target on $remote (${pub:0:12}). --tag tags it." + exit 0 fi +# No force of any kind, so git itself refuses anything but a fast-forward, +# even if the remote moved since the fetch; --atomic keeps the tag off a +# branch push that failed; --no-follow-tags pushes no other local tag. +push=(git push --atomic --no-follow-tags "$remote" "${refspecs[@]}") +msg="Omarchy Mobile kernel ${tag#kernel-} + +The release kernel: linux-omarchy-mobile's $target at ${head:0:12}. +A release build reports uname -r $uname +and packs as linux-omamobile $pkgver." -# Replay in a throwaway worktree, so no checkout in use changes. -work=$(mktemp -d) -trap 'git worktree remove --force "$work" >/dev/null 2>&1 || true' EXIT -git worktree add -q --detach "$work" "$branch" -if [[ -n $from ]]; then - git -C "$work" rebase -q --onto "$pub" "$from" -else - git -C "$work" rebase -q --onto "$base" "$tag" +if ((n)); then + echo "Commits to publish on $target ($n, fast-forward from ${pub:0:12}):" + git log --reverse --format=' %h %s' "$pub..$head" +fi +echo "Release build: uname -r $uname, pkgver $pkgver" +if ((dry)); then + echo "Dry run; would run:" + [[ -z $tag ]] || echo " git tag -a $tag -m $(printf '%q' "$msg") ${head:0:12}" + echo " $(printf '%q ' "${push[@]}")" + exit 0 fi -published=$(git -C "$work" rev-parse HEAD) -[[ -z $(git diff "$branch" "$published") ]] || { echo "Replayed tree differs from $branch; not publishing" >&2; exit 1; } -git branch -f "publish/$branch" "$published" -if [[ -n $from ]]; then - git push "$remote" "publish/$branch:refs/heads/$branch" - echo "Published $branch to $remote: $(git rev-list --count "$pub..$published") new commit(s), fast-forward" -else - echo "No published commit matches $branch's history: rebuilding, which changes every published commit id" >&2 - git push --force "$remote" "publish/$branch:refs/heads/$branch" - echo "Published $branch ($(git rev-list --count "$tag..$branch") commits on $tag) to $remote" +[[ -z $tag ]] || git tag -a "$tag" -m "$msg" "$head" +if ! "${push[@]}"; then + [[ -z $tag ]] || git tag -d "$tag" >/dev/null + die "the push was refused; nothing published. If $target moved, rebase as above and run again" fi +((n == 0)) || echo "Published $target on $remote: ${pub:0:12}..${head:0:12}, $n new commit(s), fast-forward" +[[ -z $tag ]] || echo "Tagged $tag on ${head:0:12} and pushed it" From b35741fa8b56b6b25084f4b2bf84aba48e544fa8 Mon Sep 17 00:00:00 2001 From: Derek Ross Date: Sun, 1 Nov 2026 20:27:11 -0500 Subject: [PATCH 2/3] RELEASES: record the first-release decisions of 2026-11-01 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The maintainer decided all twelve items of the release decisions brief, with the kernel source changed to a tag on the published omamobile branch after the curated commits land there by fast-forward. §12 turns from open questions into that record, and the sections the decisions change say so: the kernel package is packed on the build machine with the pinned AOSP clang (§4, §9); one root image per device, a signed JSON manifest with per-file sizes and hashes and the install checks as data for a future web flasher and desktop installer, and hosting next to [omamobile] with the GitHub Release carrying notes and links, never any Google firmware (§6); the first release's version and label (§7); signing with the release key and users on stable (§10); the attended test install gating the release, and the upload and promotion (§11). Co-Authored-By: Claude Opus 5.5 Claude-Session: https://claude.ai/code/session_01BeEcdVeSfyLCbijF8XQF1d --- docs/RELEASES.md | 47 ++++++++++++++++++++++++++++++----------------- 1 file changed, 30 insertions(+), 17 deletions(-) diff --git a/docs/RELEASES.md b/docs/RELEASES.md index d1566d624..753e03c97 100644 --- a/docs/RELEASES.md +++ b/docs/RELEASES.md @@ -144,7 +144,7 @@ One package for every device, in `[omamobile]`. - **No initramfs, no boot images.** Those are per device and come from the device package's hook (§5). - **Release string:** `CONFIG_LOCALVERSION` becomes `-omamobile` for release builds and `CONFIG_LOCALVERSION_AUTO` stays on. The published branch starts from a squashed commit, so no upstream tag is in its history and `setlocalversion` appends only the commit: `uname -r` is `7.3.0-rc6-omamobile-g` (`-dirty` if the checkout isn't clean), which names the tagged commit exactly. `tools/publish-kernel` prints it, and the tag's message records it. The `-push1` suffix stays for development builds, so a development kernel can never be mistaken for a packaged one. - **pkgver:** the version without its `-` (pacman forbids `-`), then the number of commits in the tag's history and the commit: `7.3.0rc6.r.g` (`n` from `git rev-list --count kernel-`). `omamobile` only moves forward, so `n` grows from release to release and pkgver sorts upward. `pkgrel` counts packaging-only changes. -- **Build:** cross-compiled in the existing docker environment on x86 (`bin/omamobile kernel` and `modules`, unchanged), then packed by a `PKGBUILD` that only copies the build output (`arch=(aarch64)`, no compile step), so it can run on the laptop under `makepkg --config` with `CARCH=aarch64`. Building the kernel on the phone is possible but slow; the decision is §11. +- **Build:** cross-compiled in the existing docker environment on x86 (`bin/omamobile kernel` and `modules`, unchanged), then packed by a `PKGBUILD` that only copies the build output (`arch=(aarch64)`, no compile step), so it can run on the build machine under `makepkg --config` with `CARCH=aarch64` (decided, §12.1). The compiler is the standalone AOSP clang prebuilt at a pinned revision, with pinned copies of the AOSP image scripts (`mkbootimg`, `mkdtboimg.py`, `avbtool`) (decided, §12.2). - **Headers** (`linux-omamobile-headers`) can follow when something needs out-of-tree modules (DKMS); nothing does today. - **Old modules:** a pacman upgrade removes the previous release's modules. The hook therefore keeps one copy of the previous `/usr/lib/modules/` in `/var/lib/omamobile/boot/previous/` together with the previous slot-B images, so a rollback restores both (§5.3). @@ -242,7 +242,7 @@ For a first install, or to recover a phone that won't boot. One bundle per devic | The bundle | `tools/make-bundle` | `out/bundle/omamobile--/` as below, `SHA256SUMS.sig` from `keys/` | | Per-phone data | `tools/phone-provision` | the extract tools on the user's factory image, pushed over USB SSH, plus the phone's own backup (modem board id and NV checksums, camera data, settings, home screens, fingerprint state only with `--fingerprint`) | -Decisions taken in building it: the device packages are **installed** in the image, not only cached (one device so far; a first boot without a package step has one less way to fail; §12 decision 6 stays open for the second device); the image's `[omarchy]` is Omarchy's **stable** channel (from 2026-10-20; before that edge was the only one with aarch64 builds of `omarchy`, `omarchy-settings` and `quickshell`, and edge then moved to 4.5.0rc1, which the phone's patches don't apply to); the image is per device (its `MANIFEST` names the device, and the installer refuses a mismatch). +Decisions taken in building it: the device packages are **installed** in the image, not only cached (a first boot without a package step has one less way to fail); the image's `[omarchy]` is Omarchy's **stable** channel (from 2026-10-20; before that edge was the only one with aarch64 builds of `omarchy`, `omarchy-settings` and `quickshell`, and edge then moved to 4.5.0rc1, which the phone's patches don't apply to); the image is per device (decided, §12.6; its `MANIFEST` names the device, and the installer refuses a mismatch). Root image filenames include the device so two devices can share a version without overwriting each other. Builds use separate temporary directories and refuse a concurrent build of the same device/version in the same output directory. Compression and smoke checks finish before replacing the published files. `--local NAME` still uses `out/NAME/repo` and writes images under `out/NAME/`; use `--rootfs` to select one there. Independent package snapshots also need separate `ALARM_CACHE` directories (§10). Repository-mode installation and bundling select only images whose root `MANIFEST` matches the device, including older filenames. @@ -255,7 +255,8 @@ omamobile--/ device.conf the descriptor the images were built from images/boot.img init_boot.img vendor_boot.img vendor_kernel_boot.img dtbo.img MANIFEST kernel release, package versions, both repositories' commits - SHA256SUMS SHA256SUMS.sig checksums of everything above, signed + manifest.json the same as data, with the install checks (below) + SHA256SUMS SHA256SUMS.sig checksums of everything above, signed with the release key omamobile-rootfs---aarch64.img.zst .sha256 .MANIFEST ``` @@ -275,6 +276,10 @@ The bundle's signed `SHA256SUMS` covers its `MANIFEST`, which names the exact ro `bin/omamobile flash` stays the developer's tool; `install` is for everyone else and is deliberately narrower. +**Ready for a web flasher and a desktop installer** (decided, §12.7; to build before the first release). The bundle carries `manifest.json`, covered by the signed `SHA256SUMS`: format version, release version, codename, product name, every file with its path, size and SHA-256, the kernel release and both commits, the release's URLs, and the install checks as data (the expected `fastboot getvar product`, unlocked bootloader, both bootloader slots on the same version, each `BOOT_IMAGES` entry flashed only to `_b` with its expected size, `userdata` with the root image, then `--set-active=b` and reboot, and nothing else). `install` reads those checks too, so every installer enforces one set of rules. + +**Hosting** (decided, §12.7): bundles and root images live on our own server next to `[omamobile]` (`pkgs.omamobile.org/releases///`, with a per-device "latest stable" index and CORS headers), because a root image (about 2.7 GB) is over GitHub's per-file limit; the GitHub Release for `release-` carries the notes and the links. No Google firmware is ever hosted, in a bundle or anywhere else: every installer extracts it from the user's own factory image on the user's machine. + ## 7. Versions and tags | Thing | Version | Where it is recorded | @@ -284,7 +289,7 @@ The bundle's signed `SHA256SUMS` covers its `MANIFEST`, which names the exact ro | Descriptor | none of its own; a change to it is a device-package change and bumps that package | `omamobile-device-` | | Bundle | calendar version ``, with `.1`, `.2` for a respin the same day | tag `release-` in this repository, covering every device released that day; `MANIFEST` pins the kernel tag, every package version and both commits | -A release never contains a kernel or package that isn't in `[omamobile]` at the same moment, so a bundle install and `omarchy update` meet at the same versions. +A release never contains a kernel or package that isn't in `[omamobile]` at the same moment, so a bundle install and `omarchy update` meet at the same versions. The first release is `2026.MM.DD`, labelled "developer preview", for the Pixel 7 Pro only (§12.12). ## 8. The kernel branches @@ -305,7 +310,7 @@ A release never contains a kernel or package that isn't in `[omamobile]` at the - Set `KBUILD_BUILD_TIMESTAMP`, `KBUILD_BUILD_USER`, `KBUILD_BUILD_HOST` and `SOURCE_DATE_EPOCH` from the tagged commit. - Pack the initramfs with fixed mtimes, a sorted list and `cpio --reproducible`, and without `authorized_keys` (§5.2). - Pin the Alpine minirootfs and APKs by checksum (the minirootfs is already pinned; `alpine-fetch.py` should pin the APKs too). -- The clang comes from a 400 GB LineageOS checkout today. A release build should use the AOSP clang prebuilt alone, or the distro's LLVM in the container; either changes the kernel's bytes once, so it's a decision (§11), made before the first release. +- The clang comes from a 400 GB LineageOS checkout today; release builds use the pinned AOSP clang prebuilt instead (decided, §12.2), which changes the kernel's bytes once, so one cheetah boot from it comes before the release kernel is built. **CI** (GitHub Actions, or any runner with docker): @@ -323,6 +328,8 @@ CI never holds the signing key and never sees a factory image. The maintainer do - **The release key** (2026-10-26, `20567593566EEEE2DD8864608632C8075EB94673`) is an ed25519 primary that only certifies, with an ed25519 signing subkey that expires 2028-10-26. `tools/release-key-init` made it once, on a tmpfs: the primary's secret (passphrase-protected), its revocation certificate and the public key are kept offline by the maintainer, in a password manager, and the passphrase separately. The build machine holds only the signing subkey, without a passphrase, in `keys/gnupg.release` (with `keys/fingerprint.release`), so a scheduled publish can sign unattended. Phones trust the primary, so a lost build machine costs a subkey: revoke it and certify a new one from the offline primary, and phones keep working. - **Renew the subkey before 2028-10-26** (`--quick-set-expire` from the offline primary, then re-export the public key into `omamobile-keyring`). An expired subkey's signatures stop verifying. +- **Releases sign with the release key** (decided, §12.4): before the first bundle, `tools/build-packages`, `tools/make-bundle` and the publish switch from `keys/gnupg` to `keys/gnupg.release`. +- **Users follow `stable`, builders and testers `development`** (decided, §12.9). Release images point `[omamobile]` at `stable` on `pkgs.omamobile.org`: the device package's `omamobile-mirrorlist` becomes that URL instead of a local `file://` path. - **The move from the original key.** The original package key (2026-10-12, `6C84FE3D240709E70E27CC94B301F5EA62B249FE`, `keys/gnupg`) still signs packages, the database and bundles. `omamobile-keyring` 20261026 trusts both keys and is itself signed by the original, so phones accept the release key with an ordinary update. Then: switch the build tools to the release key (`keys/gnupg.release`), and once published phones have that keyring, move the original key to `omamobile-revoked`. `tools/install-phone` accepts either key's signature on a bundle until then. - Rotation and revocation go through `omamobile-keyring`'s `omamobile-trusted` and `omamobile-revoked`, as Arch's keyring does. - **Publishing** (`tools/repo-publish`): `pkgs.omamobile.org` has two channels, `development/aarch64` and `stable/aarch64`. `repo-publish development` builds what changed (`build-packages --all`), checks every package's checksum and signature against `omamobile-keyring`'s trusted keys, and uploads packages first, then the index, then the pruning; each channel keeps the current and the previous index's files. `repo-publish stable` promotes development's signed files unchanged, after asking. The maintainer's laptop runs it daily from a clean `origin/main` checkout (`--from-main`, `tools/systemd/omamobile-publish.timer`), and `--remind` opens a "Ready for stable" issue when development has differed from stable for three days. Experimental phones' device packages are published to development only. The server account needs the `deployers` group. @@ -347,18 +354,24 @@ Per release, in order. Stop at any failed step. 3. **Build** the kernel from the tag in the pinned container, release `LOCALVERSION`; pack `linux-omamobile`. 4. **Images** for every device: `DEVICE= bin/omamobile initramfs --release`, then `DEVICE= bin/omamobile images`, twice, checksums equal. 5. **Packages:** every changed package has a bumped `version`, its `test/all` passes, `tools/build-packages` builds and signs them and the database on the laptop (`tools/repo-build` on a phone only as an opt-in shortcut). -6. **Test install** on each released device, attended: the bundle's `install` on a phone whose stock slot A and backups are known good; first boot, device package installed, `omarchy update` clean, then a package-hook kernel update and a reboot into it. +6. **Test install** on each released device, attended (this gates the release, §12.10): the bundle's `install` on a phone whose stock slot A and backups are known good; first boot, device package installed, `omarchy update` clean, then a package-hook kernel update and a reboot into it. 7. **Identifiers:** grep the bundle, the root image's file list, `MANIFEST` and the release notes for MAC addresses (`[0-9a-f]{2}(:[0-9a-f]{2}){5}`), serial numbers, SSIDs and account names; confirm no file from a factory image is in any artifact. -8. **Sign** the bundles and the root image; verify the signatures from a clean keyring. +8. **Sign** the bundles and the root image with the release key; verify the signatures from a clean keyring; upload them to `pkgs.omamobile.org/releases/` (§6), files before the index; promote the release's packages to `stable`. 9. **Tag** `release-` in this repository; publish the repository, the bundles and the notes (what changed, the kernel tag and its `uname -r`, known issues, how to go back to stock). -## 12. Decisions for the human - -1. **Where the kernel package is built:** cross-compiled in the x86 container and packed on the laptop (fast, matches today's builds), or natively on an aarch64 builder. -2. **Toolchain for releases:** keep the LineageOS clang, switch to the standalone AOSP clang prebuilt, or the distro's LLVM in the container. -3. **The package hook on development phones:** opt-in by `AUTO_WRITE=yes` (proposed), or on by default with `bin/omamobile push` turning it off. -4. **Signing key:** keep the one key for bundles too, or create a release key (or subkeys) before the repository is public. -5. **CI host** for aarch64 packages: GitHub's arm64 runners, another arm64 machine, or the phone as today. -6. **Root image:** device packages in the cache and installed on first boot, or one root image per device. The first build (§6) installs them, so its image is per device; revisit with the second device. -7. **Bundle hosting:** GitHub Releases on this repository, or next to the `[omamobile]` repository. -8. **Second device:** which Pixel proves the model (a gs201 sibling such as panther needs mostly a DTS; a gs101 phone also tests the different boot image set). +## 12. Decisions (2026-11-01) + +Decided by the maintainer for the first release; the reasoning is in the release decisions brief. + +1. **Kernel package build:** cross-compiled in the x86 container and packed on the build machine (the desktop that runs the daily publish), from a release tag (§4). +2. **Release toolchain:** the standalone AOSP clang prebuilt at a pinned revision, plus pinned copies of the AOSP image scripts; the container pinned by digest (§4, §9). +3. **Boot hook on development phones:** opt-in. Only `tools/install-phone` writes `AUTO_WRITE=yes`; `bin/omamobile push` stays the development path (§5.3). +4. **Signing key:** the release key (2026-10-26); every tool switches to it before the first bundle, then the original key is retired (§10). +5. **CI host for aarch64 packages:** the desktop for the first release; GitHub's arm64 runners later, for unsigned rebuild-and-compare (§9). +6. **Root image:** one per device, as built (§6). +7. **Bundle hosting:** our own server next to `[omamobile]`; the GitHub Release carries the notes and links. The bundle's signed JSON manifest carries every file's size and hash and the install checks as data, ready for a web flasher and a desktop installer. No Google firmware is ever hosted (§6). +8. **Second device:** panther, after the first release. +9. **Channels:** users on `stable`, builders and testers on `development`; the device package's `omamobile-mirrorlist` becomes the server URL (§10). +10. **Kernel updates:** the release waits until `linux-omamobile` and `omamobile-boot-update` pass checklist step 6 on the Pixel 7 Pro (install, a package-hook kernel update, a reboot into it). +11. **Kernel source:** the release kernel is a tag on the published `omamobile` branch, after the curated commits land there by fast-forward, so the source is public before any kernel binary ships (§8). +12. **Name, version and gates:** calendar version `2026.MM.DD` (§7), labelled "developer preview", Pixel 7 Pro only. Modem ships as a known issue; Suspend gates the release only if the shell's auto-sleep ships on. From d6c3b2c625b7188833ae2ae23fd68e898fc37105 Mon Sep 17 00:00:00 2001 From: Derek Ross Date: Sun, 1 Nov 2026 20:29:01 -0500 Subject: [PATCH 3/3] kernel-pr-check: a Co-Authored-By trailer warns on pull requests, fails with --strict-trailers linux-omarchy-mobile's CI runs this tool from omarchy-mobile's main, so failing every Co-Authored-By trailer would have turned open community kernel PRs red the moment this branch merged. Pull requests now get a warning that names the commits; tools/publish-kernel passes --strict-trailers, so nothing published carries one. The help range follows the longer header. Co-Authored-By: Claude Opus 5.5 Claude-Session: https://claude.ai/code/session_01BeEcdVeSfyLCbijF8XQF1d --- tests/kernel-pr-check | 7 +++++-- tools/kernel-pr-check | 20 +++++++++++++++++--- tools/publish-kernel | 4 ++-- 3 files changed, 24 insertions(+), 7 deletions(-) diff --git a/tests/kernel-pr-check b/tests/kernel-pr-check index 84085e0cf..1fd530164 100755 --- a/tests/kernel-pr-check +++ b/tests/kernel-pr-check @@ -79,8 +79,11 @@ echo "ok - --no-checkpatch skips checkpatch and still runs the rest" branch coauthor echo x >> drivers/a.c git commit -q -am "drivers: a: co-authored" -m "Signed-off-by: A Human " -m "Co-Authored-By: Claude Opus 5.5 " -run "a Co-Authored-By trailer" 1 "Co-Authored-By trailers" -echo "ok - a Co-Authored-By trailer fails (the kernel wants Assisted-by)" +run "a Co-Authored-By trailer" 0 "to change before publishing # WARN" +st_status=0 +st_out=$("$here/tools/kernel-pr-check" --strict-trailers -C "$k" omamobile HEAD 2>&1) || st_status=$? +[[ $st_status == 1 ]] && grep -c "^not ok - Co-Authored-By trailers" <<<"$st_out" >/dev/null || { echo "$st_out"; fail "--strict-trailers: a Co-Authored-By trailer fails"; } +echo "ok - a Co-Authored-By trailer warns on a pull request and fails with --strict-trailers" # CI runs `kernel-pr-check -C linux` from the directory that contains the # kernel checkout. The path has to still work after the tool cds in. diff --git a/tools/kernel-pr-check b/tools/kernel-pr-check index a02c7ee09..966ff0f90 100755 --- a/tools/kernel-pr-check +++ b/tools/kernel-pr-check @@ -39,6 +39,10 @@ # # --no-checkpatch skips checkpatch: tools/publish-kernel runs the commit and # policy checks this way, and leaves checkpatch to the full gate. +# +# A Co-Authored-By trailer is a warning on pull requests (contributors are +# asked for Assisted-by) and a failure with --strict-trailers, which +# tools/publish-kernel passes: nothing published carries one. set -uo pipefail # sort and comm must agree on the order, whatever the caller's locale. export LC_ALL=C @@ -54,18 +58,20 @@ kernel=$KERNEL_BASE/linux out="" merge=0 checkpatch=1 +strict_trailers=0 while (($#)); do case $1 in -C) kernel=${2:?-C needs a kernel tree}; shift 2 ;; --build) out=${2:?--build needs an output directory}; shift 2 ;; --merge) merge=1; shift ;; --no-checkpatch) checkpatch=0; shift ;; - -h|--help) sed -n '3,41p' "$self"; exit 0 ;; + --strict-trailers) strict_trailers=1; shift ;; + -h|--help) sed -n '3,45p' "$self"; exit 0 ;; -*) echo "kernel-pr-check: unknown option $1" >&2; exit 2 ;; *) break ;; esac done -base=${1:?Usage: kernel-pr-check [-C KERNEL] [--build OUT] [--merge] [--no-checkpatch] BASE [HEAD]} +base=${1:?Usage: kernel-pr-check [-C KERNEL] [--build OUT] [--merge] [--no-checkpatch] [--strict-trailers] BASE [HEAD]} head=${2:-HEAD} # -C may be relative to the caller's directory. This script changes into # the tree and then runs pr-check with the same path, so resolve it first. @@ -146,8 +152,16 @@ done n=$(wc -w <<<"$commits") [[ -z $sob_bad ]] && pass "$n commits signed off by their authors, none by an AI" || fail "sign-offs (Documentation/process/submitting-patches.rst, coding-assistants.rst): ${sob_bad%$'\n'}" -[[ -z $coauthor_bad ]] && pass "no Co-Authored-By trailers" || fail "Co-Authored-By trailers (credit an AI with Assisted-by, a human co-author with Co-developed-by and a sign-off; coding-assistants.rst, submitting-patches.rst): +coauthor_msg="Co-Authored-By trailers (credit an AI with Assisted-by, a human co-author with Co-developed-by and a sign-off; coding-assistants.rst, submitting-patches.rst)" +if [[ -z $coauthor_bad ]]; then + pass "no Co-Authored-By trailers" +elif ((strict_trailers)); then + fail "$coauthor_msg: +${coauthor_bad%$'\n'}" +else + pass "$coauthor_msg, to change before publishing # WARN ${coauthor_bad%$'\n'}" +fi [[ -z $prefix_bad ]] && pass "subjects have subsystem prefixes" || fail "subjects without a subsystem prefix (see git log --oneline ): ${prefix_bad%$'\n'}" diff --git a/tools/publish-kernel b/tools/publish-kernel index ed6634821..42707a09d 100755 --- a/tools/publish-kernel +++ b/tools/publish-kernel @@ -97,8 +97,8 @@ if ((n)); then merges=$(git rev-list --merges "$pub..$head") [[ -z $merges ]] || die "merge commits in $branch since the published tip; publish a linear series (rebase it): $(git log --no-walk --format=' %h %s' $merges)" - echo "# tools/kernel-pr-check --no-checkpatch on the $n commit(s) to publish" - "$repo/tools/kernel-pr-check" --no-checkpatch -C "$linux" "$pub" "$head" \ + echo "# tools/kernel-pr-check --no-checkpatch --strict-trailers on the $n commit(s) to publish" + "$repo/tools/kernel-pr-check" --no-checkpatch --strict-trailers -C "$linux" "$pub" "$head" \ || die "the commits to publish fail the checks above; nothing published" fi