Skip to contentSkip to conversation

swtpm and libtpms host packages

PATCH Superseded Jarkko Sakkinen 2 participants 7 messages May 21, 2024

v4 of 7 Superseded Latest is v7 →

lore
Share & tools
lore
#0 lore raw

v4 cover swtpm and libtpms host packages

Add swtpm and libtpms host packages.

Jarkko Sakkinen (3):
package/json-glib: add host build
package/libtpms: add host package
package/swtpm: add host package

 DEVELOPERS                     |  2 ++
 package/Config.in              |  1 +
 package/Config.in.host         |  1 +
 package/json-glib/json-glib.mk |  6 ++++++
 package/libtpms/Config.in      | 20 ++++++++++++++++++++
 package/libtpms/libtpms.hash   |  2 ++
 package/libtpms/libtpms.mk     | 18 ++++++++++++++++++
 package/swtpm/Config.in.host   | 11 +++++++++++
 package/swtpm/swtpm.hash       |  2 ++
 package/swtpm/swtpm.mk         | 24 ++++++++++++++++++++++++
 10 files changed, 87 insertions(+)
 create mode 100644 package/libtpms/Config.in
 create mode 100644 package/libtpms/libtpms.hash
 create mode 100644 package/libtpms/libtpms.mk
 create mode 100644 package/swtpm/Config.in.host
 create mode 100644 package/swtpm/swtpm.hash
 create mode 100644 package/swtpm/swtpm.mk

--
2.45.1

_______________________________________________
buildroot mailing list
[email protected]
https://lists.buildroot.org/mailman/listinfo/buildroot

#1 lore raw

PATCH v4 1/3 package/json-glib: add host build

---
v3:
- Remove host kconfig symbol.
- HOST_JSON_GLIB_CONF_OPTS = -Dintrospection=disabled v2:
- Disable GOI and NLS for the host.
- Add the missing host config.

---
 package/json-glib/json-glib.mk | 6 ++++++
 1 file changed, 6 insertions(+)
package/json-glib/json-glib.mk +6 -0
index cd53f24cee..cc9f8c9fa1 100644
@@ -18,6 +18,11 @@ JSON_GLIB_DEPENDENCIES = \
 	host-pkgconf \
 	libglib2
 
+HOST_JSON_GLIB_DEPENDENCIES = \
+	host-pkgconf \
+	host-libglib2
+HOST_JSON_GLIB_CONF_OPTS = -Dintrospection=disabled
+
 ifeq ($(BR2_PACKAGE_GOBJECT_INTROSPECTION),y)
 JSON_GLIB_CONF_OPTS += -Dintrospection=enabled
 JSON_GLIB_DEPENDENCIES += gobject-introspection
@@ -34,3 +39,4 @@ endif
 JSON_GLIB_LDFLAGS = $(TARGET_LDFLAGS) $(TARGET_NLS_LIBS)
 
 $(eval $(meson-package))
+$(eval $(host-meson-package))

--
2.45.1

_______________________________________________
buildroot mailing list
[email protected]
https://lists.buildroot.org/mailman/listinfo/buildroot

#2 lore raw

PATCH v4 2/3 package/libtpms: add host package

In reply to Jarkko Sakkinen

Libtpms is a library that targets the integration of TPM functionality into hypervisors, primarily into Qemu. Libtpms provides a very narrow public API for this purpose so that integration is possible. Only the minimum of necessary APIs are made publicly available.

---
v4:
- Changed in libtpms.mk to purely HOST_*.
v3:
- Use package deps in Kconfig as this just a library.
- DEPENDENCIES and CONF_OPTS for the host build v2:
- Use host packages in package/libtpms/Config.in.
- Select BR2_HOST_PACKAGE_LIBOPENSSL.

---
 DEVELOPERS                   |  1 +
 package/Config.in            |  1 +
 package/libtpms/Config.in    | 20 ++++++++++++++++++++
 package/libtpms/libtpms.hash |  2 ++
 package/libtpms/libtpms.mk   | 18 ++++++++++++++++++
 5 files changed, 42 insertions(+)
 create mode 100644 package/libtpms/Config.in
 create mode 100644 package/libtpms/libtpms.hash
 create mode 100644 package/libtpms/libtpms.mk
