Skip to content

Detect architecture so x86 stays upstream and aarch64 stays Mac - #331

Open
malik-na wants to merge 13 commits into
quattrofrom
feat/arch-detection
Open

Detect architecture so x86 stays upstream and aarch64 stays Mac#331
malik-na wants to merge 13 commits into
quattrofrom
feat/arch-detection

Conversation

@malik-na

@malik-na malik-na commented Sep 3, 2026

Copy link
Copy Markdown
Member

Split Omarchy Mac from upstream Omarchy by architecture so this tree can rebase and, later, PR upstream without fighting overwritten shared files.

x86_64 uses upstream pacman configs, package-add behavior, and the ISO install path. aarch64 uses the existing Apple Silicon installer, ARM repos, and skip-unavailable package filter. Apple Silicon is a separate hardware check (omarchy-hw-apple-silicon) so non-Apple ARM does not get Asahi audio or the notch bar.

  • omarchy-hw-arch / omarchy-hw-aarch64 / omarchy-hw-apple-silicon
  • Pacman defaults: default/pacman/ (upstream) vs default/pacman/aarch64/
  • install.sh dispatches aarch64 to install/aarch64/install.sh
  • Live uname / device-tree checks in install and runtime go through the detectors. omarchy-mac-setup and historical migrations are unchanged.

Not for upstream basecamp/omarchy yet.

omarchy-hw-arch prints aarch64 or x86_64. omarchy-hw-aarch64 is the
codebase split. omarchy-hw-apple-silicon is aarch64 plus Apple in the
device tree, so non-Apple ARM does not take the Asahi path.
x86 keeps Architecture = auto and the upstream [omarchy] repo.
ARM configs move to default/pacman/aarch64/. Refresh and install
select the tree with omarchy-hw-aarch64.
x86 keeps upstream behavior: a missing package fails the transaction.
Arch Linux ARM lacks some packages upstream migrations name, so those
skip with a warning instead of failing the install.
The Mac installer moves to install/aarch64/install.sh. Root install.sh
runs it on aarch64 and points x86 at the Omarchy ISO when this tree
has no ISO pipeline.
Replace live uname and device-tree checks with omarchy-hw-aarch64 or
omarchy-hw-apple-silicon. Historical migrations and omarchy-mac-setup
keep their original bootstrap checks.
The rc file pointed at the edge repo, and all three channel configs
had extra SigLevel lines. Copy the upstream blobs so an x86 refresh
stays on the matching Omarchy channel.
Restore omarchy-pkg-add's upstream root pacman path. Write hid_apple
fnmode only on Apple Silicon or a loaded module, not because the
kernel merely ships hid_apple. ESP and btrfs migrate tools require
Apple Silicon, not any aarch64 board.
Assert the aarch64 installer resolves checkout to the repo root, x86
pacman channels keep their upstream URLs, and fnmode does not apply
on generic x86 via modinfo.

@scottjones scottjones left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for this, Malik. The split itself is sound: the pacman configs come back byte-identical to origin/quattro, the installer move is clean, the detectors are stubbable, and everything you touched passes. Four things need to change before it lands, plus some smaller notes inline.

1. The negated detector calls fail open. Six sites use ! omarchy-hw-aarch64, so a missing command (exit 127) reads as "x86". In fix-brcmfmac-supplicant.sh that means an Apple Silicon machine gets the Intel-Mac feature_disable quirk, which kills Wi-Fi on the M1 family. The old uname test failed closed. Please make the aarch64 check the positive branch, or have the detectors exit non-zero for "unknown" explicitly.

2. Two existing tests break locally. test/shell.d/brcmfmac-supplicant-test.sh (lines 94, 151, 216) and test/shell.d/preinstalls-test.sh (line 44) set PATH without $ROOT/bin, so ./test/shell on a checkout reports:

leaf.sh: line 33: omarchy-hw-aarch64: command not found
not ok - an Apple Silicon Mac is left alone
omarchy-remove-preinstalls: line 35: omarchy-hw-aarch64: command not found
not ok - ARM preinstalls restore the installable Obsidian substitute

CI is green only because main.yml exports PATH="$GITHUB_WORKSPACE/bin:$PATH". The tests you did update use PATH="$stub_bin:$ROOT/bin:$PATH"; these two need the same.

3. The x86 branch of install.sh is dead code. It sources install/packaging/all.sh, which exists in neither this tree nor upstream, and upstream has no install.sh at all (the ISO drives the install). That branch should just be the "install from the ISO" message, and the sentence in docs/file-layout.md describing it should go.

