Skip to content

Support ELAN match-on-chip v2 fingerprint readers - #8940

Open
sorena100 wants to merge 1 commit into
omacom:quattrofrom
sorena100:fingerprint-elanmoc2-driver
Open

sorena100 wants to merge 1 commit into
omacom:quattrofrom
sorena100:fingerprint-elanmoc2-driver

Conversation

@sorena100

Copy link
Copy Markdown

Summary

Add support for ELAN match-on-chip v2 fingerprint readers with USB ID 04f3:0c4c.

These readers identify as ELAN:ARM-M4, but stock libfprint lacks the required elanmoc2 driver. Setup detects the reader, but fprintd reports no usable device.

Changes

  • Detect 04f3:0c4c by exact USB ID.
  • Install and preserve libfprint-elanmoc2-git.
  • Remove conflicting providers before installation.
  • Remove the replacement provider during teardown.
  • Add focused shell tests.

Packaging

I understand that Omarchy is repackaging the most useful AUR packages itself. Preferably, libfprint-elanmoc2-git should be packaged in the Omarchy repositories rather than installed directly from the AUR. This PR uses the AUR package because it is not currently available in Omarchy repositories.

Related Work

  • #6578 adds detection for other ELAN match-on-chip readers supported by stock libfprint.
  • #6664 discusses generic non-stock libfprint provider detection.
  • #7993 implements a similar hardware-specific provider flow for Goodix readers.
  • #8757 proposes broader support for fprintd-compatible backends.

This PR focuses specifically on making the 04f3:0c4c ELAN reader work with the appropriate provider.

Testing

./test/shell.d/fingerprint-lib-package-test.sh

The ELAN match-on-chip v2 reader (04f3:0c4c) has an elanmoc2 driver
stock libfprint does not ship, so setup left those machines with
fprintd reporting no devices. Select the libfprint provider package by
exact USB ID before installing, keep any already-installed replacement
provider on re-runs, and drop it again on removal.
Copilot AI balanced review requested due to automatic review settings August 29, 2026 13:43

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

Adds hardware-specific libfprint provider selection for ELAN 04f3:0c4c fingerprint readers.

Changes:

  • Selects and installs libfprint-elanmoc2-git for the exact USB ID.
  • Handles conflicting provider removal and teardown.
  • Adds focused provider-selection tests.

Tip

If you aren't ready for review, convert to a draft PR.
Click "Convert to draft" or run gh pr ready --undo.
Click "Ready for review" or run gh pr ready to reengage.

Reviewed changes

Copilot reviewed 1 out of 4 changed files in this pull request and generated no comments.

File Description
bin/omarchy-hw-fingerprint-lib-package Selects the appropriate provider.
bin/omarchy-setup-security-fingerprint Installs the selected provider safely.
bin/omarchy-remove-security-fingerprint Removes the ELAN provider during teardown.
test/shell.d/fingerprint-lib-package-test.sh Tests exact matching and provider persistence.

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

@omarchybot omarchybot added bug Something isn't working compatibility Make Omarchy work better on everything! labels Sep 27, 2026
@omarchybot

Copy link
Copy Markdown
Collaborator

Reviewed at 7e3f919 by Claude Opus 5.5. The second opinion (Codex Medium) did not run: the reviewer answered a ping but refused the review because its daily budget was spent, so this is one model's reading.

The problem is real on current quattro. Since #10442, setup installs omarchy/libfprint-git for every reader. On a worker I unpacked that package (1:1.94.100.r10.g6f9479c-1): it ships no elanmoc2 driver, and its 60-autosuspend-libfprint-2.hwdb lists usb:v04F3p0C4C* under "Known unsupported devices". So a 04f3:0c4c reader is still detected and still cannot be driven.

This branch no longer fits quattro, and resolving the conflict is a design decision rather than a merge. It conflicts in bin/omarchy-setup-security-fingerprint with #10442, which removed exactly this kind of per-reader routing. That commit installs libfprint-git unconditionally, with --ask 4 so the swap happens in one transaction, and states the policy that "the omarchy-pkgs pin is the single place a new reader gets enabled". Rebasing this PR means reintroducing a USB ID gate that picks an AUR provider instead of the pinned package. The other route is to carry elanmoc2 support in the libfprint-git pin in omarchy-pkgs, which is the packaging you suggest in the description. Choosing between the two is the maintainer's call, so I have not pushed a rebase.

One defect in the diff as it stands (bin/omarchy-setup-security-fingerprint:88-101): on a machine that already has stock libfprint, it runs pacman -Rdd libfprint before the AUR build. If yay then fails (no network, a build error in a -git package), set -e exits with fprintd still installed and nothing providing libfprint, so fingerprint auth stops working and pacman is left with a broken dependency. quattro avoids this by doing the swap in a single pacman -S --ask 4 transaction. Any version of this change needs to keep that property.

