Refuse hibernation setup on Apple T2 Macs by default - #9238
Open
spuder wants to merge 2 commits into
Open
Conversation
T2 Macs don't reliably survive true hibernate (S4): the T2 controller, which also owns the internal keyboard/trackpad SPI bus, often fails to come back after resuming from a hibernation image, and the machine can hang mid-hibernate requiring a hard power-off. See https://wiki.t2linux.org/state/. Add an omarchy-hw-t2 detection helper and have omarchy-hibernation-setup refuse by default on T2 hardware (--force still allows it). This also keeps the System-menu Hibernate entry hidden by default on T2 Macs, since it's gated on hibernation actually being configured. Fixes omacom#9237 Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01WiNSK85dJE9r2BkAqz45ND
The setup gate added in the previous commit only blocks new omarchy-hibernation-setup runs; it doesn't touch machines that already configured hibernation before this fix shipped, since setup short-circuits on the "already configured" check before reaching the T2 guard. Those machines keep the swapfile/resume config and the System-menu Hibernate entry. Add a migration that runs omarchy-hibernation-remove on T2 hardware, reusing its own confirm prompt and no-op-when-unconfigured behavior. Verified idempotent against a real T2 Mac with hibernation already removed (prints "Hibernation is not set up" and exits cleanly). Fixes omacom#9237 Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01WiNSK85dJE9r2BkAqz45ND
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #9237
Problem
omarchy hibernation setupwill happily configure hibernation (swapfile + resume kernel params) on Apple T2 Macs, and the System-menu Hibernate entry becomes available once it's set up. But T2 Macs don't reliably survive true hibernate (S4): the T2 controller, which also owns the internal keyboard/trackpad SPI bus, often fails to come back after resuming from a hibernation image, and the machine can hang mid-hibernate and need a hard power-off — see #9237 for a concrete case with journal evidence, and https://wiki.t2linux.org/state/ for the platform-level confirmation that hibernation isn't supported on T2.Suspend-to-RAM (S3) is unaffected and already works on T2 via the existing
t2-wifi-suspendsleep hook, so this only touches hibernation.Fix (2 commits)
1. Block new setups. Add
bin/omarchy-hw-t2, a hardware-detection helper following the existingomarchy-hw-*convention (same106b:1801/1802PCI-ID check already used by the other Apple T2 install fixes).omarchy-hibernation-setupnow refuses by default on T2 hardware, printing an explanation and a link to the t2linux wiki.--forcestill allows setting it up anyway. The check sits after the "already configured" early-return, so it's a no-op for anyone who already has hibernation configured, and after the internalomarchy-system-factory-resetcaller (which already passes--force) so re-provisioning an existing T2 setup after factory reset is unaffected.Since the System-menu Hibernate entry is gated on
omarchy-hibernation-available(which checks for actual swap+resume configuration), this keeps that entry hidden by default on T2 Macs too, not just the setup command — but only for machines that haven't configured hibernation yet.2. Clean up existing setups. Commit 1 alone doesn't help anyone who already ran
omarchy hibernation setupon a T2 Mac before this fix shipped — their swapfile/resume config stays in place and Hibernate stays in the menu. Add a migration (migrations/1788120123.sh) that runsomarchy-hibernation-removeon T2 hardware, reusing its own confirm prompt and no-op-when-unconfigured behavior, so it applies automatically on the nextomarchy update(or via the login migration notifier for anyone who updates another way).One-line caveat added to
manual/36-system-sleep.mdcovering both cases.Testing
./test/clipasses (116/116) after both commits. Manually verified on a real MacBookAir9,1 (T2):omarchy-hw-t2correctly detects the hardware.PATH=<checkout>/bin omarchy-hibernation-setup(no--force) prints the warning and exits without configuring anything.omarchy-hibernation-availableexits 1 (unavailable) and the System-menu Hibernate entry is gone.No existing test harness mocks hardware detection for
omarchy-hibernation-setupor migrations, so this doesn't add a new automated regression test for either — happy to add one if there's a preferred pattern for mockingomarchy-hw-*intest/cli.🤖 Generated with Claude Code