From 3a63f2f997b6ab20ec4e0c616b485755209fa304 Mon Sep 17 00:00:00 2001 From: Mykyta Dorokhin Date: Tue, 15 Mar 2022 19:56:21 +0200 Subject: Clone and fix tpm2-tss_2.3.2.bb so to fix incorrect usage of extrausers class instead of useradd Note: tpm2-tss_2.3.2.bbappend didn't work since meta-security is not included into at91 and mtk builds. Javing bbappend for the recipy that is not in the build triggers an error. --- recipes-tpm2/tpm2-tss/tpm2-tss_2.3.2.bb | 82 +++++++++++++++++++++++++++ recipes-tpm2/tpm2-tss/tpm2-tss_2.3.2.bbappend | 24 -------- 2 files changed, 82 insertions(+), 24 deletions(-) create mode 100644 recipes-tpm2/tpm2-tss/tpm2-tss_2.3.2.bb delete mode 100644 recipes-tpm2/tpm2-tss/tpm2-tss_2.3.2.bbappend (limited to 'recipes-tpm2') diff --git a/recipes-tpm2/tpm2-tss/tpm2-tss_2.3.2.bb b/recipes-tpm2/tpm2-tss/tpm2-tss_2.3.2.bb new file mode 100644 index 0000000..d39879f --- /dev/null +++ b/recipes-tpm2/tpm2-tss/tpm2-tss_2.3.2.bb @@ -0,0 +1,82 @@ +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" + +PR= "m1" + +DEPENDS = "autoconf-archive-native libgcrypt openssl" + +SRCREV = "a99e733ba66c359502689a9c42fd5e02ed1dd7d6" + +SRC_URI = "https://github.com/tpm2-software/${BPN}/releases/download/${PV}/${BPN}-${PV}.tar.gz" +SRC_URI[md5sum] = "fb7e6d371959a65dc6d129af81739742" +SRC_URI[sha256sum] = "82929a0611f39246e09202702a61b54c980ab694626c1f5823520ddf75024fa6" +SRC_URI[sha1sum] = "c24ce8b20a8686ada775239389292f6d78020668" +SRC_URI[sha384sum] = "a0c023c024efb6c9906df1e143d692f44433de332b616dc0584c9b4cd4fb0ad544308f291892e91c5a52ef1a4b2abf7f" +SRC_URI[sha512sum] = "7b679b54f3478c3adee5b6c3135cbe491ffd9f4712991f465edbd6c7d2831e5f1537038ec36f288e9545c719d5d167b61116c924cf5d816220615d0b58a1d436" + +inherit autotools pkgconfig systemd useradd + +PACKAGECONFIG ??= "" +PACKAGECONFIG[oxygen] = ",--disable-doxygen-doc, " + +EXTRA_OECONF += "--enable-static --with-udevrulesdir=${base_prefix}/lib/udev/rules.d/" +EXTRA_OECONF_remove = " --disable-static" + +# These are useradd bbclass values +USERADD_PACKAGES = "${PN}" +GROUPADD_PARAM_${PN} = "--system tss" +USERADD_PARAM_${PN} = "--system -M -d /var/lib/tpm -s /bin/false -g tss tss" + +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 ${base_prefix}/lib/udev" + +RDEPENDS_libtss2 = "libgcrypt" diff --git a/recipes-tpm2/tpm2-tss/tpm2-tss_2.3.2.bbappend b/recipes-tpm2/tpm2-tss/tpm2-tss_2.3.2.bbappend deleted file mode 100644 index 56c16c2..0000000 --- a/recipes-tpm2/tpm2-tss/tpm2-tss_2.3.2.bbappend +++ /dev/null @@ -1,24 +0,0 @@ -inherit useradd - -# -# Incorrect usage of extrausers class instead of useradd class in tpm2-tss_2.3.2.bb recipe leads to the folowing: -# -# bash# cat /etc/group | grep 1000 -# tss:x:1000: -# admin:x:1000: -# -# bash# cat /etc/passwd | grep 1000 -# tss:x:999:1000::/var/lib/tpm:/bin/false -# admin:x:1000:1000:admin:/home/admin:/bin/bash -# -# Fixed in mainline yocto: -# https://git.yoctoproject.org/meta-security/commit/meta-tpm/recipes-tpm2/tpm2-tss/tpm2-tss_3.1.0.bb?id=da23c2a094b2e1a87da2932552ec96c0f842a639 -# - -# base recipe inherits extrausers. There is nothing we can do to remove this. So use empty values. -EXTRA_USERS_PARAMS = "" - -# These are useradd bbclass values -USERADD_PACKAGES = "${PN}" -GROUPADD_PARAM_${PN} = "--system tss" -USERADD_PARAM_${PN} = "--system -M -d /var/lib/tpm -s /bin/false -g tss tss" -- cgit v1.2.3