Skip to content

Stop a psmouse quirk from failing every install - #7236

Merged
dhh merged 2 commits into
quattrofrom
fix/issue-6985
Aug 24, 2026
Merged

dhh merged 2 commits into
quattrofrom
fix/issue-6985

Conversation

@omarchybot

@omarchybot omarchybot commented Aug 17, 2026 •

Copy link
Copy Markdown
Collaborator

install/hardware/fix-synaptic-touchpad.sh calls modprobe against the running kernel. Under 4.0 the only thing that runs it is the ISO finalizer, inside arch-chroot, where uname -r still names the live ISO's kernel while /lib/modules holds the target's. The live ISO always boots linux-t2 and the configurator gives every machine that is not a T2 Mac stock linux, so those two can never match: modprobe exits 1 with Module psmouse not found in directory /lib/modules/<live kernel>. run_logged returns that status and omarchy-apply-hardware runs under set -euo pipefail, so the install stops there.

The gate is grep -qi synaptics /proc/bus/input/devices && ! lsmod | grep -q '^psmouse', which is the loosest in install/hardware/ — every sibling quirk gates on DMI vendor, PCI ID or model. Any machine with a device merely named "synaptics", including I2C/SMBus touchpads with no PS/2 controller at all, hits it. Reported from a ThinkPad, but nothing about it is Lenovo-specific.

This asks modprobe itself, with -qn, whether it can resolve psmouse for the running kernel before asking it to load one, and warns instead of failing when it declines for any other reason. The chroot mismatch becomes an unresolvable module, skipped in silence. An optional touchpad improvement should not be able to halt an install.

Worth being explicit about what this does not do: a module loaded into the live kernel is gone at reboot, so on 4.0 this script has never applied InterTouch to an installed machine — it only ever aborted installs. Persisting it would mean writing options psmouse synaptics_intertouch=1 to /etc/modprobe.d, which forces the SMBus transport past the kernel's own allowlist on every touchpad merely named "synaptics". That is a hardware-behaviour change on a wide class of machines, so it is left as a separate decision.

Fixes #6985

install/hardware/fix-synaptic-touchpad.sh calls modprobe against the running
kernel. Under 4.0 the only thing that runs it is the ISO finalizer, inside
arch-chroot, where uname -r still names the live ISO's kernel while /lib/modules
holds the target's. The live ISO always boots linux-t2 and the configurator
gives every machine that is not a T2 Mac stock linux, so those two never match:
modprobe exits 1 with "Module psmouse not found in directory /lib/modules/<live
kernel>". run_logged returns that status and omarchy-apply-hardware runs under
set -euo pipefail, so a fresh install stops on the first machine with a device
named "synaptics" and no psmouse loaded -- reported from a ThinkPad in #6985,
but nothing about it is Lenovo-specific.

Skip the load when the running kernel's modules are not reachable, and warn
instead of failing when modprobe declines for any other reason. An optional
touchpad improvement should never be able to halt an install.

This does not make InterTouch reach the installed system: a module loaded into
the live kernel is gone at reboot, so on 4.0 this script has never applied
anything to an installed machine. Persisting it means writing options psmouse
synaptics_intertouch=1 to /etc/modprobe.d, which forces the SMBus transport past
the kernel's own allowlist on any touchpad merely named "synaptics" in
/proc/bus/input/devices. That is a hardware-behaviour change on a wide class of
machines, so it is left for a maintainer to decide separately.

Fixes #6985

Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

Note

Copilot was unable to run its full agentic suite in this review.

Adds safety and test coverage around enabling Synaptics InterTouch so installs don’t fail when kernel modules for the running kernel aren’t available (e.g., under arch-chroot), while keeping the tweak effective only on the booted machine.

Changes:

  • Make fix-synaptic-touchpad.sh conditional on reachable running-kernel modules and make modprobe failures non-fatal (warn only).
  • Add a shell test that stubs modprobe/lsmod and validates behavior across success, missing modules dir, already-loaded module, and failing modprobe.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 3 comments.

File Description
test/shell.d/synaptic-touchpad-test.sh Adds a regression test harness for the Synaptics/psmouse quirk behavior.
install/hardware/fix-synaptic-touchpad.sh Prevents install-time failure by gating on module availability and warning instead of failing on modprobe.

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment on lines 18 to 26
modules_dir="${OMARCHY_SYNAPTIC_MODULES_DIR:-/lib/modules/$(uname -r)}"
input_devices="${OMARCHY_SYNAPTIC_INPUT_DEVICES:-/proc/bus/input/devices}"

