Working on updating libfprint to 1.90

A huge rewrite of libfprint (fingerprint reader library) has been merged and released recently. It adds supports for USB connected fingerprint readers. (Which will add support for latest ThinkPad laptops).

I’m currently working on updating the version in nixpkgs, but I’ve encountered an issue that I’m not quite sure on how I should handle.

As of today, libfprint and libfprint-thinkpad are completly bound together. But it seems that with the merged code it’s not the case anymore. For instance, the dependency to libusb can be removed, since it uses gusb instead, but I believe this change could break the thinkpad version. I’ve managed to port the 1.90 and make it work locally.

My questions are the following :

  • Should I split them in two different derivations (libfprint and libfprint-thinkpad) ?
  • If I do so, is there anything I should be aware of on the way to add new packages (even if they come from the repository itself).
  • If I do not split them, how should I handle the dependencies mismatch ?
  • Is there any guidelines I can take reference from ? I’m currently following this guide from the wiki.

This is my first time working on nixpkgs, so any advice is good to take ! :slight_smile:

EDIT : I’ve made the split (I will revert it if needed) and I have opened a pull request here. Unfortunatly, Lenovo removed the firmware upgrade required from fwupd because it was causing issues. I haven’t been able to test it. I’ve opened the pull request so it can be tested by somebody else (I will do the hardware test part as soon as the firmware is available again).

Emmmm, when would be able to ship libprint 2.0 to unstable?

Follow, we just put it on hold for the moment as we are focusing on the 20.03 release.


If you want to try it, you can fetch the derivation from the pull request, it will permit to test it against other hardware than mine.

I am having the same fingerprint reader as yours, wondering how to integrate it.

I’ve made an override locally :

  nixpkgs.config = {
    packageOverrides = super: let
      self = super.pkgs;
        fprintd = (pkgs.callPackage ./packages/fprintd.nix {
           libpam-wrapper = (pkgs.callPackage ./packages/libpam-wrapper.nix {});
        libfprint = (pkgs.callPackage ./packages/libfprint.nix {});

Then use the standard :

  services.fprintd.enable = true;

A better way to override libfprint from nixpkgs would be to use overlays (Overlays - NixOS Wiki) but I’ve never tried them yet.

Got it. Thanks very much!

It seems to be working fine. But it gave me Enroll result: enroll-failed ultimately.
I’m on X1 Carbon 7th Gen with the same model.

Got the same issue at the first try, go into your UEFI settings and force clear the device. Then retry to enroll, it should work correctly.

Clear the fingerprint reader? I will try it.

Yes, on the latest devices the fingerprints are stored and checked in the device itself, thus, the state of the device can change the way it works.

On previous devices (and previous releases) the fingerprints were stored by the system, and it was system’s responsibility match both. Now, the fingerprint is stored in the device, and it’s device responsibility to check both.

Lenovo’s latest laptops seems to have “some noise” in the device memory for some reason. Inside the UEFI options, there is a method to “reset all the fingerprints stored on the device”. After doing this manipulation, the device started to work flawlessly.

I did it twice and it failed for the same reason. Should I use libfprint-thinkpad?

libfprint-thinkpad is a fork for a quite old fingerprint reader that is not completely supported by fprintd. It has been discarded in the PR.

Do you have more logs on the error you’re encountering ?

Thanks for your explanation.
I don’t and fprintd can’t give me more information. It should work…which version of firmware of reader exactly did you install?
I have installed 10.02.3110269 for firmware

I will check it with older one.

My firmware is this one :

│ │   Device ID:           654a303a1e04fc691939521f42e5a306fdc28433
│ │   Summary:             Fingerprint reader
│ │   Current version:     10.01.3073367

I had installed the firmware from the fwupdmgr testing channel a while ago. I’ll check with latest firmware upgrades.

I flashed the 10.02.3110269 and it worked correctly for authenticating and enrolling (Enroll result: enroll-completed)

I downgraded and BIOS now can use fingerprint to auth but fprintd still fail…
It’s frustrating.

although not preferrable, we could always just have 2 versions of the library. there could be a libfprint_2, and once the ecosystem has rolled off of the old library, we can deprecate it.

libfprint2 is supporting all the devices that were supported by libfprint. On the release page they state :

While this allows installation in parallel with the 1.0 version of libfprint, we recommend installing only one, and migrating from version 1.0 to version 2.0 alongside its main consumer (fprintd).