Worth weighing whichever route is chosen: libfprint-elanmoc2-git is an AUR -git package, so it builds whatever the fork's branch head is at install time, unpinned, into the library fprintd loads to authorise sudo and polkit. #11899 is the related open issue: setup evicts a working libfprint fork on rerun.

Tested: on a credential-free worker built from the Omarchy ISO, against the PR head, the new test/shell.d/fingerprint-lib-package-test.sh passed 9/0 and ./test/cli passed. These tests cover the USB ID selection. They do not cover the install path. No worker has this reader, so the fix has not been reproduced. If the approach is settled, it will also need someone with a 04f3:0c4c reader to confirm it on the final commit.

Waiting on: the maintainer, to decide whether 04f3:0c4c support goes into the omarchy-pkgs libfprint-git pin or into a per-reader provider in setup. After that, the author would need to rebase onto quattro.

@moses-y

moses-y commented Nov 5, 2026

Copy link
Copy Markdown

One more reader for this family: ELAN 04f3:0c00 (ELAN:ARM-M4, bcdDevice 2.83) on an HP Pavilion Aero Laptop 13-be0xxx, Omarchy 4.5.0-3.

It behaves the same as 0c4c on the current pin (libfprint-git 1:1.94.100.r10.g6f9479c-5):

  • omarchy-hw-fingerprint exits 0.
  • fprintd-enroll fails with NoSuchDevice: No devices available.
  • The shipped hwdb lists usb:v04F3p0C00* under "Known unsupported devices".

The elanmoc2 branch's id table has it next to 0c4c with the same driver data:

{.vid = ELANMOC2_VEND_ID, .pid = 0x0c00, .driver_data = ELANMOC2_ALL_DEV},
{.vid = ELANMOC2_VEND_ID, .pid = 0x0c4c, .driver_data = ELANMOC2_ALL_DEV},

So whichever route is chosen (elanmoc2 in the omarchy-pkgs pin, or a per-reader provider), 0c00 probably belongs in it too. The review above says no worker has one of these readers. I have a 0c00 on hand and can test a build of either route on it.

The detection side is in #17672.

@moses-y

moses-y commented Nov 5, 2026

Copy link
Copy Markdown

Following up on my earlier comment: I tested the omarchy-pkgs route on my 04f3:0c00 and opened it as omacom/omarchy-pkgs#2170.

It carries libfprint MR !330 as a patch in the libfprint-git pin (pkgrel 6), so setup's package logic and the single pacman -S --ask 4 transaction stay as they are. Nothing comes from the AUR, and the driver is pinned to the MR's commit instead of building the branch head at install time.

On an HP Pavilion Aero 13-be0xxx with 04f3:0c00, I installed the package with pacman -U and ran omarchy-setup-security-fingerprint unchanged. It enrolled in 8 steps, verify matched, and setup configured sudo, polkit and the lock screen. fprintd-list reports ELAN Match-on-Chip 2 (press). libfprint's suite passes 130/130 in the package build.

The patch leaves out the MR's changes to libfprint core (they fail libfprint's own fpi-device unit test) and its stale recorded test. Details are in #2170.

I haven't tested 0c4c. It's in the same id table with the same driver data, so a confirmation from someone with that reader on #2170 would close the gap.

@omarchybot

Copy link
Copy Markdown
Collaborator

Looked at this again at 7e3f919 (unchanged since the last review), because a competing fix has appeared: omacom/omarchy-pkgs#2170 by @moses-y. It adds the elanmoc2 driver from libfprint MR !330 as a patch to the pinned libfprint-git, so it takes the route your description prefers: packaged in Omarchy's repositories rather than built from the AUR. Claude Opus 5.5 compared the two, and Codex Medium compared them separately without being told this conclusion. Both pick #2170. Independence isn't guaranteed, because the reviewer can read this session's files.

The project's default is that the older fix wins. #2170 is preferred here only because of defects in this branch that #2170 doesn't have:

Codex also found a smaller problem in the new test. The "no matching USB devices" case only runs mkdir -p, so the previous 04f3:0c3a fixture is still there and the case passes for the wrong reason. Also, the selection cases call the host's real pacman, so they would fail on a machine that already has libfprint-elanmoc2-git installed.

Neither model found anything in this branch worth carrying over into #2170. Some limits on what's known about #2170: it was tested on hardware only with a 0c00 reader. Nobody has confirmed it on a 0c4c. Also, deleting a print leaves the sensor's own copy in one of its 10 slots. If you have the 0c4c reader, testing the #2170 package and reporting on that PR would close the main gap. As before, nothing has been run on real hardware here: no worker has this reader. This head was run on a worker in the last review (the new test passed 9/0 and ./test/cli passed), and nothing new was run this time.

Waiting on: the maintainer to choose between this PR and omacom/omarchy-pkgs#2170. Nothing is needed from you before then. Thanks for tracking this reader down in the first place: your PR is what pointed the packaging work at the right driver.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working compatibility Make Omarchy work better on everything!

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants