Files
omarchy/install/hardware/fix-synaptic-touchpad.sh
T
OmarchybotandClaude Opus 5 2b1d3c4606 Stop a psmouse quirk from failing every install (backport of #7236)
Backport of the synaptic touchpad quirk fix (PR #7236, merged to quattro as
20400bad) 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) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_018DEMYa9UWtroz93DhMTtcV
2026-08-24 15:37:29 +02:00

26 lines
1.4 KiB
Bash

# Enable Synaptics InterTouch for confirmed touchpads if not already loaded
#
# Only when modprobe can resolve psmouse for the running kernel, and never
# fatally. Installs run this under arch-chroot, where uname -r still names the
# live ISO's kernel while /lib/modules holds the target's -- the two differ on
# every machine that is not a T2 Mac, so modprobe failed with "Module psmouse
# not found in directory /lib/modules/<live kernel>" and took the whole install
# down with it. Asking modprobe itself first (-qn resolves a module without
# loading it) keeps that mismatch quiet, and the warning below covers every
# other reason it declines. An optional touchpad improvement must not be able to
# halt an install.
#
# Loading a module into the live kernel does nothing for the installed system
# either way, so this only takes effect when it runs on the booted machine.
# Persisting the switch instead 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" in
# /proc/bus/input/devices -- a wider change than this one, and not one to make
# blind.
if grep -qi synaptics "${OMARCHY_SYNAPTIC_INPUT_DEVICES:-/proc/bus/input/devices}" \
&& ! lsmod | grep -q '^psmouse' \
&& modprobe -qn psmouse; then
modprobe psmouse synaptics_intertouch=1 ||
echo "Warning: could not enable Synaptics InterTouch on psmouse" >&2
fi