Repository navigation
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
|
Reviewed at 0ed5b6c by Claude Opus 5.5. No second opinion ran: the reviewer (Codex) answered its availability check but refused this review because the day's review budget was spent, so this is one model's reading. What ran, on a disposable Omarchy worker (no T2 hardware):
One thing to correct: https://wiki.t2linux.org/state/ does not say hibernation is unsupported. As of today the page does not mention hibernation at all, and lists suspend as partially working and model-dependent. The setup message ("See … for details"), the migration's echo and the PR description all point there, so a T2 user who follows the link finds nothing about the claim. #9237, with your journal excerpt, is the evidence this change actually rests on, and pointing at it (or dropping the link) would be accurate. What a worker cannot show is the hang itself. That is down to the hardware, so For the maintainer: the migration offers to remove hibernation from every T2 Mac, including any where it works. It asks first, so a user can decline. Whether one machine's hang is enough to justify that across the platform is your call. Waiting on the author for the hardware confirmation and the link, then on the maintainer. |
|
Tested on the real MacBookAir9,1 (T2, Passed
Not yet run: (2), the migration against an active hibernation setup followed by a reboot. It needs an interactive confirm and a reboot. I'll follow up. Found while testing:
The fix would be On the link: agreed. I checked https://wiki.t2linux.org/state/ and it doesn't mention hibernation; it only says suspend issues are model-dependent. I'll point the setup message, the migration echo and the description at #9237 instead. 🤖 Generated with Claude Code |
omarchy-hibernation-remove left /etc/limine-entry-tool.d/resume.conf behind, so the kernel kept booting with resume= params pointing at a deleted swapfile, and a later setup reused the stale resume_offset because it only writes the drop-in when it is missing. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The t2linux state page does not mention hibernation; omacom#9237 holds the actual evidence for the hang. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
| echo "Remove hibernation setup on Apple T2 Macs: it can hang the machine mid-hibernate and needs a hard power-off (https://github.com/omacom/omarchy/issues/9237)" | ||
|
|
||
| if omarchy-hw-t2; then | ||
| omarchy-hibernation-remove |
There was a problem hiding this comment.
Declined removal is marked complete
On a T2 Mac with hibernation already configured, declining the confirmation makes omarchy-hibernation-remove exit successfully without removing anything. The migration runner then marks this migration complete, so later updates will not retry it and Hibernate remains available. This call also prompts during omarchy update -y, even though that mode promises not to ask questions. The migration needs to distinguish a completed removal from a declined one and handle unattended updates without prompting.
Knowledge Base Used: Migration framework
|
|
||
| # omarchy:summary=Detect whether the computer has an Apple T2 security chip. | ||
|
|
||
| lspci -nn | grep -q "106b:180[12]" |
There was a problem hiding this comment.
T2 paths lack regression tests
The existing T2 test mocks PCI output, but it does not exercise this new detector, the setup refusal or force override, or the new removal migration. A missed hardware match or a change to those paths could restore the hibernation hazard without failing the CLI tests. Please add coverage for T2 and non-T2 PCI output and the relevant hibernation states.
Note: If this suggestion doesn't match your team's coding style, reply to this and let me know. I'll remember it for next time!
|
Follow-up: test (2) passes on the MacBookAir9,1 (T2) at head New commits since
(2) Migration against an active hibernation setup
I never actually hibernated during this test, to avoid the #9237 hang. Note: limine-snapper-sync snapshot entries still carry the old 🤖 Generated with Claude Code |
|
Re-reviewed at What ran, on a disposable Omarchy worker that had hibernation set up for real:
Your MacBookAir9,1 results cover what a worker cannot, and they are why this review trusts the hang. One limit on them: the The On greptile's two points, which Codex and I both checked against
For the maintainer: choose which Waiting on the maintainer. |
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.Suspend-to-RAM (S3) is unaffected and already works on T2 via the existing
t2-wifi-suspendsleep hook, so this only touches hibernation.Fix
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 #9237.--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).3. Fully remove resume kernel parameters.
omarchy-hibernation-removeleft/etc/limine-entry-tool.d/resume.confbehind, so the kernel kept booting withresume=params pointing at a deleted swapfile, and a later setup reused the staleresume_offset(setup only writes the drop-in when it is missing). Remove now deletes it too, which the migration relies on.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