DEVELOPERS +1 -0
index 52c9b84a9d..db0dc702a8 100644
@@ -1519,6 +1519,7 @@ N:	Jared Bents <[email protected]>
 F:	package/libvirt/
 
 N:	Jarkko Sakkinen <[email protected]>
+F:	package/libtpms/
 F:	package/quota/
 
 N:	Jason Pruitt <[email protected]>
package/Config.in +1 -0
index 1b6a5b0dab..30b76349ec 100644
@@ -1569,6 +1569,7 @@ menu "Crypto"
 	source "package/libssh/Config.in"
 	source "package/libssh2/Config.in"
 	source "package/libtomcrypt/Config.in"
+	source "package/libtpms/Config.in"
 	source "package/libuecc/Config.in"
 	source "package/libxcrypt/Config.in"
 	source "package/mbedtls/Config.in"
package/libtpms/Config.in new file +20 -0
new file mode 100644
index 0000000000..335a5bc7b6
@@ -0,0 +1,20 @@
+config BR2_PACKAGE_LIBTPMS
+	bool "libtpms"
+	select BR2_PACKAGE_LIBTOOL
+	select BR2_PACKAGE_OPENSSL
+	help
+	  Libtpms is a library that targets the integration of TPM
+	  functionality into hypervisors, primarily into Qemu. Libtpms
+	  provides a very narrow public API for this purpose so that
+	  integration is possible. Only the minimum of necessary APIs
+	  are made publicly available.
+
+	  It is assumed that the user of libtpms is familiar with the
+	  concepts of the Trusted Platform Module (TPM). For the
+	  interaction with libtpms it is necessary to know how to
+	  construct valid TPM commands and to be able to parse their
+	  results. It is not within the scope of libtpms's documentation
+	  to provide background on this. See the section on references
+	  below.
+
+	  https://github.com/stefanberger/libtpms/wiki
package/libtpms/libtpms.hash new file +2 -0
new file mode 100644
index 0000000000..1026aaa4f4
@@ -0,0 +1,2 @@
+sha256  2807466f1563ebe45fdd12dd26e501e8a0c4fbb99c7c428fbb508789efd221c0  libtpms-0.9.6.tar.gz
+sha256  82f1e6bae374bb6a9d4f4596767fd33e499718d560de140fd9f3d402cc5e41fb  LICENSE
package/libtpms/libtpms.mk new file +18 -0
new file mode 100644
index 0000000000..68be1f6b44
@@ -0,0 +1,18 @@
+################################################################################
+#
+# libtpms
+#
+################################################################################
+
+LIBTPMS_VERSION = 0.9.6
+LIBTPMS_SITE = $(call github,stefanberger,libtpms,v$(LIBTPMS_VERSION))
+LIBTPMS_LICENSE = BSD-4-Clause
+LIBTPMS_LICENSE_FILES = LICENSE
+LIBTPMS_INSTALL_STAGING = YES
+
+# Straight from the git repository:
+HOST_LIBTPMS_AUTORECONF = YES
+HOST_LIBTPMS_DEPENDENCIES = host-pkgconf host-openssl
+HOST_LIBTPMS_CONF_OPTS = --with-openssl  -with-tpm2
+
+$(eval $(host-autotools-package))

--
2.45.1

_______________________________________________
buildroot mailing list
[email protected]
https://lists.buildroot.org/mailman/listinfo/buildroot

#3 lore raw

Re: [Buildroot] [PATCH v4 2/3] package/libtpms: add host package

Hi Jarkko,

Quoted 18 lines · Jarkko Sakkinen
package/Config.in +1 -0
index 1b6a5b0dab..30b76349ec 100644
@@ -1569,6 +1569,7 @@ menu "Crypto"
 	source "package/libssh/Config.in"
 	source "package/libssh2/Config.in"
 	source "package/libtomcrypt/Config.in"
