tpm2-tss: upgrade 4.0.1 -> 4.1.2
These files are only needed until the changes merge upstream: https://lore.kernel.org/yocto/20240521203911.1107365-1-kunin@google.com/T/#u
Change-Id: I6d0a9bcad592f491907de4ec73ffcd12185bd1d0
Google-Bug-Id: 341374855
Tested: https://fusion2.corp.google.com/invocations/0ae4ef77-7912-4702-829a-52d833ed3319
Signed-off-by: Valentin Kunin <kunin@google.com>
diff --git a/recipes-tpm2/tpm2-tss/tpm2-tss/fixup_hosttools.patch b/recipes-tpm2/tpm2-tss/tpm2-tss/fixup_hosttools.patch
new file mode 100644
index 0000000..8822d1b
--- /dev/null
+++ b/recipes-tpm2/tpm2-tss/tpm2-tss/fixup_hosttools.patch
@@ -0,0 +1,40 @@
+From ab120a9642516cdfdae5c5b8a91e42e2c9898172 Mon Sep 17 00:00:00 2001
+From: Valentin Kunin <kunin@google.com>
+Date: Mon, 20 May 2024 21:09:27 +0000
+Subject: [PATCH] revert configure: add checks for all tools used by make
+ install
+
+Not appropriate for cross build env.
+
+Upstream-Status: Inappropriate [OE specific]
+
+Signed-off-by: Armin Kuster <akuster808@gmail.com>
+Signed-off-by: Valentin Kunin <kunin@google.com>
+---
+ configure.ac | 11 -----------
+ 1 file changed, 11 deletions(-)
+
+diff --git a/configure.ac b/configure.ac
+index eb6051ea..a52c4725 100644
+--- a/configure.ac
++++ b/configure.ac
+@@ -663,17 +663,6 @@ AM_CONDITIONAL([SYSD_SYSUSERS], [test "x$systemd_sysusers" = "xyes" && test "x$s
+ AC_CHECK_PROG(systemd_tmpfiles, systemd-tmpfiles, yes)
+ AM_CONDITIONAL([SYSD_TMPFILES], [test "x$systemd_tmpfiles" = "xyes" && test "x$tmpfilesdir" != "xno"])
+
+-# Check all tools used by make install
+-AS_IF([test "$HOSTOS" = "Linux" && test "x$systemd_sysusers" != "xyes"],
+- [ AC_CHECK_PROG(useradd, useradd, yes)
+- AC_CHECK_PROG(groupadd, groupadd, yes)
+- AC_CHECK_PROG(adduser, adduser, yes)
+- AC_CHECK_PROG(addgroup, addgroup, yes)
+- AS_IF([test "x$addgroup" != "xyes" && test "x$groupadd" != "xyes" ],
+- [AC_MSG_ERROR([addgroup or groupadd are needed.])])
+- AS_IF([test "x$adduser" != "xyes" && test "x$useradd" != "xyes" ],
+- [AC_MSG_ERROR([adduser or useradd are needed.])])])
+-
+ AC_SUBST([PATH])
+
+ dnl --------- Doxy Gen -----------------------
+--
+2.45.0.rc1.225.g2a3ae87e7f-goog
diff --git a/recipes-tpm2/tpm2-tss/tpm2-tss_4.1.2.bb b/recipes-tpm2/tpm2-tss/tpm2-tss_4.1.2.bb
new file mode 100644
index 0000000..9e68983
--- /dev/null
+++ b/recipes-tpm2/tpm2-tss/tpm2-tss_4.1.2.bb
@@ -0,0 +1,97 @@
+SUMMARY = "Software stack for TPM2."
+DESCRIPTION = "OSS implementation of the TCG TPM2 Software Stack (TSS2) "
+LICENSE = "BSD-2-Clause"
+LIC_FILES_CHKSUM = "file://LICENSE;md5=500b2e742befc3da00684d8a1d5fd9da"
+SECTION = "tpm"
+
+DEPENDS = "autoconf-archive-native libgcrypt openssl"
+
+SRC_URI = "https://github.com/tpm2-software/${BPN}/releases/download/${PV}/${BPN}-${PV}.tar.gz \
+ file://fixup_hosttools.patch \
+ "
+
+SRC_URI[sha256sum] = "6ad3ef0993cf3bc953710abed847ff727ab427b5577e812e3ad3197bbcec069e"
+
+UPSTREAM_CHECK_URI = "https://github.com/tpm2-software/${BPN}/releases"
+
+CVE_PRODUCT = "tpm2_software_stack"
+
+inherit autotools pkgconfig systemd useradd
+
+PACKAGECONFIG ??= ""
+PACKAGECONFIG[oxygen] = ",--disable-doxygen-doc, "
+PACKAGECONFIG[fapi] = "--enable-fapi,--disable-fapi,curl json-c util-linux-libuuid "
+PACKAGECONFIG[policy] = "--enable-policy,--disable-policy,json-c util-linux-libuuid "
+
+EXTRA_OECONF += "--enable-static --with-udevrulesdir=${nonarch_base_libdir}/udev/rules.d/"
+EXTRA_OECONF += "--runstatedir=/run"
+EXTRA_OECONF:remove = " --disable-static"
+
+USERADD_PACKAGES = "${PN}"
+GROUPADD_PARAM:${PN} = "--system tss"
+USERADD_PARAM:${PN} = "--system -M -d /var/lib/tpm -s /bin/false -g tss tss"
+
+do_install:append() {
+ # Remove /run as it is created on startup
+ rm -rf ${D}/run
+}
+
+PROVIDES = "${PACKAGES}"
+PACKAGES = " \
+ ${PN} \
+ ${PN}-dbg \
+ ${PN}-doc \
+ libtss2-mu \
+ libtss2-mu-dev \
+ libtss2-mu-staticdev \
+ libtss2-tcti-device \
+ libtss2-tcti-device-dev \
+ libtss2-tcti-device-staticdev \
+ libtss2-tcti-mssim \
+ libtss2-tcti-mssim-dev \
+ libtss2-tcti-mssim-staticdev \
+ libtss2 \
+ libtss2-dev \
+ libtss2-staticdev \
+"
+
+FILES:libtss2-tcti-device = "${libdir}/libtss2-tcti-device.so.*"
+FILES:libtss2-tcti-device-dev = " \
+ ${includedir}/tss2/tss2_tcti_device.h \
+ ${libdir}/pkgconfig/tss2-tcti-device.pc \
+ ${libdir}/libtss2-tcti-device.so"
+FILES:libtss2-tcti-device-staticdev = "${libdir}/libtss2-tcti-device.*a"
+
+FILES:libtss2-tcti-mssim = "${libdir}/libtss2-tcti-mssim.so.*"
+FILES:libtss2-tcti-mssim-dev = " \
+ ${includedir}/tss2/tss2_tcti_mssim.h \
+ ${libdir}/pkgconfig/tss2-tcti-mssim.pc \
+ ${libdir}/libtss2-tcti-mssim.so"
+FILES:libtss2-tcti-mssim-staticdev = "${libdir}/libtss2-tcti-mssim.*a"
+
+FILES:libtss2-mu = "${libdir}/libtss2-mu.so.*"
+FILES:libtss2-mu-dev = " \
+ ${includedir}/tss2/tss2_mu.h \
+ ${libdir}/pkgconfig/tss2-mu.pc \
+ ${libdir}/libtss2-mu.so"
+FILES:libtss2-mu-staticdev = "${libdir}/libtss2-mu.*a"
+
+FILES:libtss2 = "${libdir}/libtss2*so.*"
+FILES:libtss2-dev = " \
+ ${includedir} \
+ ${libdir}/pkgconfig \
+ ${libdir}/libtss2*so"
+FILES:libtss2-staticdev = "${libdir}/libtss*a"
+
+FILES:${PN} = "\
+ ${libdir}/udev \
+ /var/lib/tpm2-tss \
+ /var/run \
+ ${nonarch_base_libdir}/udev \
+ ${sysconfdir}/tmpfiles.d \
+ ${sysconfdir}/tpm2-tss \
+ ${sysconfdir}/sysusers.d"
+
+RDEPENDS:libtss2 = "libgcrypt"
+
+BBCLASSEXTEND = "native"