From e2d2ce6c6cac78620936b7a3c9e0208185ffb2af Mon Sep 17 00:00:00 2001 From: Kirill Date: Wed, 21 Oct 2026 11:29:54 +0300 Subject: [PATCH] feat(fprint): update fprint to new device --- host/ThinkPad/modules/fingerprint.nix | 246 ++++++++++++++++++++++++-- host/ThinkPad/modules/thinkpad.nix | 1 - 2 files changed, 230 insertions(+), 17 deletions(-) diff --git a/host/ThinkPad/modules/fingerprint.nix b/host/ThinkPad/modules/fingerprint.nix index b648292..58f0133 100644 --- a/host/ThinkPad/modules/fingerprint.nix +++ b/host/ThinkPad/modules/fingerprint.nix @@ -1,20 +1,234 @@ -{ config, ... }: { - services.fprintd.enable = true; +{ lib, pkgs, ... }: let + pythonValidityPatch = pkgs.writeText "python-validity-python-3.14.patch" '' + diff --git a/validitysensor/flash.py b/validitysensor/flash.py + index d37f15a..be3d4a1 100644 + --- a/validitysensor/flash.py + +++ b/validitysensor/flash.py + @@ -34,6 +34,10 @@ def get_flash_info(): + rsp = tls.cmd(unhex('3e')) + assert_status(rsp) + rsp = rsp[2:] + + if len(rsp) < 0xe: + + # An uninitialised 06cb:009a returns only the success status word. + + # Let init_flash() format it instead of failing in struct.unpack(). + + return FlashInfo(None, 0, 0, 0, 0, []) + hdr = rsp[:0xe] + rsp = rsp[0xe:] + jid0, jid1, blocks, unknown0, blocksize, unknown1, pcnt = unpack('