Skip to content

Fix Thunderbolt suspend on the MacBookPro14,1 - #10758

Open
orospakr wants to merge 4 commits into
omacom:quattrofrom
orospakr:macbookpro14-1-thunderbolt-suspend
Open

orospakr wants to merge 4 commits into
omacom:quattrofrom
orospakr:macbookpro14-1-thunderbolt-suspend

Conversation

@orospakr

@orospakr orospakr commented Sep 8, 2026 •

Copy link
Copy Markdown

Enables working lid-close suspend on the 2017 13″ MacBook Pro (MacBookPro14,1), non-Touchbar so no T1. Companion to the tb-ar-shim-dkms package PR in omarchy-pkgs; full investigation in #10593.

The problem: every suspend breaks Thunderbolt on this machine — two Linux PCI bugs (garbage config-space restore after S3; skipped restore on s2idle), plus an Apple EFI behavior where entering S3 with anything in a Thunderbolt port makes the firmware disable the Thunderbolt root port until the next cold boot. The EFI part is unfixable from the OS, which is why the machine must default to s2idle (s2idle never executes the EFI S3 resume script).

What this adds:

  • bin/omarchy-hw-macbookpro14-1 — detector: exact DMI product match + lspci check for the Alpine Ridge bridge (8086:1578). Gates on 14,1 alone because that's the validated machine; 14,2/14,3 share the controller and can be added once tested.
  • install/hardware/apple/fix-thunderbolt-suspend.sh (+ all.sh entry) — installs linux-headers + tb-ar-shim-dkms, loads the module immediately (the modalias coldplug has already passed on a live system), and writes a limine cmdline drop-in with mem_sleep_default=s2idle (the fix-t2.sh mechanism).
  • migrations/1788811585.sh — same for already-installed machines, with the limine-mkinitcpio rebuild guard so the cmdline reaches the boot entries.

Validation: this exact flow ran end-to-end on a MacBookPro14,1 — package install, dkms build, detector match, drop-in + UKI rebuild, then a cold boot: module autoloaded by modalias, mem_sleep came up [s2idle], and suspend cycles are clean at ~1.3 s resume (vs 75–107 s with dead Thunderbolt before). test/shell passes (the two failures on this machine, locate/snapper, pre-exist on master).

Depends on the omarchy-pkgs PR publishing tb-ar-shim-dkms — draft until that lands.

🤖 Generated with Claude Code

https://claude.ai/code/session_014SjBV8RAyo6et6LMmurU9W

Fixes #10593

The 2017 13" MacBook Pro breaks Thunderbolt on every lid-close suspend:
two Linux PCI suspend bugs plus an EFI behavior that disables the
Thunderbolt root port when S3 is entered with a device attached (cold
boot to recover). Install the tb-ar-shim-dkms carry for the kernel-side
bugs and default the machine to s2idle via a limine cmdline drop-in so
the EFI path can never fire, with a migration for installed systems.

Validated end-to-end on a MacBookPro14,1: module autoloads by PCI
modalias, mem_sleep comes up s2idle, suspend cycles clean at 1.3 s.

Investigation: omacom#10593

