Skip to content

leopalladium/focaltech-ft9366-arch-shim

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

focaltech-ft9366-arch-shim

A compatibility shim and patched proprietary driver for FocalTech FT9366 fingerprint sensors (2808:a658) on modern Linux distributions (Arch, Fedora, NixOS).

This repository provides a working driver and a compatibility layer for FocalTech fingerprint sensors (USB ID 2808:a658), commonly found in ASUS and other modern laptops.

While the original proprietary driver was built for legacy versions of Ubuntu/Debian, this project enables it to run on modern, rolling-release distributions like Arch Linux, Fedora, and NixOS by resolving binary compatibility issues with libgusb.


Special thanks

⚠️ The Problem

The proprietary driver binary (libfprint-2.so.2.0.0) was compiled against libgusb version 0.1.0. Modern Linux systems use libgusb 0.4.x+, which has removed several legacy functions and changed symbol versioning.

Without a fix, the fprintd service fails with the following error:

symbol lookup error: undefined symbol: g_usb_device_get_interfaces, version LIBGUSB_0.1.0

🛠 The Solution: Proxy-Shim

Instead of downgrading critical system libraries, this repository uses a Proxy-Shim approach:

  1. Compatibility Layer: We compile a micro-library (focaltech-shim.so) that masquerades as the old LIBGUSB_0.1.0.
  2. Dynamic Redirection: The shim intercepts calls from the proprietary driver and redirects them to the modern libgusb.so.2 functions already present in your system using dlsym.
  3. Binary Patching: We use patchelf to inject this shim as a hard dependency into the driver binary, ensuring the system loader finds our symbols first.

Installation Instructions

1. Install Dependencies

Ensure you have the necessary tools for compilation and binary patching:

Arch Linux:

sudo pacman -S fprintd libfprint gcc pkgconf libgusb patchelf

2. Prepare the Compatibility Shim

The shim.c source code and shim.map provided in this repository are required.

# Compile the shim with the required version script
gcc -shared -fPIC -Wl,--version-script=shim.map -o focaltech-shim.so shim.c $(pkg-config --cflags --libs glib-2.0) -ldl

3. Deploy and Patch the Driver

# Move the driver and shim to system library paths
sudo cp libfprint-2.so.2.0.0 /usr/lib/
sudo cp focaltech-shim.so /usr/lib/

# Inject the shim as a dependency into the proprietary driver
sudo patchelf --add-needed focaltech-shim.so /usr/lib/libfprint-2.so.2.0.0

# Install udev rules to allow fprintd to access the USB device
sudo cp 60-libfprint-2.rules /etc/udev/rules.d/
sudo udevadm control --reload-rules && sudo udevadm trigger

4. Fix USB Autosuspend (Crucial)

FocalTech sensors often fail to initialize because the Linux kernel puts them into power-saving mode too quickly. You must create a persistent udev rule to keep the sensor powered.

Create /etc/udev/rules.d/80-focaltech-fix.rules:


ACTION=="add", SUBSYSTEM=="usb", ATTR{idVendor}=="2808", ATTR{idProduct}=="a658", ATTR{power/control}="on", ATTR{power/autosuspend}="-1"

5. Enroll Your Fingerprint

Restart the service and start the enrollment process:

sudo systemctl restart fprintd
fprintd-enroll

Pro Tip: If the command fails on the first try, keep your finger pressed firmly on the sensor before and while running the command to ensure the hardware stays awake during initialization.

Files in this Repository

  • libfprint-2.so.2.0.0: The proprietary driver binary.
  • shim.c: The C source code for the Proxy-Shim layer.
  • shim.map: Linker script defining the LIBGUSB_0.1.0 symbol versions.
  • 60-libfprint-2.rules: Hardware access rules for udev.

Post-Installation

To use your fingerprint for sudo or login, add the following line to your /etc/pam.d/system-auth (Arch) or /etc/pam.d/common-auth (Ubuntu) file:


auth      sufficient pam_fprintd.so

Disclaimer: This driver is proprietary software owned by FocalTech/Asus. This repository is provided for interoperability purposes only. Use at your own risk.

About

A compatibility shim and patched proprietary driver for FocalTech FT9366 fingerprint sensors (2808:a658) on modern Linux distributions (Arch, Fedora, NixOS).

Topics

Resources

License

Stars

Watchers

Forks

Contributors

Languages