From fc8d547642808be3aee9a9a01cf1c85add2460b3 Mon Sep 17 00:00:00 2001 From: Lennart Poettering Date: Tue, 5 May 2026 12:43:42 +0200 Subject: [PATCH] udev-builtin-tpm2-id: gracefully skip tpm2 identification if tss2-libs are not installed Fixes: #41714 --- src/udev/udev-builtin-tpm2_id.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/udev/udev-builtin-tpm2_id.c b/src/udev/udev-builtin-tpm2_id.c index 6edf618e11..968677a734 100644 --- a/src/udev/udev-builtin-tpm2_id.c +++ b/src/udev/udev-builtin-tpm2_id.c @@ -1,6 +1,7 @@ /* SPDX-License-Identifier: GPL-2.0-or-later */ #include "device-util.h" +#include "errno-util.h" #include "string-util.h" #include "tpm2-util.h" #include "udev-builtin.h" @@ -20,6 +21,10 @@ static int builtin_tpm2_id(UdevEvent *event, int argc, char *argv[]) { _cleanup_(tpm2_context_unrefp) Tpm2Context *c = NULL; r = tpm2_context_new(dn, &c); + if (ERRNO_IS_NEG_NOT_SUPPORTED(r)) { + log_device_debug_errno(dev, r, "Full TPM2 support is not available, skipping identification of TPM2 device '%s'.", dn); + return 0; + } if (r < 0) return log_device_error_errno(dev, r, "Failed to open device node '%s': %m", dn);