* Detect Elan match-on-chip fingerprint readers again Elan readers report "ELAN:ARM-M4" as their product string, so the *fingerprint* and *biometric* checks miss them. Elan's 04f3 is also left out of the vendor list on purpose, because Elan makes touchscreens too. Both checks fail, so the machine looks like it has no reader. Add "elan:arm-m4" to the product string check. The comment above the vendor list already says the excluded vendors should still match there, so this makes that true. The vendor list and its has_kernel_driver guard are unchanged, and touchscreens still cannot cause a false positive. The string is a family name, not one device. libfprint uses it for 04f3:0c9c and 04f3:0ca7 as well as 04f3:0ca8. Tested on an HP EliteBook X G2i with 04f3:0ca8. * Point the Elan comment at the vendor list above it Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com> * Configure PAM only after a fingerprint enrolls and verifies Detection proves a reader is present, not that libfprint can drive it. Elan MOC sensors outside the elanmoc table pass the gate and then fail to enroll, which left pam_fprintd in the sudo and polkit stacks with no print to match. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com> --------- Co-authored-by: David Heinemeier Hansson <david@hey.com> Co-authored-by: Claude Opus 5 (1M context) <noreply@anthropic.com>
47 lines
1.8 KiB
Bash
Executable File
47 lines
1.8 KiB
Bash
Executable File
#!/bin/bash
|
|
|
|
# omarchy:summary=Returns true when a fingerprint reader is present
|
|
# omarchy:hidden=true
|
|
|
|
# Detect straight from sysfs so this works before fprintd/usbutils are
|
|
# installed (the fingerprint setup pulls those in). USB vendor IDs listed here
|
|
# ship fingerprint readers; multi-purpose vendors (e.g. Elan/STMicro, which
|
|
# also make USB touchscreens) are left out to avoid nagging laptops with no
|
|
# reader — those still match on the product string below when present.
|
|
fingerprint_vendors=" 27c6 138a 06cb 08ff 1c7a 147e "
|
|
|
|
# libfprint drives every reader it supports from userspace over libusb, so a
|
|
# real reader sits there with no kernel driver bound to any of its interfaces.
|
|
# The other things these vendors build — Synaptics webcam bridges (usbio-bridge
|
|
# on the Dell XPS 14), touchpads and touchscreens (usbhid), cameras (uvcvideo)
|
|
# — all bind one. Only the vendor-ID guess needs this; a device that names
|
|
# itself a fingerprint reader is trusted outright.
|
|
has_kernel_driver() {
|
|
local intf
|
|
for intf in "$1"/*:*; do
|
|
[[ -e $intf/driver ]] && return 0
|
|
done
|
|
return 1
|
|
}
|
|
|
|
for dev in /sys/bus/usb/devices/*; do
|
|
# The device's own product descriptor usually names it, e.g. "Goodix
|
|
# Fingerprint USB Device" — driver-independent and vendor-agnostic.
|
|
if [[ -r $dev/product ]]; then
|
|
product=$(<"$dev/product")
|
|
product=${product,,}
|
|
# Elan's match-on-chip readers report "ELAN:ARM-M4", the family name
|
|
# rather than the function. Elan is left out of the vendor list above
|
|
# on purpose, so without this they match nothing.
|
|
[[ $product == *fingerprint* || $product == *biometric* || $product == *elan:arm-m4* ]] && exit 0
|
|
fi
|
|
|
|
if [[ -r $dev/idVendor ]]; then
|
|
vendor=$(<"$dev/idVendor")
|
|
[[ $fingerprint_vendors == *" $vendor "* ]] &&
|
|
! has_kernel_driver "$dev" && exit 0
|
|
fi
|
|
done
|
|
|
|
exit 1
|