if grep -qi synaptics /proc/bus/input/devices \
if [[ -d $modules_dir ]] \
&& grep -qi synaptics "$input_devices" \
&& ! lsmod | grep -q '^psmouse'; then
modprobe psmouse synaptics_intertouch=1
modprobe psmouse synaptics_intertouch=1 ||
echo "Warning: could not enable Synaptics InterTouch on psmouse" >&2
fi

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Right, and that was the real flaw: the override decided whether the load was attempted but could not change where modprobe looked, so the guard and the load consulted different places.

Taken option (a), with the check moved onto modprobe itself. modprobe -qn psmouse resolves the module against the running kernel without loading it, which is the same question [[ -d /lib/modules/$(uname -r) ]] was trying to ask by hand, answered by the thing that will do the loading. The override is gone and the two now agree by construction. The arch-chroot case is still skipped silently, for the same reason as before.

Comment on lines +18 to +19
modules_dir="${OMARCHY_SYNAPTIC_MODULES_DIR:-/lib/modules/$(uname -r)}"
input_devices="${OMARCHY_SYNAPTIC_INPUT_DEVICES:-/proc/bus/input/devices}"

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Both are gone. modules_dir went with the check it fed, and input_devices is now inlined at its only use, so the leaf leaves nothing at the top level.

Not wrapping it in a function: sourced leaves under install/ set bare top-level variables throughout (pci_info in fix-bcm43xx.sh, product_name in fix-surface-keyboard.sh, provisioning_dir in input-group.sh), so a function here would read as the odd one out. Having no variables at all is the better answer for a script this short.

Comment thread test/shell.d/synaptic-touchpad-test.sh Outdated
leaf="$ROOT/install/hardware/fix-synaptic-touchpad.sh"
all="$ROOT/install/hardware/all.sh"

grep -q 'hardware/fix-synaptic-touchpad.sh' "$all" ||

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Confirmed and tightened to run_logged .*hardware/fix-synaptic-touchpad.sh.

Checked the false positive rather than assuming it: replacing the run_logged line in all.sh with # hardware/fix-synaptic-touchpad.sh used to run here leaves the old assertion passing while the quirk no longer runs at all. The new one fails on that mutation.

…dules

The reachability check ran through OMARCHY_SYNAPTIC_MODULES_DIR, an override
modprobe itself never saw: it decided whether the load was attempted but could
not change where modprobe looked, so the guard and the load consulted different
places and the seam read as though it configured module lookup. modprobe -qn
answers the same question directly -- it resolves psmouse against the running
kernel without loading it -- so the guard and the load now agree by
construction and the override goes away. The arch-chroot case that broke
installs is still skipped silently, for the same reason it always was: the live
kernel's modules are not the ones on disk.

Inline the remaining /proc/bus/input/devices override at its only use. These
leaves are sourced one after another into a single shell, so a variable left at
the top level outlives the script that set it.

Pin the wiring assertion to the run_logged call instead of any mention of the
path. A commented-out line satisfied the old grep, so the test could pass with
the quirk no longer running at all.

Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
Claude-Session: https://claude.ai/code/session_013L5zwTiZ2CsgazyxXBiPa8
@dhh
dhh merged commit 20400ba into quattro Aug 24, 2026
3 checks passed
@dhh
dhh deleted the fix/issue-6985 branch August 24, 2026 13:33
omarchybot added a commit that referenced this pull request Aug 24, 2026
Backport of the synaptic touchpad quirk fix (PR #7236, merged to quattro as
20400ba) onto the v4-0-1 release branch, so 4.0.1 installs stop dying on it.

install/hardware/fix-synaptic-touchpad.sh calls modprobe against the running
kernel. On 4.0 the only thing that runs it is the ISO finalizer, inside
arch-chroot, where uname -r still names the live ISO's kernel while
/lib/modules holds the target's. The live ISO always boots linux-t2 and the
configurator gives every machine that is not a T2 Mac stock linux, so the two
never match: modprobe exits 1 with "Module psmouse not found in directory
/lib/modules/<live kernel>". run_logged returns that status and
omarchy-apply-hardware runs under set -euo pipefail, so a fresh install stops
on the first machine with a device named "synaptics" and no psmouse loaded --
reported from a ThinkPad in #6985, but nothing about it is Lenovo-specific.