4. fnmode still leaks onto x86. With hid_apple loaded, fix-fkeys.sh writes fnmode=1. Upstream writes fnmode=2 for exactly that case (Lofree, external Apple keyboards, T2). Under "x86 stays upstream" the x86 branch should write fnmode=2, and fix-fkeys-test.sh currently pins the fork behavior.


On the bigger picture, since the description mentions rebasing and PRing upstream: I ran the numbers on this branch against origin/quattro in bin/, install/, default/, config/, shell/, migrations/.

Count
Upstream-owned files this fork edits (after this PR) 91
Of those, with no arch or Apple gate at all 59
Fork-only files in those directories 95 (44 are migrations)

The 59 ungated edits change behaviour for every user, not just Macs: media.lua replaces upstream's max/min brightness binds and adds F-key screenshot binds, input.lua flips natural scrolling and tap-to-click, git.sh adds aliases, network.sh rewrites iwd to wpa_supplicant on every install, plus snapper, sddm state, chromium flags, clock panel geometry, shebangs on ~20 install scripts, and the whole default/zsh/ tree. Upstream already accepts gated Apple work (install/hardware/apple/, omarchy-brightness-display-apple, and the ARM mirror scripts are all in origin/quattro), so the realistic path is many small gated PRs plus a decision to gate or drop the fork opinions above. A tree rebase will not get us there, and this PR, good as it is, does not change that. Happy to help carve that list up once this lands.

Comment thread install/hardware/apple/fix-brcmfmac-supplicant.sh Outdated
Comment thread bin/omarchy-remove-preinstalls
Comment thread install.sh Outdated
Comment thread install/hardware/fix-fkeys.sh Outdated
Comment thread docs/file-layout.md Outdated
Comment thread bin/omarchy-hw-laptop Outdated
Comment thread shell/plugins/bar/Bar.qml Outdated
Comment thread bin/omarchy-refresh-pacman-mirrorlist Outdated
@scottjones

Copy link
Copy Markdown

Re-checked the current head (feat/arch-detection, newest commit "Cover installer checkout, channel URLs, and fnmode leaks") — it's unchanged since my review, so all four items still stand. Re-verified each rather than assuming:

  1. Negated detectors — still six sites: omarchy-install-1password:14, omarchy-install-docker-dbs:8, omarchy-upgrade-to-quattro:121, fix-brcmfmac-supplicant.sh:33, optional-apps.sh:5, arm-mirrors.sh:6.
  2. Testsbrcmfmac-supplicant-test.sh 94/151/216 still PATH="$stub_bin:$PATH", preinstalls-test.sh:44 still PATH="$mock_bin:$PATH".
  3. install.sh x86 branch — still sources install/packaging/all.sh at line 24. Confirmed it exists in neither this tree nor basecamp/omarchy, and upstream has no install.sh at all.
  4. fnmodefix-fkeys.sh:14 still writes fnmode=1; upstream writes fnmode=2. fix-fkeys-test.sh 51–53 pins the fork value.

One correction to my item 3, so you don't go hunting for a bug that isn't there: the branch is guarded by [[ -f $checkout/install/packaging/all.sh ]] on line 16, so it doesn't fail at runtime — it's unreachable and always falls through to the ISO message on line 31. Safe, just dead. That makes it a straight deletion rather than a fix.

Also useful for sequencing, since this branch is up to date with quattro and merges clean: of the 26 other open PRs, only 8 touch any file this one does, and the real contention is a single file — bin/omarchy-upgrade-to-quattro-mac, which #319, #321, #322 and #262 all touch alongside this. Everything else is one-file overlap (#343 vulkan.sh, #305 omarchy-capture-screenrecording, #294 omarchy-install-1password, #291 omarchy-upgrade-to-quattro, #319 docs/file-layout.md). So this doesn't need to block the queue — it just wants to be ordered against that one file.

No rush from my side; flagging only so it doesn't look like it's waiting on me.

@malik-na

malik-na commented Sep 6, 2026

Copy link
Copy Markdown
Member Author

@scottjones Addressed the four blockers and inline notes: safe architecture checks, test PATHs, dead installer code/docs, x86 fnmode=2 (Apple Silicon stays 1), helper paths, and mirrorlist channels. Added failure-path tests; focused suites and native Mac checks pass. Could you take another look?

@malik-na
malik-na requested a review from scottjones September 6, 2026 05:08
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.

2 participants