Repository navigation
Route Goodix 53xc fingerprint readers to Dell's proprietary TOD driver #7993
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
anupanup2001
wants to merge
7
commits into
omacom:quattro
Choose a base branch
from
anupanup2001:goodix-53xc-fingerprint-tod
base: quattro
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from 6 commits
Commits
Show all changes
7 commits
Select commit
Hold shift + click to select a range
4be1f93
Offer Dell's proprietary Goodix 53xc driver when open libfprint can't…
anupanup2001 aaa1d87
Merge upstream/quattro into the Goodix 53xc fingerprint branch
anupanup2001 1117510
Merge quattro into the Goodix 53xc fingerprint branch
omarchybot 1121a5c
Expect the Goodix TOD packages in the fingerprint removal test
omarchybot f73a76a
Only route a reader to the driver path when fprintd sees no device
omarchybot d460675
Put the open libfprint back when the Goodix driver fails to build
omarchybot b2a720b
Put the open libfprint back when the Goodix driver setup is interrupted
omarchybot File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,22 @@ | ||
| #!/bin/bash | ||
|
|
||
| # omarchy:summary=Returns true when the fingerprint reader present is a Goodix 53xc, which open libfprint cannot drive | ||
| # omarchy:hidden=true | ||
|
|
||
| # Goodix 27c6:530c / 533c / 538c readers (Dell machines) have no open-source | ||
| # driver — stock libfprint's goodixmoc table starts at 5840. Dell publishes a | ||
| # proprietary TOD plugin for Linux, packaged in the AUR as | ||
| # libfprint-goodix-53xc, whose compiled id table is exactly these three (the | ||
| # udev rule in that package also lists 5840, but the open driver covers it). | ||
| # Matching is by exact vid:pid, not vendor: nothing else from this vendor | ||
| # should be steered toward a closed blob when the open driver works. | ||
| tod_products=" 530c 533c 538c " | ||
| usb_devices_path="${OMARCHY_USB_DEVICES_PATH:-/sys/bus/usb/devices}" | ||
|
|
||
| for dev in "$usb_devices_path"/*; do | ||
| [[ -r $dev/idVendor && -r $dev/idProduct ]] || continue | ||
| [[ $(<"$dev/idVendor") == "27c6" ]] || continue | ||
| [[ $tod_products == *" $(<"$dev/idProduct") "* ]] && exit 0 | ||
| done | ||
|
|
||
| exit 1 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,80 @@ | ||
| #!/bin/bash | ||
|
|
||
| set -euo pipefail | ||
|
|
||
| source "$(cd -- "$(dirname -- "${BASH_SOURCE[0]}")" && pwd)/base-test.sh" | ||
|
|
||
| tmp_dir=$(mktemp -d) | ||
| trap 'rm -rf "$tmp_dir"' EXIT | ||
|
|
||
| write_usb_devices() { | ||
| rm -rf "$tmp_dir/devices" | ||
| mkdir -p "$tmp_dir/devices" | ||
|
|
||
| local index=0 | ||
| local spec | ||
| for spec in "$@"; do | ||
| local vendor=${spec%%:*} | ||
| local product=${spec#*:} | ||
| local dev="$tmp_dir/devices/1-$index" | ||
|
|
||
| mkdir -p "$dev" | ||
| printf '%s\n' "$vendor" >"$dev/idVendor" | ||
| printf '%s\n' "$product" >"$dev/idProduct" | ||
| index=$((index + 1)) | ||
| done | ||
| } | ||
|
|
||
| hw_fingerprint_tod() { | ||
| OMARCHY_USB_DEVICES_PATH="$tmp_dir/devices" "$ROOT/bin/omarchy-hw-fingerprint-tod" | ||
| } | ||
|
|
||
| assert_needs_tod() { | ||
| local description="$1" | ||
|
|
||
| hw_fingerprint_tod || fail "$description" | ||
| pass "$description" | ||
| } | ||
|
|
||
| assert_open_driver() { | ||
| local description="$1" | ||
|
|
||
| if hw_fingerprint_tod; then | ||
| fail "$description" | ||
| fi | ||
| pass "$description" | ||
| } | ||
|
|
||
| write_usb_devices '27c6:530c' | ||
| assert_needs_tod "a Goodix 530c is flagged for the proprietary driver" | ||
|
|
||
| write_usb_devices '27c6:533c' | ||
| assert_needs_tod "a Goodix 533c is flagged for the proprietary driver" | ||
|
|
||
| write_usb_devices '27c6:538c' | ||
| assert_needs_tod "a Goodix 538c is flagged for the proprietary driver" | ||
|
|
||
| # The open goodixmoc driver covers 5840 and up, so those must not be steered | ||
| # toward the closed blob. | ||
| write_usb_devices '27c6:5840' | ||
| assert_open_driver "a Goodix 5840 stays on the open driver" | ||
|
|
||
| write_usb_devices '27c6:6014' | ||
| assert_open_driver "a Goodix 6014 stays on the open driver" | ||
|
|
||
| write_usb_devices '27c6:9999' | ||
| assert_open_driver "an unknown Goodix product is not flagged" | ||
|
|
||
| write_usb_devices '138a:530c' | ||
| assert_open_driver "another vendor's 530c product id is not flagged" | ||
|
|
||
| # Real sysfs device directories can lack attribute files; a missing vendor | ||
| # attribute must be skipped rather than misread as a non-match on another | ||
| # field. | ||
| rm -rf "$tmp_dir/devices" | ||
| mkdir -p "$tmp_dir/devices/1-0" | ||
| printf '530c\n' >"$tmp_dir/devices/1-0/idProduct" | ||
| assert_open_driver "a device missing its vendor attribute is skipped" | ||
|
|
||
| write_usb_devices | ||
| assert_open_driver "a machine with no USB devices is not flagged" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.