← Back to Pull requests

Fix AMD Surface keyboard support at the LUKS prompt #14195

Open
Arthur031221 opened this pull request with 36 lines diff across 3 files
View on GitHub
Arthur031221 Arthur031221 commented on Oct 04, 2026 00:48 UTC
Author

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.sh passes.

Fixes #11128

Co-authored-by: Greg Baker <97172181+gs86baker@users.noreply.github.com>

Diff: 36 lines (+33 / -3) across 3 files Reviewer: Arthur031221 Review duration: 86821m
All Vouch review confidence checks passed
Residual risk 0.10 = Change Risk (0.49) × (1 − Review Confidence (0.79)). Review depth and reviewer attention state are adequate.
Model 1 · Change Risk (XGBoost)
Score: 0.49 · 36 lines diff across 3 files
0.49
Model 2 · Review Depth (DistilBERT)
Depth Score: 0.93 · 5 substantive comment(s)
0.93
Model 3 · Review Timing & Attention
Session adequacy: 100% · Reviewer familiarity: 50%
78%
Bedrock Claude 3 · Risk Narration
(disconnected)
Groq
Groq Risk Narration
AWS Bedrock is currently disconnected. Generate high-confidence PR triage narration on-demand using Groq.
Model 1 · Change Risk Attribution
SHAP Weights
Diff Size diff_size
0.216
Self Review self_review
0.140
Real PR Conversation Timeline
17 items
greptile-apps[bot] greptile-apps[bot] commented on Oct 04, 2026 00:51 UTC
Bot

<!-- greptile_summary -->

<h2><a href="https://app.greptile.com/api/retrigger?id=74215841&amp;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&amp;next=%2Fomacom%2Fomarchy%2Fpull%2F14195&amp;utm_source=greptile_review&amp;utm_medium=github&amp;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.

  • AMD Surface boot images now include keyboard modules without pinctrl detection.
  • 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>

    greptile-apps[bot] greptile-apps[bot] commented on code on Oct 04, 2026 00:52 UTC
    Code Review
    install/hardware/fix-surface-keyboard.sh:1
    @@ -14,6 +14,9 @@ if omarchy-hw-surface; then
       pinctrl_module=$(lsmod | grep pinctrl_ | cut -f 1 -d" " || true)
       if [[ -z $pinctrl_module ]]; then
         echo "Failed to autodetect pinctrl module."
    +    mkdir -p /etc/mkinitcpio.conf.d
    +    echo "MODULES+=(surface_aggregator surface_aggregator_registry surface_aggregator_hub surface_hid_core surface_hid surface_kbd hid_multitouch 8250_dw)" > \
    +      /etc/mkinitcpio.conf.d/surface_device_modules.conf

    <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.

    Arthur031221 Arthur031221 commented on code on Oct 04, 2026 01:46 UTC
    Code Review
    install/hardware/fix-surface-keyboard.sh:1
    @@ -14,6 +14,9 @@ if omarchy-hw-surface; then
       pinctrl_module=$(lsmod | grep pinctrl_ | cut -f 1 -d" " || true)
       if [[ -z $pinctrl_module ]]; then
         echo "Failed to autodetect pinctrl module."
    +    mkdir -p /etc/mkinitcpio.conf.d
    +    echo "MODULES+=(surface_aggregator surface_aggregator_registry surface_aggregator_hub surface_hid_core surface_hid surface_kbd hid_multitouch 8250_dw)" > \
    +      /etc/mkinitcpio.conf.d/surface_device_modules.conf

    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.

    greptile-apps[bot] greptile-apps[bot] commented on code on Oct 04, 2026 01:47 UTC
    Code Review
    migrations/1791074563.sh:1
    @@ -0,0 +1,16 @@
    +echo "Add Surface keyboard modules to the boot image on existing AMD installations"
    +
    +omarchy-hw-surface || exit 0
    +omarchy-cmd-present limine-mkinitcpio || exit 0
    +pinctrl_module=$(lsmod | grep pinctrl_ || true)
    +[[ -z $pinctrl_module ]] || exit 0
    +
    +rebuild_marker="/var/lib/omarchy/migrations/1791074563"
    +[[ ! -e $rebuild_marker ]] || exit 0
    +
    +if [[ ! -e /etc/mkinitcpio.conf.d/surface_device_modules.conf ]]; then
    +  sudo bash -e "$OMARCHY_PATH/install/hardware/fix-surface-keyboard.sh"
    +fi
    +
    +sudo limine-mkinitcpio
    +sudo install -Dm644 /dev/null "$rebuild_marker"

    <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.

    Arthur031221 Arthur031221 commented on code on Oct 04, 2026 02:18 UTC
    Code Review
    migrations/1791074563.sh:1
    @@ -0,0 +1,16 @@
    +echo "Add Surface keyboard modules to the boot image on existing AMD installations"
    +
    +omarchy-hw-surface || exit 0
    +omarchy-cmd-present limine-mkinitcpio || exit 0
    +pinctrl_module=$(lsmod | grep pinctrl_ || true)
    +[[ -z $pinctrl_module ]] || exit 0
    +
    +rebuild_marker="/var/lib/omarchy/migrations/1791074563"
    +[[ ! -e $rebuild_marker ]] || exit 0
    +
    +if [[ ! -e /etc/mkinitcpio.conf.d/surface_device_modules.conf ]]; then
    +  sudo bash -e "$OMARCHY_PATH/install/hardware/fix-surface-keyboard.sh"
    +fi
    +
    +sudo limine-mkinitcpio
    +sudo install -Dm644 /dev/null "$rebuild_marker"

    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.

    jandrusk jandrusk commented on Oct 06, 2026 13:50 UTC
    Contributor

    Thanks for turning the module list from #11128 into a fix. Two small things:

  • #8151 changes the pinctrl branch of the same script from 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.

  • The migration timestamp 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.

    Arthur031221 Arthur031221 commented on Oct 07, 2026 04:14 UTC
    Author

    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.

    jovial-liu jovial-liu commented on Oct 07, 2026 04:23 UTC
    Contributor

    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.

    jandrusk jandrusk commented on Oct 07, 2026 13:24 UTC
    Contributor

    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.

    gs86baker gs86baker commented on Oct 07, 2026 15:06 UTC
    Contributor

    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. 👍

    jandrusk jandrusk commented on Oct 08, 2026 13:48 UTC
    Contributor

    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.

    omarchybot omarchybot commented on Oct 15, 2026 09:09 UTC
    Contributor

    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.

    Arthur031221 Arthur031221 commented on Nov 08, 2026 03:09 UTC
    Author

    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.

    omarchybot omarchybot commented on Nov 18, 2026 07:14 UTC
    Contributor

    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.

    gs86baker gs86baker commented on Nov 18, 2026 12:47 UTC
    Contributor

    Tested commit 3d7674b48519fe0c3fa7f67e40e6b3f668a3b8f4 on my AMD Surface Laptop 3 using the steps above:

  • Moved the existing /etc/mkinitcpio.conf.d/surface_device_modules.conf to a backup and removed /var/lib/omarchy/migrations/1794106576.

  • Ran 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)
  • Rebuilt initramfs and rebooted.

  • Confirmed both the built-in keyboard and touchpad work at the LUKS prompt.
  • omarchybot omarchybot commented on Nov 18, 2026 13:13 UTC
    Contributor

    @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.

    Reviewers
    Assignees
    Arthur031221 Arthur031221
    Labels
    risk: low confidence: 78.8% reviewed
    Vouch Risk Breakdown
    AI-powered review risk analysis
    Change Risk
    Change Risk · Model 1 (XGBoost)
    Predicted defect probability (0.00–1.00) based on diff churn, modified sensitive files, and author risk history.
    Score: 48.5% (MEDIUM) · Higher = larger blast radius
    48.5%
    Review Confidence
    Review Confidence · Models 2 & 3
    Scrutiny score (0.00–1.00) combining DistilBERT semantic review depth with reviewer familiarity and session dwell time.
    Score: 78.8% · Lower = rushed or shallow review
    78.8%
    Residual Risk
    Residual Risk · Core Equation
    Residual = Change × (1 − Confidence)
    Unmitigated risk surviving review. ≥ 0.65 triggers an automated re-queue to protect production.
    Score: 10.3% · Safe to merge
    10.3%
    Repository