-
Notifications
You must be signed in to change notification settings - Fork 26
core: Add USB device detection and fingerprint reader support #240
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
base: master
Are you sure you want to change the base?
Changes from 4 commits
b7f166c
5a2513d
4bd43d3
e0128b5
8462430
bd65462
2d592d9
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,33 @@ | ||
| [fprint] | ||
| desc = "Fingerprint reader support (fprintd)" | ||
| # Vendor IDs of known fingerprint sensor manufacturers supported by libfprint. | ||
| # Source: https://fprint.freedesktop.org/supported-devices.html | ||
| # 045e Microsoft (fingerprint sensors in Surface devices) | ||
| # 0483 STMicroelectronics / UPEK | ||
| # 04f3 Elan Microelectronics | ||
| # 05ba Digital Persona | ||
| # 06cb Synaptics | ||
| # 08ff AuthenTec | ||
| # 0bda Realtek | ||
| # 10a5 FPC (Fingerprint Cards) | ||
| # 138a Validity Sensors (Synaptics) | ||
| # 147e UPEK | ||
| # 1c7a LighTuning / Egis Technology | ||
| # 2541 Realtek | ||
| # 27c6 Goodix Technology | ||
| # 2808 FocalTech | ||
| # 298d Next Biometrics | ||
| vendor_ids = "045e 0483 04f3 05ba 06cb 08ff 0bda 10a5 138a 147e 1c7a 2541 27c6 2808 298d" | ||
| device_ids = "*" | ||
| class_ids = "*" | ||
| priority = 5 | ||
| packages = "fprintd" | ||
| post_install = """ | ||
| systemctl enable fprintd.service | ||
| mkdir -p /etc/pam.d/sudo.d | ||
| echo 'auth sufficient pam_fprintd.so' > /etc/pam.d/sudo.d/50-fprintd.conf | ||
|
||
| """ | ||
| post_remove = """ | ||
| systemctl disable fprintd.service | ||
| rm -f /etc/pam.d/sudo.d/50-fprintd.conf | ||
| """ | ||
| Original file line number | Diff line number | Diff line change | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -31,8 +31,11 @@ pub struct Data { | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| pub sync_package_manager_database: bool, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| pub is_ai_sdk_target: bool, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| pub pci_devices: ListOfDevicesT, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| pub installed_profiles: ListOfProfilesT, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| pub all_profiles: ListOfProfilesT, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| pub usb_devices: ListOfDevicesT, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| pub installed_pci_profiles: ListOfProfilesT, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| pub installed_usb_profiles: ListOfProfilesT, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| pub all_pci_profiles: ListOfProfilesT, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| pub all_usb_profiles: ListOfProfilesT, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| pub invalid_profiles: Vec<String>, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
@@ -41,6 +44,7 @@ impl Data { | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| pub fn new(is_ai_sdk: bool) -> Self { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| let mut res = Self { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| pci_devices: fill_devices().expect("Failed to init"), | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| usb_devices: fill_usb_devices(), | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| sync_package_manager_database: true, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| is_ai_sdk_target: is_ai_sdk, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| ..Default::default() | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
@@ -50,44 +54,86 @@ impl Data { | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| res | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| /// Returns combined list of all installed profiles (PCI + USB). | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| #[must_use] | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| pub fn installed_profiles(&self) -> Vec<Profile> { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| self.installed_pci_profiles | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| .iter() | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| .chain(self.installed_usb_profiles.iter()) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| .cloned() | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| .collect() | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| /// Returns combined list of all available profiles (PCI + USB). | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| #[must_use] | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| pub fn all_profiles(&self) -> Vec<Profile> { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| self.all_pci_profiles.iter().chain(self.all_usb_profiles.iter()).cloned().collect() | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Comment on lines
+60
to
+70
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| self.installed_pci_profiles | |
| .iter() | |
| .chain(self.installed_usb_profiles.iter()) | |
| .cloned() | |
| .collect() | |
| } | |
| /// Returns combined list of all available profiles (PCI + USB). | |
| #[must_use] | |
| pub fn all_profiles(&self) -> Vec<Profile> { | |
| self.all_pci_profiles.iter().chain(self.all_usb_profiles.iter()).cloned().collect() | |
| let mut profiles: Vec<Profile> = self | |
| .installed_pci_profiles | |
| .iter() | |
| .chain(self.installed_usb_profiles.iter()) | |
| .cloned() | |
| .collect(); | |
| // Preserve global ordering by sorting by descending priority, | |
| // and then by name as a stable secondary key. | |
| profiles.sort_by(|a, b| { | |
| b.priority | |
| .cmp(&a.priority) | |
| .then_with(|| a.name.cmp(&b.name)) | |
| }); | |
| profiles | |
| } | |
| /// Returns combined list of all available profiles (PCI + USB). | |
| #[must_use] | |
| pub fn all_profiles(&self) -> Vec<Profile> { | |
| let mut profiles: Vec<Profile> = self | |
| .all_pci_profiles | |
| .iter() | |
| .chain(self.all_usb_profiles.iter()) | |
| .cloned() | |
| .collect(); | |
| // Preserve global ordering by sorting by descending priority, | |
| // and then by name as a stable secondary key. | |
| profiles.sort_by(|a, b| { | |
| b.priority | |
| .cmp(&a.priority) | |
| .then_with(|| a.name.cmp(&b.name)) | |
| }); | |
| profiles |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
New/renamed Fluent message IDs were introduced here (e.g.,
installed-profiles,no-installed-profiles,all-usb-profiles,usb-profiles-not-found). Other locale files under i18n/* still only define the old PCI-specific keys, so non-English locales will fall back to English for these messages. Consider updating other translations (or adding backward-compatible aliases) to keep localization coverage complete.