+	source "package/libtpms/Config.in"
 	source "package/libuecc/Config.in"
 	source "package/libxcrypt/Config.in"
 	source "package/mbedtls/Config.in"
package/libtpms/Config.in new file +0 -0
new file mode 100644
index 0000000000..335a5bc7b6

package/libtpms/Config.in line 1

Quoted 1 line
package/libtpms/Config.in new file +1 -0
@@ -0,0 +1,20 @@
+config BR2_PACKAGE_LIBTPMS

You are not adding a target package, right? So this config symbol doesn't do anything.

baruch

Quoted 19 lines
package/libtpms/Config.in new file +19 -0
+	bool "libtpms"
+	select BR2_PACKAGE_LIBTOOL
+	select BR2_PACKAGE_OPENSSL
+	help
+	  Libtpms is a library that targets the integration of TPM
+	  functionality into hypervisors, primarily into Qemu. Libtpms
+	  provides a very narrow public API for this purpose so that
+	  integration is possible. Only the minimum of necessary APIs
+	  are made publicly available.
+
+	  It is assumed that the user of libtpms is familiar with the
+	  concepts of the Trusted Platform Module (TPM). For the
+	  interaction with libtpms it is necessary to know how to
+	  construct valid TPM commands and to be able to parse their
+	  results. It is not within the scope of libtpms's documentation
+	  to provide background on this. See the section on references
+	  below.
+
+	  https://github.com/stefanberger/libtpms/wiki
Signature · 7 lines
                                                     ~. .~   Tk Open Systems
=}------------------------------------------------ooO--U--Ooo------------{=
   - [email protected] - tel: +972.52.368.4656, http://www.tkos.co.il -
_______________________________________________
buildroot mailing list
[email protected]
https://lists.buildroot.org/mailman/listinfo/buildroot
#4 lore raw

Re: [Buildroot] [PATCH v4 2/3] package/libtpms: add host package

Quoted 17 lines · Baruch Siach

Hi Jarkko,

Quoted 14 lines · Jarkko Sakkinen
package/Config.in +1 -0
index 1b6a5b0dab..30b76349ec 100644
@@ -1569,6 +1569,7 @@ menu "Crypto"
 	source "package/libssh/Config.in"
 	source "package/libssh2/Config.in"
 	source "package/libtomcrypt/Config.in"
+	source "package/libtpms/Config.in"
 	source "package/libuecc/Config.in"
 	source "package/libxcrypt/Config.in"
 	source "package/mbedtls/Config.in"
package/libtpms/Config.in new file +0 -0
new file mode 100644
Quoted 8 lines

package/libtpms/Config.in line 1

Quoted 5 lines

index 0000000000..335a5bc7b6

package/libtpms/Config.in new file +1 -0
@@ -0,0 +1,20 @@
+config BR2_PACKAGE_LIBTPMS

You are not adding a target package, right? So this config symbol doesn't do anything.

Ugh, right. Now I need to do a check before I roll out a new version.

I think this is what I should actually do, right (diff below)? Sorry learning the process :-)

package/Config.in +0 -1
index 30b76349ec..1b6a5b0dab 100644
@@ -1569,7 +1569,6 @@ menu "Crypto"
        source "package/libssh/Config.in"
        source "package/libssh2/Config.in"
        source "package/libtomcrypt/Config.in"
-       source "package/libtpms/Config.in"
        source "package/libuecc/Config.in"
        source "package/libxcrypt/Config.in"
        source "package/mbedtls/Config.in"
package/Config.in.host +1 -0
index 0cf9dc3897..4e0dab0504 100644
@@ -57,6 +57,7 @@ menu "Host utilities"
        source "package/jsmin/Config.in.host"
        source "package/kmod/Config.in.host"
        source "package/libp11/Config.in.host"
+       source "package/libtpms/Config.in.host"
        source "package/llvm-project/lld/Config.in.host"
        source "package/lpc3250loader/Config.in.host"
        source "package/lttng-babeltrace/Config.in.host"
