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_*`
This commit is contained in:
Stig Palmquist 2021-04-27 19:21:30 +02:00
parent ba6f0e8f03
commit d7564b07c8

View File

@ -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}"
'';