From d7564b07c83a0817f42d4ba25c0cd7f9f1bdb778 Mon Sep 17 00:00:00 2001 From: Stig Palmquist Date: Tue, 27 Apr 2021 19:21:30 +0200 Subject: [PATCH] tpm2-tools: remove nested wrappers symlinks like `tpm2_createprimary -> tpm2` were wrapped, causing argv0 issues due to double wrapping: $ tpm2_ptool init [..] RuntimeError: Could not execute tpm2_createprimary: b'ERROR: /nix/store/[..]/bin/.tpm2_createprimary-wrapped: unknown tool. This patch only wraps the `tpm2` and `tss2` executables, and not the symlinks to them `tpm2_*` and `tss2_*` --- pkgs/tools/security/tpm2-tools/default.nix | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/pkgs/tools/security/tpm2-tools/default.nix b/pkgs/tools/security/tpm2-tools/default.nix index 73368f40476d..52964b620ddf 100644 --- a/pkgs/tools/security/tpm2-tools/default.nix +++ b/pkgs/tools/security/tpm2-tools/default.nix @@ -21,10 +21,8 @@ stdenv.mkDerivation rec { tpm2-tss ] ++ (lib.optional abrmdSupport tpm2-abrmd)); in '' - for bin in $out/bin/*; do - wrapProgram $bin \ - --suffix LD_LIBRARY_PATH : "${ldLibraryPath}" - done + wrapProgram $out/bin/tpm2 --suffix LD_LIBRARY_PATH : "${ldLibraryPath}" + wrapProgram $out/bin/tss2 --suffix LD_LIBRARY_PATH : "${ldLibraryPath}" '';