Skip to content

Turn on the M3 Air's native display, and load the PMP driver before unlock - #58

Merged
maralcbr merged 6 commits into
mainfrom
mac-boot/m3-air-display-default
Oct 24, 2026
Merged

maralcbr merged 6 commits into
mainfrom
mac-boot/m3-air-display-default

Conversation

@scottjones

@scottjones scottjones commented Oct 24, 2026 •

Copy link
Copy Markdown
Collaborator

Summary

A fresh install on an M3 MacBook Air (J613, J615) now gets its native display, and an encrypted M3 root no longer waits 20 s for the PMP driver:

 setup-boot
   grub-console.sh
   limine-boot.sh
+  m1n1-display.sh   # M3 Air: chosen.asahi,t8122-dcp=1 in /etc/m1n1.conf, then update-m1n1
 /etc/mkinitcpio.conf.d/
+  92-omarchy-mac-pmp.conf   # apple_pmp in the initramfs when it's a module

The display line is written only when the installed m1n1-aurora is at least m1n1_t8122_dcp_minimum, 1.6.1.aurora20-4: older m1n1 (1.6.1.aurora20-3) black-screens an M3 Air with it, because it always reserves the external display controller's firmware and the internal one then crashes. 20-4 is omacom/m1n1#14, packaged in omarchy-pkgs#1564, which stops reserving that firmware by default (t8122-dcpext). The pkgrel is part of the minimum, since 20-3 and 20-4 share a pkgver. It writes only t8122-dcp=1, the internal display handoff, so USB-C displays stay off on M3 Airs for now. An owner's own t8122-dcp line and their other m1n1.conf lines are kept, and a failed write or update-m1n1 puts m1n1.conf's original bytes back and warns without failing the setup. That keeps boot.bin matching unless update-m1n1 failed after moving the new one into place, which the next update's boot check reports. It runs only on a booted Mac, never in an image build's chroot. Existing M3 Airs aren't migrated; the hardware page tells their owners how to add the line themselves once their m1n1-aurora is 1.6.1.aurora20-4 or newer.

Evidence

  • Before: an M3 Air boots without its display driver; with t8122-dcp=1 on m1n1-aurora 1.6.1.aurora20-3 it black-screens.
    After: m1n1-display-test.sh: J613 and J615 get the line and one update-m1n1, a rerun changes nothing, the packaged minimum (20-3 gets nothing; 20-4, 20-10 and 21-1 get the line), an older or missing m1n1-aurora, a vercmp that fails or prints garbage, an empty minimum, an image build's chroot, a non-Apple machine, a J613 name on another SoC, another T8122 Mac and an M2 get nothing, an owner's line wins, a failed write or rebuild restores m1n1.conf byte for byte. mac-pmp-initramfs-test.sh: apple_pmp joins only as a module of the target kernel.
  • Each guard fails its test when reverted. omarchy-mac-boot/test/all (244 ok), omarchy-mac/test/all and test/integration/all pass.

Merge Danger

Door: two-way

Boot-critical for M3 Airs. Follow-ups outside this repo:

  • omacom/omarchy: add the new drop-in to its omarchy-mac-boot mkinitcpio fixture copies (check-fixture-drift warns);
  • cold boots of an M3 Air, plain and encrypted, before release. Add the Touch ID review lessons to AGENTS.md and CONTRIBUTING.md #14's working boots also set the T8122 GPU lines; that t8122-dcp=1 alone lights the panel is what the cold boot checks.

Reverting omarchy-pkgs#1564 by re-pinning the old m1n1 commit would ship the black-screen build under a higher pkgrel, which passes this gate, so that revert must also raise or empty the minimum here. Nothing stops a later downgrade of m1n1-aurora below the minimum with the line in place, which would black-screen the Mac; whether the package should also require that m1n1-aurora is still open.

Blast Radius: M3 Airs (display); every Mac's initramfs gains apple_pmp where it's a module

🤖 Generated with Claude Code

scottjones and others added 2 commits October 24, 2026 02:23
m1n1 hands the display coprocessor to Linux on an M3 Air (T8122, J613 and
J615) only when /etc/m1n1.conf sets chosen.asahi,t8122-dcp=1, which
update-m1n1 copies into boot.bin. setup-boot's new last leaf,
setup/m1n1-display.sh, appends that line and runs update-m1n1. With an
m1n1-aurora that lacks the T8122 opt-in gate the line black-screens the
Mac (m1n1-aurora 1.6.1.aurora20-3 does), so the leaf writes nothing below
m1n1_t8122_dcp_minimum, a constant left empty until omarchy-pkgs
publishes the fixed m1n1-aurora. An owner's own line for either value
and their other lines are kept. A failed update-m1n1 puts m1n1.conf's
original bytes back, so the boot check still matches boot.bin, and warns
without failing the setup, which deferred image setup would otherwise
retry every boot. It runs only on a booted Mac: setup-boot clears the
environment, so OMARCHY_MAC_IMAGE_BUILD never reaches it, and a chroot
(an image build's or an installer's) has no booted systemd. Other
T8122 Macs are left alone. setup-boot runs at install and on a hardware rerun only, so the
manual's hardware page tells existing M3 Air edge testers how to add the
line once their m1n1-aurora has the fix.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
On an encrypted root, a kernel with apple_pmp as a module times out "PMP
driver did not bind within 20000 ms" before the passphrase prompt, since
apple-pmp.ko is still on the locked root. 92-omarchy-mac-pmp.conf adds
apple_pmp to MODULES when modinfo names a module of the target kernel,
the way 92-omarchy-mac-hid.conf adds the input drivers, so a built-in or
missing driver never fails mkinitcpio. It is its own drop-in so it does
not collide with #31's change to the input list, and the initramfs hook
rebuilds when it changes.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
@scottjones
scottjones requested a review from maralcbr as a code owner October 24, 2026 06:24
@greptile-apps

greptile-apps Bot commented Oct 24, 2026 •

Copy link
Copy Markdown

RetriggerView in GreptileConfidence Score: 5/5

[Medium impact] No blocking code issues were found in the changes since the previous review.

Summary

Adds the M3 MacBook Air display default and includes apple_pmp in the initramfs when the target kernel provides it as a module.

  • Fresh M3 Air setup turns on the built-in display.
  • Encrypted-root startup loads apple_pmp before unlock when it is a module.

Diagram

%%{init: {'theme': 'neutral'}}%%
flowchart TD
  A[setup-boot] --> B[Console and Limine setup]
  B --> C{Booted M3 Air?}
  C -->|No| D[Leave display config alone]
  C -->|Yes| E{m1n1-aurora meets minimum?}
  E -->|No or unknown| D
  E -->|Yes| F{Owner already set the display line?}
  F -->|Yes| D
  F -->|No| G[Write display line and run update-m1n1]
  G -->|Failure| H[Restore original config and warn]
Loading

Reviews (4) · Last reviewed commit: "Turn the M3 Air display default on at m1..." · Reviewed by Greptile

@maralcbr maralcbr left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Thanks @scottjones, gating the display line on the m1n1-aurora version and shipping it inert until omacom/m1n1#14 is packaged is the right way to land this. CI is green at 7ae9147, and omarchy-mac-boot/test/all passes for me in the CI Arch image: 236 ok, with all four display cases, the PMP drop-in and the setup-boot order. On the kernel side, apple_pmp is CONFIG_APPLE_PMP=m in linux-aurora's asahi.config:103, and the 20 s wait is pmp-report.c:752-758, so the drop-in targets the right module.

One fix before merge:

  • The version gate fails open. setup/m1n1-display.sh:38 is if (( $(vercmp "$installed" "$minimum_m1n1") < 0 )). If vercmp fails or prints nothing, the arithmetic is a syntax error, the if is false and the leaf carries on and writes the line. That's the gate that keeps an older m1n1 from black-screening the Mac, so it should fail closed. Suggested fix: result=$(vercmp "$installed" "$minimum_m1n1") && [[ $result =~ ^-?[0-9]+$ ]] || { echo "m1n1-display: cannot compare m1n1-aurora $installed with $minimum_m1n1; leaving $config alone"; exit 0; }, then if (( result < 0 )). Please add test cases with a vercmp stub that fails and one that prints garbage.

Smaller things:

  • Not every guard has a test that fails without it. The predicate stub always succeeds (test/m1n1-display-test.sh:12), no case sets OMARCHY_MAC_IMAGE_BUILD=1, and the M2 case (:79) fails the board check as well as the SoC one, so removing the Apple predicate, the image-build guard or the apple,t8122 check passes the suite. Could you add a failing omarchy-hw-apple-silicon, an image-build case, and apple,j613 without apple,t8122?
  • Upstream fixtures. CONTRIBUTING asks for the copies omacom/omarchy keeps of the drop-ins to be updated with them, and check-fixture-drift only warns. Please open that PR for 92-omarchy-mac-pmp.conf and link it here.
  • A failed first write isn't rolled back. If sudo install at :57 fails, the leaf exits without putting m1n1.conf back, and install can unlink the destination before it copies. Running the same restore as the update-m1n1 branch would cover it.

Nits, fine as follow-ups:

  • :43: the . in chosen.asahi is a regex wildcard. grep -Eq "^[[:space:]]*${key//./\\.}=" would make it literal.
  • README :13 says a failed update-m1n1 leaves boot.bin and the boot check in agreement. update-m1n1 can fail after it has moved the new boot.bin into place (unmounting the ESP, say), and then the restored m1n1.conf no longer matches. The next update's boot check catches it, so I'd soften the wording rather than change the code.
  • Manual 12-hardware.md:67 appends without checking, so it duplicates on a second run and adds a second line after an owner's =0. Something like grep -q '^chosen.asahi,t8122-dcp=' /etc/m1n1.conf || printf ... would avoid both. Once the minimum is known, the manual should name the version too.
  • The PR body says filling in the version "is the only change it needs". test/m1n1-display-test.sh:80-81 asserts the constant is empty, so that test changes in the same follow-up.

For release (not this merge): the PMP drop-in goes to every Mac's initramfs, so an encrypted cold boot on an M1 or M2 as well as the M3 Air before the omarchy-mac-boot release that carries it. The display line needs the plain and encrypted M3 Air cold boots you listed once the minimum is filled, including whether t8122-dcp=1 alone lights the panel.

With the vercmp fix in, this is good to merge from my side.

Comment thread omarchy-mac-boot/setup/m1n1-display.sh Outdated
echo "m1n1-display: m1n1-aurora is not installed; leaving $config alone"
exit 0
fi
if (( $(vercmp "$installed" "$minimum_m1n1") < 0 )); then

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

If vercmp fails or prints nothing, this (( )) is a syntax error, the if is false and the line gets written. Please capture the result, check it's an integer, and exit 0 otherwise.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

Good catch, thanks. Fixed in 879ff9e: we capture the vercmp result, require an integer (negative included), and leave m1n1.conf alone with a message otherwise. The test now runs a vercmp stub that fails, one that prints garbage and one that prints nothing, and each writes nothing. Reverting the check makes those cases fail.

Comment thread omarchy-mac-boot/setup/m1n1-display.sh Outdated
exit 0
fi
# A line the owner wrote, for either value, is theirs to keep.
if [[ -r $config ]] && grep -Eq "^[[:space:]]*$key=" "$config"; then

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

nit: the . in the key is a regex wildcard here; ${key//./\\.} makes it literal.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

Done in 879ff9e with ${key//./\\.}, plus a near-miss test (chosenXasahi,t8122-dcp=0 doesn't count as the owner's line).

Comment thread omarchy-mac-boot/setup/m1n1-display.sh Outdated
[[ ! -s $staged/new || $(tail -c 1 "$staged/new" | od -An -c | tr -d ' ') == '\n' ]] || printf '\n' >>"$staged/new"
fi
printf '# omarchy-mac-boot: the M3 Air native display. Set it to 0 to keep m1n1 from handing it over.\n%s=1\n' "$key" >>"$staged/new"
if ! sudo install -D -m 0644 "$staged/new" "$config"; then

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

A failed install here exits without restoring m1n1.conf, and install can unlink the destination first. The restore from the update-m1n1 branch would cover it.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

Fixed in 879ff9e. A failed install now goes through the same restore as a failed update-m1n1: the original bytes go back, or the file is removed if there wasn't one. The test's sudo stub unlinks the target before failing, and m1n1.conf comes back byte for byte with no rebuild.

machine apple,j504 apple,t8122 apple,arm-platform
check_untouched 'another T8122 Mac is left alone'
machine apple,j414c apple,t6021 apple,arm-platform
check_untouched 'an M2 Max is left alone'

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

This M2 case also fails the board check, so dropping the apple,t8122 check still passes. An apple,j613 without apple,t8122 would isolate it, and the Apple predicate and OMARCHY_MAC_IMAGE_BUILD=1 need cases of their own.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

Added in 879ff9e: a failing omarchy-hw-apple-silicon, an OMARCHY_MAC_IMAGE_BUILD=1 run, and apple,j613 on another SoC. We removed each guard in turn, and its case fails each time.

Comment thread mac-manual/content/12-hardware.md Outdated
M3 Macs are not part of the first release. On an M3 MacBook Air installed from an edge image, the native display needs the line `chosen.asahi,t8122-dcp=1` in `/etc/m1n1.conf`, and a fresh install writes it once its `m1n1-aurora` can use it. An M3 Air installed before that keeps its old boot setup. Once `pacman -Q m1n1-aurora` reports the version with the M3 display fix, add the line yourself and rebuild m1n1's boot image, then reboot:

```bash
printf '\nchosen.asahi,t8122-dcp=1\n' | sudo tee -a /etc/m1n1.conf

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

nit: this appends on every run, and after an owner's =0 too. A grep -q '^chosen.asahi,t8122-dcp=' /etc/m1n1.conf || guard would avoid both.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

Done in 4444376: the step only adds the line when m1n1.conf has none, so a second run or an owner's =0 is left alone. We'll put the version in that paragraph when we fill in the minimum.

scottjones and others added 3 commits October 24, 2026 03:35
The version gate read `(( $(vercmp …) < 0 ))`: when vercmp failed or
printed something other than a number, the arithmetic was an error, the
if was false and the line was written, which black-screens a Mac whose
m1n1-aurora predates the opt-in gate. The result is now captured and must
be an integer; otherwise the leaf leaves m1n1.conf alone. A failed first
write now restores m1n1.conf too, since install can unlink it before it
copies, and the owner-line match takes the key's dot literally.

Tests now fail without each guard: a vercmp that fails, prints garbage
or prints nothing; a failing Apple predicate; an image build; a J613
board name on another SoC; a failed first write; and a near-miss key.
From Marcelo's review of #58.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
…tep idempotent

update-m1n1 can fail after it has moved the new boot.bin into place, so
restoring m1n1.conf keeps them matching only otherwise; the README now
says so, and that the next update's boot check reports it. The manual's
step for existing M3 Airs appended on every run and after an owner's
=0; it now adds the line only when m1n1.conf has none. From Marcelo's
review of #58.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Brings in #59 (save runtime EFI variables at shutdown, keep Omarchy's
Limine timeout). The only conflict was omarchy-mac-boot/README.md: main's
Limine paragraph and its provenance paragraph are kept as they are, with
this branch's setup/m1n1-display.sh leaf added to the setup-boot list and
its M3 Air display and apple_pmp paragraphs after them.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
@scottjones

Copy link
Copy Markdown
Collaborator Author

Thanks for the review. The vercmp fix and the guard tests are in 879ff9e, and the README wording and the manual step are in 4444376. The README now says a restored m1n1.conf keeps boot.bin matching unless update-m1n1 failed after it had moved the new boot.bin into place, and that the next update's boot check reports that case.

On the PR body's "only change" line: you're right, filling in the minimum also flips the test that asserts it's empty. The body now says so.

The fixtures PR for omacom/omarchy is ready and we'll open it and link it here once this merges, so the copy matches main. For release we'll do the encrypted cold boots on an M1 or M2 as well as the M3 Air for the PMP drop-in, and the plain and encrypted M3 Air boots once the minimum is set, including whether t8122-dcp=1 alone lights the panel.

omarchy-pkgs#1564 packaged omacom/m1n1#14 as m1n1-aurora
1.6.1.aurora20-4, which reserves the T8122 external DCP firmware only
with its own opt-in, so chosen.asahi,t8122-dcp=1 no longer black-screens
an M3 Air. m1n1_t8122_dcp_minimum is that version, pkgrel included:
1.6.1.aurora20-3 is the black-screen build and compares lower only
through its pkgrel. The test that asserted the constant was empty now
asserts the version, and checks the packaged constant itself: 20-3
writes nothing, and 20-4, 20-10 and 21-1 write the line. The README and
the manual's note for existing M3 Airs name the version, as Marcelo
asked on #58, and the manual says external displays stay off.

Reverting #1564 by re-pinning the old m1n1 commit would ship the
black-screen build under a higher pkgrel, which passes this gate, so
such a revert must also raise or empty m1n1_t8122_dcp_minimum.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>

@maralcbr maralcbr left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Thanks @scottjones, every point from my last review is in: the vercmp gate fails closed (failing, garbage and empty stubs), each guard has a case that fails without it, a failed first install restores, the key is escaped, the README wording is softened, and the manual step is idempotent. The minimum matches what omarchy-pkgs ships now (pkgver=1.6.1.aurora20, pkgrel=4, no epoch), and chosen.asahi,t8122-dcp is the key omacom/m1n1#14 reads. I also checked that mkinitcpio resolves KERNELVERSION before it sources mkinitcpio.conf.d, so modinfo -k in 92-omarchy-mac-pmp.conf looks at the target kernel, and -k none adds nothing. The comment line the leaf writes is skipped by update-m1n1.

Approving and merging. Follow-ups, none blocking:

  • Staging appends aren't checked (setup/m1n1-display.sh:59,61). If /tmp is full, the live m1n1.conf gets no line or a truncated one and the leaf still says "enabled". It can't black-screen (update-m1n1 drops a line without =, and m1n1 needs "1"), but checking the appends and leaving the live file alone on failure would make the message honest. m1n1_display_failed is defined after them, so a plain || { echo ...; exit 0; } is simplest.
  • :73 still says "the native display stays off" after a rollback, which isn't true when update-m1n1 had already moved the new boot.bin into place. Same softening as the README.
  • Downgrade/revert. With the line in place, a downgrade below 20-4, or the old m1n1 commit re-pinned under a higher pkgrel, black-screens the Air, and raising the minimum then only stops new lines. Worth a line in omarchy-pkgs' m1n1-aurora README so whoever touches that pin knows, and a decision on whether omarchy-mac-boot should conflicts=('m1n1-aurora<1.6.1.aurora20-4').
  • Installs from today's image (m1n1-aurora 20-3) never get the line, since setup-boot doesn't run again on upgrade. The next image build fixes new installs and the manual covers the rest; just flagging it for the edge testers' notes.
  • Restore always writes mode 0644 rather than the original mode; fine for this file.
  • Please open the omacom/omarchy fixtures PR for 92-omarchy-mac-pmp.conf once this lands and link it here.

For release, as you said: apple_pmp reaches every Mac's initramfs on upgrade through the alpm hook, so an encrypted cold boot on an M1 or M2, plus plain and encrypted M3 Air cold boots (including whether t8122-dcp=1 alone lights the panel), before the omarchy-mac-boot release that carries this.

# Keep a last line without its newline from swallowing ours.
[[ ! -s $staged/new || $(tail -c 1 "$staged/new" | od -An -c | tr -d ' ') == '\n' ]] || printf '\n' >>"$staged/new"
fi
printf '# omarchy-mac-boot: the M3 Air native display. Set it to 0 to keep m1n1 from handing it over.\n%s=1\n' "$key" >>"$staged/new"

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

These appends (and the newline one at :59) aren't checked, so a full /tmp installs m1n1.conf without the line, or with a truncated one, and still says "enabled". Not dangerous, but checking them before the install would keep the message honest. m1n1_display_failed is defined below, so a plain || { echo ...; exit 0; } works.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

Thanks, fixed in #60 since this had merged. Every staging write is checked now, and a failure leaves m1n1.conf alone and says "could not stage". The test caps the file size so the copy fits and the appends don't, with and without a trailing newline, and m1n1.conf comes back byte for byte with nothing rebuilt.

}
m1n1_display_failed() {
if m1n1_display_restore; then
echo "m1n1-display: $1; $config is back as it was, and the native display stays off" >&2

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

"the native display stays off" isn't true when update-m1n1 failed after moving the new boot.bin into place. Same softening as the README?

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

Also in #60: it now says boot.bin is unchanged unless update-m1n1 failed after replacing it, matching the README.

@maralcbr
maralcbr merged commit 5ab875b into main Oct 24, 2026
8 checks passed
@scottjones

Copy link
Copy Markdown
Collaborator Author

The two notes are in #60. The m1n1-aurora README line about downgrades and re-pins is a good idea and we'll send it to omarchy-pkgs. We'd rather not add conflicts= to omarchy-mac-boot for now: rc still carries m1n1-aurora 1.6.1.aurora1-3, so the next omarchy-mac-boot there would conflict with the m1n1 every Mac boots from, and it would apply to every Mac rather than just the M3 Airs.

scottjones added a commit that referenced this pull request Oct 24, 2026
Brings in #58 (the M3 Air display default); no conflicts.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
DanteCpp pushed a commit to DanteCpp/omarchy-mac-pkgs that referenced this pull request Nov 6, 2026
…ck leaves

The appends that build the new m1n1.conf in the staging directory were
unchecked, so a full /tmp installed m1n1.conf without the display line,
or with part of it, and still reported it enabled. Each staging write now
leaves m1n1.conf alone and says so. After a failed write or rebuild the
message no longer promises the display stays off, since update-m1n1 may
have replaced boot.bin before failing, matching the README. The manual
says an M3 Air installed with an older m1n1-aurora, today's edge image
included, has to add the line itself. From Marcelo's review of omacom#58.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
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