fix: we need to roll our own versions of tpm2-tools and tpm2-tss

This commit is contained in:
Lars Sjöström 2025-02-27 08:59:01 +01:00
parent 57f83bd4ac
commit aa4f69d891
No known key found for this signature in database
8 changed files with 162 additions and 3 deletions

View file

@ -26,6 +26,8 @@ stdenvNoCC.mkDerivation (finalAttrs: {
kmodBin = pkgs.kmod.out;
libbpf = pkgs.libbpf.out;
btrfs = pkgs.btrfs-progs.out;
tpm2Libs = patosPkgs.tpm2-tss.out;
tpm2Tools = patosPkgs.tpm2-tools.out;
kexec = patosPkgs.kexec.out;
builder = ./mkrootfs.sh;

View file

@ -116,6 +116,10 @@ cp -Pr ${kexec}/sbin/kexec $out/usr/bin/
cp -Pr ${btrfs}/bin/* $out/usr/bin/
cp -Pr ${btrfs}/lib/* $out/usr/lib/
### install tpm2 tools
cp -P ${tpm2Tools}/bin/* $out/usr/bin/
cp -P ${tpm2Libs}/lib/*.so* $out/usr/lib/
### install lib kmod
cp -P $kmodLibs/lib/* $out/usr/lib
cp -P $kmodBin/bin/* $out/usr/bin
@ -189,7 +193,7 @@ EOF
chmod 644 $out/etc/group
### Find and install all shared libs
find $out -type f -executable -exec ldd {} \; | awk '{print $3}' | grep -v systemd | grep -v glibc | sort -u | xargs cp -t $out/usr/lib
find $out -type f -executable -exec ldd {} \; | awk '{print $3}' | grep -v systemd | grep -v glibc | grep -v tpm2 | sort -u | xargs cp -t $out/usr/lib
find $out -type f -executable -exec chmod 755 {} \;
# FIXME: ELF patching. Is there a better way?