Ask modprobe itself, with -qn, whether it can resolve psmouse for the running
kernel before asking it to load one, and warn instead of failing when it
declines for any other reason. The chroot mismatch becomes an unresolvable
module, skipped in silence. An optional touchpad improvement must not be able
to halt an install.

This does not make InterTouch reach the installed system: a module loaded into
the live kernel is gone at reboot, so on 4.0 this script has never applied
anything to an installed machine -- it only ever aborted installs. Persisting
it would mean writing options psmouse synaptics_intertouch=1 to
/etc/modprobe.d, which forces the SMBus transport past the kernel's own
allowlist on any touchpad merely named "synaptics". That is a
hardware-behaviour change on a wide class of machines, left as a separate
decision on quattro.

Clean cherry-pick: both files are byte-identical to #7236, so merging v4-0-1
into quattro resolves without a conflict. test/shell.d/synaptic-touchpad-test.sh
passes here, as does the rest of test/shell (183 files).

Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
Claude-Session: https://claude.ai/code/session_018DEMYa9UWtroz93DhMTtcV
@omarchybot omarchybot mentioned this pull request Aug 24, 2026
nick1udwig pushed a commit to nick1udwig/omarchy that referenced this pull request Sep 9, 2026
* Stop a psmouse quirk from failing every install

install/hardware/fix-synaptic-touchpad.sh calls modprobe against the running
kernel. Under 4.0 the only thing that runs it is the ISO finalizer, inside
arch-chroot, where uname -r still names the live ISO's kernel while /lib/modules
holds the target's. The live ISO always boots linux-t2 and the configurator
gives every machine that is not a T2 Mac stock linux, so those two never match:
modprobe exits 1 with "Module psmouse not found in directory /lib/modules/<live
kernel>". run_logged returns that status and omarchy-apply-hardware runs under
set -euo pipefail, so a fresh install stops on the first machine with a device
named "synaptics" and no psmouse loaded -- reported from a ThinkPad in omacom#6985,
but nothing about it is Lenovo-specific.

Skip the load when the running kernel's modules are not reachable, and warn
instead of failing when modprobe declines for any other reason. An optional
touchpad improvement should never be able to halt an install.

This does not make InterTouch reach the installed system: a module loaded into
the live kernel is gone at reboot, so on 4.0 this script has never applied
anything to an installed machine. Persisting it means writing options psmouse
synaptics_intertouch=1 to /etc/modprobe.d, which forces the SMBus transport past
the kernel's own allowlist on any touchpad merely named "synaptics" in
/proc/bus/input/devices. That is a hardware-behaviour change on a wide class of
machines, so it is left for a maintainer to decide separately.

Fixes omacom#6985

Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>

* Ask modprobe whether psmouse resolves rather than guessing at /lib/modules

The reachability check ran through OMARCHY_SYNAPTIC_MODULES_DIR, an override
modprobe itself never saw: it decided whether the load was attempted but could
not change where modprobe looked, so the guard and the load consulted different
places and the seam read as though it configured module lookup. modprobe -qn
answers the same question directly -- it resolves psmouse against the running
kernel without loading it -- so the guard and the load now agree by
construction and the override goes away. The arch-chroot case that broke
installs is still skipped silently, for the same reason it always was: the live
kernel's modules are not the ones on disk.

Inline the remaining /proc/bus/input/devices override at its only use. These
leaves are sourced one after another into a single shell, so a variable left at
the top level outlives the script that set it.

Pin the wiring assertion to the run_logged call instead of any mention of the
path. A commented-out line satisfied the old grep, so the test could pass with
the quirk no longer running at all.

Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
Claude-Session: https://claude.ai/code/session_013L5zwTiZ2CsgazyxXBiPa8

---------

Co-authored-by: Claude Opus 5 (1M context) <[email protected]>
@emirb emirb added this to the 4.5 milestone Oct 17, 2026
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.

Quattro (4.0) install fails: fix-synaptic-touchpad.sh psmouse module mismatch + vulkan.sh offline mirror missing files

4 participants