Co-Authored-By: Claude Fable 5 <[email protected]>
Claude-Session: https://claude.ai/code/session_014SjBV8RAyo6et6LMmurU9W
@orospakr
orospakr force-pushed the macbookpro14-1-thunderbolt-suspend branch from ece8c0c to 3149440 Compare September 9, 2026 02:35
@orospakr
orospakr marked this pull request as ready for review September 9, 2026 02:35
orospakr added a commit to orospakr/omarchy-pkgs that referenced this pull request Sep 12, 2026
Temporary [FOR-UPSTREAM] DKMS carry of the tb_ar_shim module, which fixes
suspend/resume of the Alpine Ridge Thunderbolt 3 controller on the Apple
MacBookPro14,1 (omacom/omarchy#10593). Same shape as qmk-hid/tzupdate: a
"source": "local" PKGBUILD fetching the tag tarball from the module's own
repo, https://github.com/orospakr/linux-apple-alpine-ridge-suspend, with a
git_tags upstream provider so sync-upstream opens version bumps. The
module source, README, the drivers/pci/quirks.c patch headed to linux-pci,
and the CI that builds the module against Arch linux/linux-lts headers all
live in that repo; omarchy-pkgs carries only the PKGBUILD and metadata.

Validated on MacBookPro14,1: 28/28 suspend cycles across both sleep modes,
1.3-1.4 s resumes; the module installed via pacman, dkms-built, cold-boot
autoload verified. The companion detector/install script/migration is
omacom/omarchy#10758.

Co-Authored-By: Claude Fable 5.1 <[email protected]>
Claude-Session: https://claude.ai/code/session_014SjBV8RAyo6et6LMmurU9W
orospakr added a commit to orospakr/omarchy-pkgs that referenced this pull request Sep 12, 2026
Temporary [FOR-UPSTREAM] DKMS carry of the tb_ar_shim module, which fixes
suspend/resume of the Alpine Ridge Thunderbolt 3 controller on the Apple
MacBookPro14,1 (omacom/omarchy#10593). Same shape as qmk-hid/tzupdate: a
"source": "local" PKGBUILD fetching the tag tarball from the module's own
repo, https://github.com/orospakr/linux-apple-alpine-ridge-suspend, with a
git_tags upstream provider so sync-upstream opens version bumps. The
module source, README, the drivers/pci/quirks.c patch headed to linux-pci,
and the CI that builds the module against Arch linux/linux-lts headers all
live in that repo; omarchy-pkgs carries only the PKGBUILD and metadata.

Validated on MacBookPro14,1: 28/28 suspend cycles across both sleep modes,
1.3-1.4 s resumes; the module installed via pacman, dkms-built, cold-boot
autoload verified. The companion detector/install script/migration is
omacom/omarchy#10758.

Co-Authored-By: Claude Fable 5.1 <[email protected]>
Claude-Session: https://claude.ai/code/session_014SjBV8RAyo6et6LMmurU9W
@omarchybot omarchybot added bug Something isn't working compatibility Make Omarchy work better on everything! labels Sep 27, 2026
@omarchybot

Copy link
Copy Markdown
Collaborator

Reviewed at 3149440 by Claude Opus 5.5, with Codex Medium as a second opinion. Both read this diff against quattro, along with omacom/omarchy-pkgs#349 and the other open pull requests for the same Alpine Ridge suspend bug, #11570 and #9899. Codex was asked which of them to bring forward before it saw my answer. Its findings below were checked against quattro before being included, and where it agrees with my reading, that agreement may not be independent. Nothing was run: the bug only shows on a MacBookPro14,1, which a VM cannot provide.

Competing fixes. #11570 targets the same failure on the same machines with systemd-sleep hooks that remove the Thunderbolt upstream ports before S3 and rescan after, keeps deep sleep, needs no out-of-tree module, and has been run on a 14,1 by someone other than its author. This pull request is the deeper fix for the 14,1: it corrects the config-space save and restore, and its s2idle default avoids the EFI behaviour with a device attached at S3 entry that you documented in #10593. That hazard has not been tested by anyone else, and s2idle costs battery in the bag compared with S3. The two should not land unchanged together: #11570's gate includes the 14,1, its hook also runs under s2idle, and removing the upstream bridge would leave tb_ar_shim attached to a device that no longer exists, as you noted on #11570. Which sleep policy the 14,1 gets is the maintainer's decision, so this pull request is not being brought forward on its own. Codex reached the same conclusion: either this one or a corrected #11570, chosen by the maintainer.

Findings in this diff:

  • install/hardware/apple/fix-thunderbolt-suspend.sh:27 and migrations/1788921301.sh:10: tb-ar-shim-dkms is not in any Omarchy repository until Add tb-ar-shim-dkms: Alpine Ridge suspend fix for the MacBookPro14,1 omarchy-pkgs#349 is merged and published. On quattro, omarchy-pkg-add exits 1 when pacman cannot install a package, and bin/omarchy-migrate runs under set -euo pipefail. Merged as it stands, a fresh install on a 14,1 would stop at this step, and on an existing 14,1 the migration would fail and hold back every migration after it. The description says this stays a draft until the package lands, but the pull request is not marked as a draft.
  • The same two lines install linux-headers, the headers for Arch's stock linux kernel. Omarchy installs linux-omarchy with linux-omarchy-headers, and migrations/1789444024.sh keeps those headers present, so DKMS builds against the running kernel without this. The other DKMS fixes in install/hardware/ (fix-spi-keyboard.sh, fix-bcm43xx.sh) add only the driver package. Dropping linux-headers avoids installing a second header tree for a kernel that is not there.
  • install/hardware/apple/fix-thunderbolt-suspend.sh:32 and migrations/1788921301.sh:15: modprobe tb_ar_shim || true hides a failed load, and the script then switches the machine to s2idle, which by your own diagnosis also needs the shim. A failed load in the migration should at least be reported.
  • The description names the migration 1788811585.sh; the file is migrations/1788921301.sh. The file name works; only the description is out of date.

Nothing in the detector or scripts runs on other hardware: both gate on the exact DMI model and the 8086:1578 bridge. The limine drop-in follows fix-t2.sh, re-running is idempotent, and the migration's rebuild guard is right.

What happens next. This waits on the maintainer to choose the 14,1's sleep policy between this and #11570, and on omacom/omarchy-pkgs#349 being published before it can merge. If this approach is chosen, it cannot be marked verified until someone other than its author confirms it on a 14,1 at the final head.

@angellindo

Copy link
Copy Markdown

@orospakr a data point that may matter for defaulting the 14,1 to s2idle (a heads-up, not an objection).

On a MacBookPro14,3 (i7-7820HQ, Sunrise Point-H) the package never goes deeper than PC3 under Linux, awake or in s2idle, including on a stock unpatched Arch kernel. macOS on the same hardware reaches package C7/C10.

Awake, idle: turbostat --quiet --Summary --show Pkg%pc3,Pkg%pc6,Pkg%pc8,Pk%pc10,PkgWatt -i 10 -n 6
  Linux (Arch 7.2.2, no patches): Pkg%pc3 ~99  Pkg%pc6..pc10 0.00  PkgWatt 3.53
  macOS (powermetrics):           pkg C7 87-96 % or C10 ~81 %, 0.17-0.49 W
Asleep, battery drain over hours: s2idle 7-13 W  vs  S3 0.22-0.29 W

I have not tested a 14,1, and it has a different PCH (Sunrise Point-LP), so this may not apply. To check on the 14,1 before making s2idle the default:

cat /sys/kernel/debug/pmc_core/package_cstate_show      # before
systemctl suspend                                        # ~10 min
cat /sys/kernel/debug/pmc_core/package_cstate_show      # after: did C8/C10 grow?
cat /sys/kernel/debug/pmc_core/slp_s0_residency_usec  # grew = reached S0ix

Or compare battery charge before/after an hour in s2idle. If the 14,1 reaches PC8+ in s2idle, ignore this.

bjhinkle added a commit to bjhinkle/omarchy that referenced this pull request Oct 8, 2026
Review fixes from the pull request:

- pre stops any thunderbolt-remove-rescan-retry-* unit still running from
  the previous resume. Nothing stopped it before, so a sleep starting
  within about 15 s of a resume could have a retry rescan bring back the
  tree pre had just removed, and that tree would then go into S3 live.
- The hook acts only when /sys/power/mem_sleep selects deep, which
  systemd-sleep writes before it runs the hooks, and post acts only if pre
  did. In s2idle the platform firmware does not cut the controllers' power,
  so removing the tree there only dropped attached USB-C devices on every
  sleep. This also keeps the hook out of the way on a MacBookPro14,1 that
  defaults to s2idle (omacom#10758). suspend-then-hibernate is still not covered.
- The mounted-device guard also reads /proc/swaps, so a side carrying
  active swap is not removed.
- The migration installs the hooks unconditionally, so a copy the user
  carries is also reset to root:root 0755.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@omarchybot

Copy link
Copy Markdown
Collaborator

An update to the earlier review, at the same head (3149440), because #11570 has changed since. Re-read by Claude Opus 5.5 against #11570 at 936d96b, with Codex Medium as a second opinion. Nothing was run: this needs a MacBookPro14,1.

The two no longer conflict by default. The earlier review said this pull request and #11570 should not land unchanged together, because #11570's hook also ran under s2idle and would remove the upstream bridge that tb_ar_shim attaches to. #11570's hook now acts only when systemd-sleep is about to write mem and /sys/power/mem_sleep selects [deep], and it ignores hibernate. With this pull request's mem_sleep_default=s2idle on a 14,1, its pre logs "not S3" and exits before removing anything, and its post does nothing. So the maintainer could land both: #11570 for the models that keep deep, and this one for the 14,1. Codex agreed, and added two cases where both still act on a 14,1: a user who selects deep (with MemorySleepMode=deep, a write to /sys/power/mem_sleep, or a different cmdline), and a #11570 retry rescan left over from an earlier deep sleep, which an s2idle pre does not stop. Both need the user to have left this pull request's default, and whether the shim survives its upstream port being removed is not something either diff shows.

Unchanged. The findings in the earlier review still apply at this head: tb-ar-shim-dkms is not published until omacom/omarchy-pkgs#349 lands, and until then the install step and the migration fail on a 14,1; linux-headers is not needed beside linux-omarchy-headers; and modprobe tb_ar_shim || true hides a failed load. @angellindo's measurements above, that s2idle on a 14,3 never gets past package C3 and draws 25 to 60 times what S3 does, are from a different chipset, so they say nothing yet about the 14,1, but they are what the battery check they describe would settle before s2idle becomes its default.

What happens next. This waits on the maintainer to choose the 14,1's sleep policy, and on omacom/omarchy-pkgs#349. It cannot be marked verified until someone other than its author confirms it on a 14,1 at the final head.

@jandrusk

Copy link
Copy Markdown

Targets #10593 (MacBookPro14,1 Thunderbolt/suspend). Overlaps later open work: #14409 (lid-close suspend on same model), #11570 (2016–2017 MacBook Pros USB-C/TB across S3), #14692 (14,3 s2idle). Worth aligning on one MacBookPro14,1 suspend approach before more hardware install scripts land.

@omarchybot

Copy link
Copy Markdown
Collaborator

A follow-up at the same head (3149440), on the overlap @jandrusk raised. Read by Claude Opus 5.5 against #14409 at 98a8df5, #14692 at dff49a6 and #11570 at 936d96b, with Codex Medium as a second opinion; Codex reached the same conclusions, and that agreement may not be independent. ./test/cli passed on a disposable Omarchy worker at this head. The fix itself was not run: it needs a MacBookPro14,1.

Neither is a competing fix for this one. #14409 fixes a different bug on the same machine: the Apple S3X NVMe (106b:2003) not resuming at all. Its own description reports the Thunderbolt stall this pull request fixes as a separate bug it still saw. #14692 is gated to the MacBookPro14,3 and its Radeon resume failure, and installs nothing for the 14,1.

If this and #14409 both land on a 14,1, neither breaks the other. They write separate Limine drop-ins (macbookpro14-1-thunderbolt.conf and apple-s3x-suspend.conf), so the command line carries mem_sleep_default=s2idle twice, which is harmless, plus #14409's nvme_core.default_ps_max_latency_us=0 intel_idle.max_cstate=1. Both migrations may rebuild the boot image on the same update, which is redundant work rather than a conflict. #14409 does not touch the Thunderbolt bridge or tb_ar_shim. The one interaction is the one already reported: until omacom/omarchy-pkgs#349 is published, this pull request's migration fails, and 1788921301.sh runs before #14409's 1791387391.sh, so it would hold #14409's migration back too.

On the sleep policy. #14409 is a second 14,1 report in which deep did not resume, which bears on the choice between this pull request's s2idle default and #11570, which keeps deep. It does not settle it: only sleeps of a minute or two were tested, the three parameters were not tested apart, and intel_idle.max_cstate=1 keeps the CPU out of its deeper idle states, so s2idle with #14409 applied would need its own battery measurement, on top of the one @angellindo described for the 14,3.

Unchanged from the earlier reviews: the unpublished tb-ar-shim-dkms, the unneeded linux-headers, and modprobe tb_ar_shim || true hiding a failed load. No new defects were found in this diff.

What happens next. This waits on the maintainer to choose the 14,1's sleep policy across this pull request, #11570 and #14409, and on omacom/omarchy-pkgs#349. It cannot be marked verified until someone other than its author confirms it on a 14,1 at the final head.

@tcholewa

tcholewa commented Nov 8, 2026

Copy link
Copy Markdown

Independent MacBookPro14,1 validation of the proposed shim, including the first suspend after a cold power-on.

Tested November 8, 2026 on a 2017 13-inch, two-Thunderbolt-3-port MacBookPro14,1, Omarchy 4.5.0-3, systemd 262.1, linux-omarchy 7.2.15-1. The same USB-C hub and Realtek RTL8153 Gigabit Ethernet adapter remained attached.

I built the unmodified tb-ar-shim-dkms 1.0.0-1 recipe from omacom/omarchy-pkgs#349 at f6aa10a69ab7b06ccf92b87f6b99200ebcfb68ae. The v1.0.0 source archive passed the recipe's SHA-256 check. DKMS built it for both installed kernels; runtime testing covered 7.2.15-1-omarchy only.

For the module tests I retained s2idle, loaded both tb_ar_shim and the normal thunderbolt driver, and replaced my earlier PCI-removal/driver-unload hook with camera/display handling only. No bridge rescan ran during the module tests. The final configuration had no Thunderbolt blacklist or D3cold override.

Configuration Device-resume time Ethernet USB connection after wake
Earlier local hook + s2idle + Thunderbolt D3cold guard 0.5393 s 5000M
Shim + thunderbolt + s2idle, guard retained for initial comparison 0.5456 s 5000M
Shim + thunderbolt + s2idle, D3cold allowed 0.5369 s 5000M
Same module setup, first suspend after complete shutdown and power-on 0.5322 s 5000M

The three module cycles used automatic RTC wake. Both modules autoloaded after the cold power-on, and the first test in that boot started with zero completed suspends. All Thunderbolt-subtree d3cold_allowed attributes were 1 for the clean final test.

An isolated kernel trace measured from machine_suspend end to thaw_processes end, excluding time asleep, unlock, and link/DHCP reconnection. Each module cycle logged configuration saved for seven devices and no spent restore budget or old inaccessible-controller/resume-timeout messages. In the first post-boot cycle, the shim's own resume_noirq message reported 1505 us; that is a different, narrower measurement than the 0.5322 s device-resume result. The USB controller and hub were not removed/disconnected by the sleep hook. Screen wake was quick.

After the first post-boot resume, a bounded omarchy network speedtest down run over the verified Ethernet default route reported roughly 925–934 Mbps, peaking at 934 Mbps.

For context, before these repairs deep sleep with the hub attached left the Alpine Ridge USB controller absent and RP05 inaccessible in D3cold. Ethernet fell back to 480M USB despite a 1 Gbps cable link, measuring 34.3 MB/s (~275 Mbps). Cold power-on restored USB 3. My intermediate hook/D3cold workaround fixed that locally, but the shim now matches its wake timing without the Thunderbolt blacklist, controller-removal hook, or power override.

Limits: one machine, three module suspend cycles, one first-suspend-after-cold-boot check. This is separate from the author's 28-cycle evidence. No Thunderbolt dock/eGPU/tunneled-PCIe peripheral was available; the kernel logged device links to tunneled native ports are missing! at normal Thunderbolt-driver initialization. Overnight battery use, extended sleep, hibernation, other models, and runtime behavior on the second kernel were not tested. These results do not establish that deep/S3 is safe.

I'm withdrawing my older hook-based proposal #9899 in favor of this module approach. This is hardware validation of the proposed module, not a claim that the current installer/migration in this PR was run unchanged: my s2idle policy is a systemd MemorySleepMode=s2idle drop-in, and module loading was explicitly configured for the comparison.

The installer runs hardware setup against the live ISO's offline pacman.conf, so every package a hardware leaf adds must be in install/omarchy-other.packages. tb-ar-shim-dkms was not, and since quattro moved to linux-omarchy neither is linux-headers, so omarchy-pkg-add failed on every MacBookPro14,1 and stopped the install.

The installer pacstraps linux-omarchy-headers, which DKMS builds against, as it already does for macbook12-spi-driver-dkms, so the leaf no longer asks for the stock kernel's headers. The migration keeps linux-headers: it runs online and before 1789325478, which leaves an upgraded machine's stock kernel installed as a fallback.

The test checks that whatever the leaf adds stays available offline.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Co-Authored-By: Codex Medium <[email protected]>
AGENTS.md keeps a single model's quirk behind omarchy-hw-match on its DMI name rather than a new public omarchy-hw-* command, so the model check moves inline with the existing Alpine Ridge PCI ID check and bin/omarchy-hw-macbookpro14-1 goes away.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@omarchybot

Copy link
Copy Markdown
Collaborator

Reviewed again after @tcholewa's MacBookPro14,1 test, by Claude Opus 5.5 with Codex Medium and muse-wonder (thinking high) as second opinions. I pushed two small fixes to this branch, so the head is now 818b712. The fix itself was not run: it needs a MacBookPro14,1. ./test/cli and the new test passed on a disposable Omarchy worker, both at this head and merged into quattro.

What I pushed

  • The ISO install of a 14,1 would have stopped at this script. The installer runs hardware setup against the ISO's offline mirror, which only carries what install/omarchy-other.packages lists. tb-ar-shim-dkms was not in that list, and since quattro moved to linux-omarchy, linux-headers is not either. omarchy-pkg-add would fail and the install would stop. 42df0f3 lists the shim. It also has the installer leaf rely on linux-omarchy-headers, which the ISO already installs and which DKMS builds against, as it does for macbook12-spi-driver-dkms. It adds test/shell.d/macbookpro14-1-thunderbolt-test.sh, which fails on your original commit merged into quattro and passes now. The migration still installs linux-headers: both reviewers pointed out that it runs before quattro's kernel migration, which keeps an upgraded machine's stock kernel as a fallback.
  • The gate follows the house rule. quattro's AGENTS.md keeps a single model's quirk behind omarchy-hw-match on its DMI name. So 818b712 checks omarchy-hw-match "MacBookPro14,1" next to your 8086:1578 check and drops bin/omarchy-hw-macbookpro14-1. On the worker, with the model faked and lspci stubbed, the 14,1 ran both package steps, and the 14,3 and a non-Mac did nothing.

@tcholewa's test is the first evidence from someone other than the author that the shim works on a 14,1. They used the unmodified omacom/omarchy-pkgs#349 recipe, ran three s2idle cycles plus a first suspend after a cold power-on, and kept the hub and Ethernet at full speed. By their own account it did not run this pull request's installer or migration, so it supports the shim rather than confirming this head. They have also closed #9899 in favour of this approach.

Competing fixes, as they now stand. This is the oldest open fix for the 14,1's Thunderbolt resume failure. Both reviewers would keep it as the 14,1's approach over the newer #11570 and #15756, which keep deep sleep and leave the attached-device case open. #12211 fixes a different bug, PME wakeups pulling the machine out of S3, and is not a competitor. If both landed on a 14,1, #15756 would conflict with this one: its hook removes the Thunderbolt tree on every sleep, s2idle included, which defeats what the shim preserves. #11570 stands down outside deep and would not conflict.

Still open

  • Add tb-ar-shim-dkms: Alpine Ridge suspend fix for the MacBookPro14,1 omarchy-pkgs#349 is unpublished. Until it is, the package step fails, and the migration holds back every migration after it.
  • sudo modprobe tb_ar_shim || true still lets the migration finish with s2idle set and no shim loaded. On the worker it printed Module tb_ar_shim not found and the migration exited 0.
  • A question for @orospakr that only the machine can answer. After an S3 sleep that leaves Thunderbolt dead, and before a cold boot, does lspci -n still list 8086:1578? If not, an update run in that state passes the gate as a no-op. The migration is then marked done, and the fix never applies after the cold boot. Codex and muse-wonder both raised this, and neither could settle it without the hardware.

What happens next. This waits on the maintainer: to choose the 14,1's sleep policy across this, #11570 and #14409, and on omacom/omarchy-pkgs#349. It cannot be marked verified until it is confirmed on a 14,1 at 818b712 by the issue's reporter or a maintainer. The reporter is also this pull request's author, so in practice that means a maintainer.

@greptile-apps

greptile-apps Bot commented Nov 16, 2026 •

Copy link
Copy Markdown
Contributor

RetriggerView in GreptileConfidence Score: 5/5

[Medium impact] The PR appears safe to merge; the previous migration issue is fixed and no new actionable issues were found.

Summary

Adds Thunderbolt suspend support for MacBookPro14,1 by installing tb-ar-shim-dkms and selecting s2idle.

  • MacBookPro14,1 laptops use a shim and s2idle for Thunderbolt suspend.

Reviews (2) · Last reviewed commit: "Keep the MacBookPro14,1 migration's PCI ..." · Reviewed by Greptile

Comment thread migrations/1788921301.sh Resolved
omarchy-migrate runs every migration under bash -euo pipefail. With grep -q, grep exits at the first match, lspci can die of SIGPIPE while still writing, and pipefail turns that into a failed check: the migration skips the fix on the very machine it targets and is still marked applied, the failure 1786137597 had to repair for the T2 check. Reading all of lspci's output with grep >/dev/null avoids it. The installer runs its hardware leaves without pipefail, so its copy of the check is unaffected.

The test runs the migration under the runner's flags against an lspci stub that keeps writing past the pipe buffer after the match.

Flagged by Greptile's review of 818b712.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@omarchybot

Copy link
Copy Markdown
Collaborator

Reviewed again after Greptile's review of 818b712, by Claude Opus 5.5, with Codex Medium and muse-wonder (thinking high) as second opinions. Greptile's one finding was real, so I pushed a fix and the head is now 2219504.

What I pushed. omarchy-migrate runs every migration under bash -euo pipefail. In migrations/1788921301.sh, lspci -n | grep -q "8086:1578" lets grep quit at the first match while lspci is still writing. If lspci then dies of SIGPIPE, pipefail fails the check: the migration skips the fix on the very 14,1 it targets, exits 0, and is marked applied, so it never retries. migrations/1786137597.sh exists to repair the same failure in the T2 check. 2219504 reads all of lspci's output with grep "8086:1578" >/dev/null instead. The installer's copy in install/hardware/apple/fix-thunderbolt-suspend.sh keeps grep -q, since run_logged runs hardware leaves without pipefail. test/shell.d/macbookpro14-1-thunderbolt-test.sh now also runs the migration under the runner's flags, with an lspci stub that keeps writing past the pipe buffer after the match. All privileged steps are stubbed.

Where it ran. On a disposable Omarchy worker, the new test failed 3 of 3 runs with grep -q put back and passed 3 of 3 at this head. ./test/cli passed there too. Codex Medium and muse-wonder each confirmed Greptile's finding against the source and found nothing wrong with the fix or the test. They read my description of the change, so their agreement is not guaranteed to be independent. The Thunderbolt fix itself still has not run on a MacBookPro14,1.

What happens next. Nothing else has changed since my last comment, and the items listed there are still open. This still waits on the maintainer: to choose the 14,1's sleep policy, and on omacom/omarchy-pkgs#349 being published. It also needs confirmation on a 14,1 at this head before it can be marked verified.

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

Labels

bug Something isn't working compatibility Make Omarchy work better on everything!

Projects

None yet

5 participants