From f2d2fd3437ab85126c92853065a32661f044d20a Mon Sep 17 00:00:00 2001 From: Sweetbread Date: Tue, 29 Sep 2026 05:54:20 +0300 Subject: [PATCH] feat(Inaho): add fingerprint driver --- host/modules/thinkpad.nix | 237 +++++++++++++++++++++++++++++++++++++- 1 file changed, 233 insertions(+), 4 deletions(-) diff --git a/host/modules/thinkpad.nix b/host/modules/thinkpad.nix index cbcf215..121d6b0 100644 --- a/host/modules/thinkpad.nix +++ b/host/modules/thinkpad.nix @@ -1,4 +1,164 @@ -{ config, lib, pkgs, ... }: { +{ config, 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('