package/libtpms/Config.in.host renamed from package/libtpms/Config.in +1 -3
similarity index 89%
rename from package/libtpms/Config.in
rename to package/libtpms/Config.in.host
index 335a5bc7b6..7a477d21a7 100644
@@ -1,7 +1,5 @@
-config BR2_PACKAGE_LIBTPMS
+config BR2_HOST_PACKAGE_LIBTPMS
        bool "libtpms"
-       select BR2_PACKAGE_LIBTOOL
-       select BR2_PACKAGE_OPENSSL
        help
          Libtpms is a library that targets the integration of TPM
          functionality into hypervisors, primarily into Qemu. Libtpms

BR, Jarkko
_______________________________________________
buildroot mailing list
[email protected]
https://lists.buildroot.org/mailman/listinfo/buildroot

#5 lore raw

Re: [Buildroot] [PATCH v4 2/3] package/libtpms: add host package

Hi Jarkko,

[ Sorry for the dup again ]

Quoted 27 lines · Jarkko Sakkinen
Quoted 17 lines · Baruch Siach

Hi Jarkko,

Quoted 14 lines · Jarkko Sakkinen
package/Config.in +1 -0
index 1b6a5b0dab..30b76349ec 100644
@@ -1569,6 +1569,7 @@ menu "Crypto"
 	source "package/libssh/Config.in"
 	source "package/libssh2/Config.in"
 	source "package/libtomcrypt/Config.in"
+	source "package/libtpms/Config.in"
 	source "package/libuecc/Config.in"
 	source "package/libxcrypt/Config.in"
 	source "package/mbedtls/Config.in"
package/libtpms/Config.in new file +0 -0
new file mode 100644
Quoted 8 lines

package/libtpms/Config.in line 1

Quoted 5 lines

index 0000000000..335a5bc7b6

package/libtpms/Config.in new file +1 -0
@@ -0,0 +1,20 @@
+config BR2_PACKAGE_LIBTPMS

You are not adding a target package, right? So this config symbol doesn't do anything.

Quoted 4 lines

Ugh, right. Now I need to do a check before I roll out a new version.

I think this is what I should actually do, right (diff below)? Sorry learning the process :-)

We usually don't provide config symbols for host packages that are only used as dependencies of other packages. So the right thing to do is drop Config.in entirely.

baruch

Quoted 42 lines
package/Config.in +0 -1
index 30b76349ec..1b6a5b0dab 100644
@@ -1569,7 +1569,6 @@ menu "Crypto"
        source "package/libssh/Config.in"
        source "package/libssh2/Config.in"
        source "package/libtomcrypt/Config.in"
-       source "package/libtpms/Config.in"
        source "package/libuecc/Config.in"
        source "package/libxcrypt/Config.in"
        source "package/mbedtls/Config.in"
package/Config.in.host +1 -0
index 0cf9dc3897..4e0dab0504 100644
@@ -57,6 +57,7 @@ menu "Host utilities"
        source "package/jsmin/Config.in.host"
        source "package/kmod/Config.in.host"
        source "package/libp11/Config.in.host"
+       source "package/libtpms/Config.in.host"
        source "package/llvm-project/lld/Config.in.host"
        source "package/lpc3250loader/Config.in.host"
        source "package/lttng-babeltrace/Config.in.host"
package/libtpms/Config.in.host renamed from package/libtpms/Config.in +1 -3
similarity index 89%
rename from package/libtpms/Config.in
rename to package/libtpms/Config.in.host
index 335a5bc7b6..7a477d21a7 100644
@@ -1,7 +1,5 @@
-config BR2_PACKAGE_LIBTPMS
+config BR2_HOST_PACKAGE_LIBTPMS
        bool "libtpms"
-       select BR2_PACKAGE_LIBTOOL
-       select BR2_PACKAGE_OPENSSL
        help
          Libtpms is a library that targets the integration of TPM
          functionality into hypervisors, primarily into Qemu. Libtpms

BR, Jarkko

Signature · 7 lines
                                                     ~. .~   Tk Open Systems
