Skip to content

Migration engine with the quattro-upstream tester transition - #559

Merged
maralcbr merged 8 commits into
quattro-upstreamfrom
mac/42-migration-engine
Sep 25, 2026
Merged

maralcbr merged 8 commits into
quattro-upstreamfrom
mac/42-migration-engine

Conversation

@maralcbr

@maralcbr maralcbr commented Sep 25, 2026 •

Copy link
Copy Markdown
Member

Ticket 42: the migration engine and the quattro-upstream tester adapter.

  • omarchy-mac-migrate in omarchy-mac-boot runs ten journaled steps: preflight, backup, keyring, prefetch, repositories, transaction, boot-chain, loader, reboot, retire. Each step's start and end are synced to /var/lib/omarchy-mac/migration/journal, and a run picks up at the first unfinished step. Preflight refuses unsupported states (mx-mac and legacy cohorts until 43 to 45, busybox encrypt, untrusted repositories, an unfinished first boot, incoherent boot files, low battery or space, an unverifiable set) before anything changes, then freezes the plan.
  • Tester adapter: every same-name target package is named explicitly in its repository, so higher-versioned candidates are replaced too. Asahi kernel and m1n1 give way to Aurora in the same transaction. Builds from the collaboration repository move to their official counterparts.
  • Backups before any change: cached package files, /etc, /boot, the ESP and the LUKS header, with digests. Keyring bootstrap by pinned fingerprint. The whole signed set is downloaded and verified, then the transaction is rehearsed with --dbonly so only allowed packages can be removed. The repository switch puts [omarchy] first and drops [omarchy-aarch64], TrustAll and the fork keys. Boot files are rebuilt and checked before Limine takes the loader slot, and a oneshot verifies Aurora through Limine after the reboot.
  • The target is configurable. type=candidate-set uses the signed test set: it is copied, verified against a pinned fingerprint, and served to pacman only through a temporary local repository. type=repository points at an omacom channel for stable later.
  • The upstream caller is one migration, migrations/1790347292.sh, which dispatches a new optional migrate operation.

Ordering rule (also in ticket 53): the migration marks itself done the first time it runs, and with no target it does nothing. So the build that first carries it to users must also ship its target.

Tested:

  • boot/test/mac-migrate-test.sh, 27 groups. kill -9 after, during and in the middle of every step, including pacman killed after its database write and the Limine switch cut short. Plus drift from an omarchy update between rehearsal and transaction, preflight refusals leaving the system byte-identical, and GRUB and Limine testers.
  • boot/test/all: 172 ok. Dispatch, platform-migration, rekey and bin-style suites pass. shellcheck is clean.
  • A real tester rehearsal in a disposable Arch Linux ARM container on the M1 Pro: collaboration omarchy 4.0.2-2 went to the lower candidate 073e489b5b85 set, linux-asahi/m1n1 to Aurora, TrustAll was removed, and the run was resumed after a kill -9 mid-download. Boot hardware was shimmed. In the first attempt, the container's m1n1 hook rewrote the M1 Pro's m1n1/boot.bin; it was restored byte for byte before any reboot, and the harness now disables that hook.

Hardware still owed: an in-place tester run on a real Mac. The M1 Pro is mx-mac (ticket 43), and the M2 was left alone.

Second review: two independent reviews. Every verified finding is fixed: rehearse again when packages change, compare removals against the rehearsal's start, clear a stale lock only when no process holds it, resume the Limine switch from the frozen plan, enable the verify unit on every run, copy then verify the set, never arm first boot, and write the completion record before cleanup. A Fable re-review confirmed all ten fixes. It found two more gaps, both now fixed: a killed transaction's hooks could be skipped after a new rehearsal, and the transaction ran against sync databases a later sync had replaced. The post-reboot check uses the boot check's --boot-chain mode, as update-verify does.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant