Fix AMD Surface keyboard support at the LUKS prompt #14195
<!-- greptile_summary -->
<h2><a href="https://app.greptile.com/api/retrigger?id=74215841&sig=cfbf239b8335c2b5ae6c8e53e17a2c415ebb8d417429c205d3d5c1f678d35342"><picture><source media="(prefers-color-scheme: dark)" srcset="https://greptile-static-assets.s3.amazonaws.com/badges/RetriggerDark.svg?v=2"><source media="(prefers-color-scheme: light)" srcset="https://greptile-static-assets.s3.amazonaws.com/badges/Retrigger.svg?v=2"><img alt="Retrigger" src="https://greptile-static-assets.s3.amazonaws.com/badges/Retrigger.svg?v=2" align="right"></picture></a><a href="https://app.greptile.com/-/switch-tenant?tenant=omacom&next=%2Fomacom%2Fomarchy%2Fpull%2F14195&utm_source=greptile_review&utm_medium=github&utm_campaign=view_in_greptile"><picture><source media="(prefers-color-scheme: dark)" srcset="https://greptile-static-assets.s3.amazonaws.com/badges/ViewInGreptileDark.svg?v=2"><source media="(prefers-color-scheme: light)" srcset="https://greptile-static-assets.s3.amazonaws.com/badges/ViewInGreptile.svg?v=2"><img alt="View in Greptile" src="https://greptile-static-assets.s3.amazonaws.com/badges/ViewInGreptile.svg?v=2" align="right"></picture></a>Confidence Score: 5/5</h2>
[Medium impact] The PR appears safe to merge; no blocking issues remain.
<h3>Summary</h3>
Adds keyboard modules when pinctrl detection returns nothing on an x86 Surface.
No new actionable issues were found. Both previous threads are addressed.
<details open><summary><h3>Diagram</h3></summary>
%%{init: {'theme': 'neutral'}}%%
flowchart TD
A[Run Surface migration] --> B{Surface, x86, Limine, and no pinctrl?}
B -- No --> C[Skip repair]
B -- Yes --> D{Repair already complete?}
D -- Yes --> C
D -- No --> E[Write configuration if missing]
E --> F[Rebuild boot images]
F --> G{Build failed?}
G -- Yes --> H[Exit with error and leave pending]
G -- No --> I[Mark complete and request reboot]
</details>
<!-- greptile_confidence_score:5 -->
<sub>Reviews (6) · Last reviewed commit: "fix: include Surface keyboard modules wi..." · Reviewed by Greptile</sub>
<a href="#"><img alt="P1" src="https://greptile-static-assets.s3.amazonaws.com/badges/p1.svg?v=9" align="top"></a> Boot image remains unchanged
On an existing AMD Surface, rerunning omarchy apply hardware writes this configuration but does not rebuild the boot image. The next LUKS prompt therefore still uses the old image without these keyboard modules. Rebuild the image after changing the configuration, or arrange a rebuild in the calling flow.
Kept boot-image rebuilding out of the install leaf and added an update migration for existing Surface installations without pinctrl. It applies missing module configuration, preserves existing configuration, and rebuilds with limine-mkinitcpio. The Surface setup and migration fixture tests pass, including retrying a failed rebuild.
<a href="#"><img alt="P1" src="https://greptile-static-assets.s3.amazonaws.com/badges/p1.svg?v=9" align="top"></a> Skipped build marked complete
If limine-mkinitcpio skips a failed kernel build but returns success, this migration still writes its completion marker. The Surface keyboard modules will be missing from the boot image, and future runs will skip the repair, leaving the keyboard unusable at the LUKS prompt. Another kernel migration accounts for this behavior by checking the result before marking completion.
Added a check of the rebuild output before writing the completion marker. A skipped build returning success now leaves the migration pending, including when another kernel reports success. The fixture tests cover those cases and a successful retry.
Thanks for turning the module list from #11128 into a fix. Two small things:
MODULES=(…) to MODULES+=(…). Your fallback already uses +=, so it'd be good to make the pinctrl branch match too (or coordinate with #8151) so the two branches don't clobber existing MODULES differently.1791074563 is older than migrations already on quattro (e.g. 1791125650). Pending migrations still run, so it isn't a bug, but bumping it to a fresh timestamp keeps the run order matching the merge order.It'd also be great if an AMD Surface owner from #11128 could confirm the keyboard works at the LUKS prompt with this module set.
Included the pinctrl change from #8151 and credited @jovial-liu in the commit. I renamed the migration to 1791345415.sh and updated its completion marker and tests. The 23 Surface fixture assertions pass. The full suite fails on both this branch and its parent. I don't have an AMD Surface to confirm the keyboard at the LUKS prompt.
Thanks — the two review points look addressed now: the pinctrl branch
uses MODULES+=, the migration timestamp was refreshed, and the 23
Surface fixture assertions pass. The full-suite failure also
reproduces on the parent branch, so it does not appear to be
introduced by this PR.
The main missing signal seems to be real AMD Surface hardware
validation. @gs86baker, since #11128 is from your Surface Laptop 3 AMD
and you already confirmed the manual module workaround, would you be
able to test the current PR branch/update path and confirm that the
built-in keyboard works at the LUKS prompt after reboot?
If that hardware check passes, this should give maintainers the last
piece of confidence needed for the AMD Surface path.
On Tue, 06 Oct 2026 21:15:16 -0700, Chi-Wei Lee
@.> wrote:Arthur031221 left a comment (omacom/omarchy#14195)
> Included the pinctrl change from #8151 and credited
@.(https://github.com/jovial-liu) in the commit. I renamed the migration to 1791345415.sh and updated its completion marker and tests. The 23 Surface fixture assertions pass. The full suite fails on both this branch and its parent. I don't have an AMD Surface to confirm the keyboard at the LUKS prompt.
> —
Reply to this email directly, view it on GitHub, or unsubscribe.
You are receiving this because you were mentioned.
Thanks, re-checked: the pinctrl branch now uses MODULES+= and the migration has a fresh timestamp. Code looks good to me. LGTM, pending a hardware confirmation from an AMD Surface owner.
Tested on a Surface Laptop 3 15" AMD (model 1873, Ryzen 5 3580U), kernel 7.2.5-3-omarchy, LUKS + Limine UKI.
I removed my manually created surface_device_modules.conf and ran migration 1791345415.sh from this branch. It regenerated the file with MODULES+=(surface_aggregator surface_aggregator_registry surface_aggregator_hub surface_hid_core surface_hid surface_kbd hid_multitouch 8250_dw) and rebuilt both UKIs. After a reboot, both the keyboard and touchpad work at the LUKS password prompt. 👍
Thanks @gs86baker, that's the hardware confirmation this was waiting on: the migration regenerated the module list and the keyboard and touchpad work at the LUKS prompt on a Surface Laptop 3 AMD. With that, this looks ready for a maintainer.
This had stopped merging into quattro: #14820 gated install/hardware/fix-surface-keyboard.sh on omarchy-hw-x86 and made its config directory overridable, both in the lines this PR changes. I merged quattro into the branch (79f63cd4f7f20e82cb00b818c301a7f743138c9c) and kept both: the AMD fallback now writes through the same $mkinitcpio_dir as the pinctrl branch, and the migration also skips non-x86 machines, where the script now writes nothing and the rebuild would be wasted. test/shell.d/surface-hardware-test.sh from #14820 asserted the old behaviour (nothing written without pinctrl, MODULES= rather than MODULES+=), so it now expects the AMD list. Your two tests stub omarchy-hw-x86. The fix itself is unchanged.
What ran, on a disposable Omarchy worker: the Surface tests fail on quattro and on this branch with the fix reverted, because the no-pinctrl case writes nothing, and they all pass on the merged head. These are stubbed tests, so they show the script's behaviour, not the keyboard. ./test/cli passes. The full shell suite has 8 failures on the head, and every one also fails on quattro.
The evidence that the keyboard works is @gs86baker's test on a Surface Laptop 3 AMD, which was against the previous head (bb7ff66). The AMD path behaves the same after the merge, but a new head needs a new confirmation. @gs86baker, if you can, please re-run it at this commit. The migration left a completion marker last time, so remove that as well:
git clone -b fix-surface-keyboard-no-pinctrl-s64 https://github.com/Arthur031221/omarchy.git && cd omarchy
git checkout 79f63cd4f7f20e82cb00b818c301a7f743138c9c
sudo rm -f /etc/mkinitcpio.conf.d/surface_device_modules.conf /var/lib/omarchy/migrations/1791345415
OMARCHY_PATH=$PWD bash -euo pipefail migrations/1791345415.sh
Then reboot and check the keyboard and touchpad at the LUKS prompt.
Who checked this: the review, port and tests were done by Claude Opus 5.5 alone. The configured second opinion did not run, because its daily review budget was spent. For the same reason, whether this is classed as a hardware bug was not settled by two models, so no class label has been added yet. It waits on the reporter's confirmation at the new head, then on a second-opinion review and the maintainer.
One note for the maintainer, which I did not change: the comment in etc/mkinitcpio.conf.d/omarchy_hooks.conf says surface_device_modules.conf resets MODULES and is only written on Intel machines. With this PR it appends and is also written on AMD Surfaces, so the comment is out of date but harmless. It is a packaged config file, so I left it for a change of its own rather than ship it here.
Rebased onto current quattro as a single commit and trimmed to the AGENTS.md rules. The conflict was surface-hardware-test.sh, which quattro folded into hardware-quirks-test.sh, so the two changed expectations live there now and the two extra test files are gone. The migration has a fresh timestamp (1794106576.sh), uses the same failed-kernel check as the other mkinitcpio migrations, and marks a reboot as required. This overlaps #14541, which makes the same MODULES+= change on the pinctrl branch and rewrites the comment in omarchy_hooks.conf, so I left that comment alone. hardware-quirks-test passes, and fails with fix-surface-keyboard.sh restored to quattro's version.
Checked 3d7674b48519fe0c3fa7f67e40e6b3f668a3b8f4 on a disposable Omarchy worker. My configuration check fails on quattro, passes on this head, and fails with the installer fix reverted. The CLI, hardware-quirks, mkinitcpio-hooks, and Surface Pro 11 hardware tests pass. Separate migration checks covered hardware guards, successful rebuilds, repeat runs, preserving existing configuration, failed or skipped kernel builds, and successful retries. These checks use simulated hardware and do not establish that the keyboard works at the LUKS prompt.
Reviewed and exercised by Codex High. Opus 5.5 High and muse-wonder via pi, thinking high found no blocking code defect and agreed that this head still needs hardware confirmation; independence is not guaranteed. Both noted that the repository test checks file creation without checking the AMD module list. The separate worker probe checked that list and preservation of earlier modules. #8151 and #14541 share the Intel append change but do not supply this AMD repair.
@gs86baker, your earlier hardware confirmation was for a different revision. Please test this full commit on your AMD Surface. The following moves any existing Surface module drop-in to a backup so the migration can exercise the missing-file repair:
git clone --single-branch --branch fix-surface-keyboard-no-pinctrl-s64 https://github.com/Arthur031221/omarchy.git omarchy-14195
cd omarchy-14195
git checkout --detach 3d7674b48519fe0c3fa7f67e40e6b3f668a3b8f4
if [[ -e /etc/mkinitcpio.conf.d/surface_device_modules.conf ]]; then
sudo mv /etc/mkinitcpio.conf.d/surface_device_modules.conf "/etc/mkinitcpio.conf.d/surface_device_modules.conf.before-14195-$(date +%s)"
fi
sudo rm -f /var/lib/omarchy/migrations/1794106576
OMARCHY_PATH="$PWD" bash -euo pipefail migrations/1794106576.sh
After the rebuild succeeds, reboot and confirm whether the built-in keyboard and touchpad work at the LUKS prompt. Please include the full commit SHA in your reply. This waits on that hardware confirmation; it has not been marked verified.
Tested commit 3d7674b48519fe0c3fa7f67e40e6b3f668a3b8f4 on my AMD Surface Laptop 3 using the steps above:
/etc/mkinitcpio.conf.d/surface_device_modules.conf to a backup and removed /var/lib/omarchy/migrations/1794106576.migrations/1794106576.sh, which recreated /etc/mkinitcpio.conf.d/surface_device_modules.conf with:MODULES+=(surface_aggregator surface_aggregator_registry surface_aggregator_hub surface_hid_core surface_hid surface_kbd hid_multitouch 8250_dw)@gs86baker's confirmation now covers the current full commit 3d7674b48519fe0c3fa7f67e40e6b3f668a3b8f4: the migration recreated the missing configuration, rebuilt the boot images, and the built-in keyboard and touchpad worked at the LUKS prompt on an AMD Surface Laptop 3. Recorded that confirmation and marked this head verified.
On a fresh disposable Omarchy worker, the configuration reproduction fails on quattro, passes on this head, and fails with the leaf reverted. The CLI passes, and the full shell suite ran all 420 test files, including passing hardware-quirks, mkinitcpio-hooks and Surface Pro 11 checks. Three unrelated failures (ASCII width, branding animation and runtime IPC) also fail on quattro. A Git-identity failure came from the worker copy's invalid Git pointer and passed after correcting that copy; a translation test passed when run once in isolation. Six files had skipped platform or dependency checks. No source changes were needed.
Codex High performed this review and the worker checks. Opus 5.5 High and muse-wonder via pi, thinking high found no blocking code defect and agreed that the reporter's exact-commit test supplies the missing hardware evidence; independence is not guaranteed. The separate readiness check held this for maintainer review of the Intel append overlap and the migration's machine-wide marker and rebuild policy. Hardware verification is complete; this waits on that decision.
Arthur031221
AMD Surface laptop users cannot use the built-in keyboard at the LUKS password prompt because an empty pinctrl result skips initramfs configuration. This uses the module array @gs86baker posted in issue 11128 and appends it to any existing MODULES entries.
Added a fixture regression for the empty-pinctrl path.
bash test/shell.d/surface-keyboard-test.shpasses.Fixes #11128
Co-authored-by: Greg Baker <97172181+gs86baker@users.noreply.github.com>