=}------------------------------------------------ooO--U--Ooo------------{=
   - [email protected] - tel: +972.52.368.4656, http://www.tkos.co.il -
_______________________________________________
buildroot mailing list
[email protected]
https://lists.buildroot.org/mailman/listinfo/buildroot
#6 lore raw

PATCH v4 3/3 package/swtpm: add host package

In reply to Jarkko Sakkinen

The SWTPM package provides TPM emulators with different front-end interfaces to libtpms. TPM emulators provide socket interfaces (TCP/IP and Unix) and the Linux CUSE interface for the creation of multiple native /dev/vtpm* devices.

---
v3:
- Remove libtool from Config.host.in.
v2:
- Remove libraries from Config.host.in.
- Put deps line-by-line.

---
 DEVELOPERS                   |  1 +
 package/Config.in.host       |  1 +
 package/swtpm/Config.in.host | 11 +++++++++++
 package/swtpm/swtpm.hash     |  2 ++
 package/swtpm/swtpm.mk       | 24 ++++++++++++++++++++++++
 5 files changed, 39 insertions(+)
 create mode 100644 package/swtpm/Config.in.host
 create mode 100644 package/swtpm/swtpm.hash
 create mode 100644 package/swtpm/swtpm.mk
DEVELOPERS +1 -0
index db0dc702a8..732002f85b 100644
@@ -1521,6 +1521,7 @@ F:	package/libvirt/
 N:	Jarkko Sakkinen <[email protected]>
 F:	package/libtpms/
 F:	package/quota/
+F:	package/swtpm/
 
 N:	Jason Pruitt <[email protected]>
 F:	package/librtlsdr/
package/Config.in.host +1 -0
index 986b2854d0..0cf9dc3897 100644
@@ -110,6 +110,7 @@ menu "Host utilities"
 	source "package/starfive-spltool/Config.in.host"
 	source "package/sunxi-tools/Config.in.host"
 	source "package/swig/Config.in.host"
+	source "package/swtpm/Config.in.host"
 	source "package/swugenerator/Config.in.host"
 	source "package/systemd/Config.in.host"
 	source "package/tegrarcm/Config.in.host"
package/swtpm/Config.in.host new file +11 -0
new file mode 100644
index 0000000000..0dd984ff8d
@@ -0,0 +1,11 @@
+config BR2_PACKAGE_HOST_SWTPM
+	bool "host swtpm"
+	help
+	  Compiles SWTPM software TPM emulator for the host.
+
+	  The SWTPM package provides TPM emulators with different
+	  front-end interfaces to libtpms. TPM emulators provide socket
+	  interfaces (TCP/IP and Unix) and the Linux CUSE interface for
+	  the creation of multiple native /dev/vtpm* devices.
+
+	  https://github.com/stefanberger/swtpm/wiki
package/swtpm/swtpm.hash new file +2 -0
new file mode 100644
index 0000000000..934d3b6ee0
@@ -0,0 +1,2 @@
+sha256  b281b4e8c39f68e1928675f788abc70072e4081152e129144359a8c5c304c06b  swtpm-0.8.2.tar.gz
+sha256  19d27d6e96d07022e5e688f75c974f1ceb9aae9e90e0fccae68666d02099cc4b  LICENSE
package/swtpm/swtpm.mk new file +24 -0
new file mode 100644
index 0000000000..f1e42a8bef
@@ -0,0 +1,24 @@
+################################################################################
+#
+# swtpm
+#
+################################################################################
+
+SWTPM_VERSION = 0.8.2
+SWTPM_SITE = $(call github,stefanberger,swtpm,v$(SWTPM_VERSION))
+SWTPM_LICENSE = BSD-4-Clause
+SWTPM_LICENSE_FILES = LICENSE
+# Straight from the git repository:
+SWTPM_AUTORECONF = YES
+
+HOST_SWTPM_DEPENDENCIES = \
+	host-json-glib \
+	host-libopenssl \
+	host-libtasn1 \
+	host-libtool \
+	host-libtpms \
+	host-pkgconf
+
+HOST_SWTPM_CONF_OPTS = --with-openssl --without-seccomp
+
+$(eval $(host-autotools-package))

--
2.45.1

_______________________________________________
buildroot mailing list
[email protected]
https://lists.buildroot.org/mailman/listinfo/buildroot