diff mbox series

[4/4] package/swtpm: add host package

Message ID 20240517132039.7124-5-jarkko@kernel.org
State Changes Requested
Headers show
Series swtpm and libtpms host packages | expand

Commit Message

Jarkko Sakkinen May 17, 2024, 1:20 p.m. UTC
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.

Link: https://gitlab.com/jarkkojs/linux-tpmdd-test
Signed-off-by: Jarkko Sakkinen <jarkko@kernel.org>
---
 DEVELOPERS                   |  1 +
 package/Config.in.host       |  1 +
 package/swtpm/Config.in.host | 16 ++++++++++++++++
 package/swtpm/swtpm.hash     |  2 ++
 package/swtpm/swtpm.mk       | 17 +++++++++++++++++
 5 files changed, 37 insertions(+)
 create mode 100644 package/swtpm/Config.in.host
 create mode 100644 package/swtpm/swtpm.hash
 create mode 100644 package/swtpm/swtpm.mk

Comments

Yann E. MORIN May 17, 2024, 1:52 p.m. UTC | #1
Jarkko, All,

On 2024-05-17 16:20 +0300, Jarkko Sakkinen spake thusly:
> 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.
> 
> Link: https://gitlab.com/jarkkojs/linux-tpmdd-test
> Signed-off-by: Jarkko Sakkinen <jarkko@kernel.org>
[--SNIP--]
> diff --git a/package/swtpm/Config.in.host b/package/swtpm/Config.in.host
> new file mode 100644
> index 0000000000..264f74e458
> --- /dev/null
> +++ b/package/swtpm/Config.in.host
> @@ -0,0 +1,16 @@
> +config BR2_PACKAGE_HOST_SWTPM

This is a host package (by name, and sourced from Config.in.host), so...

> +	bool "host swtpm"
> +	select BR2_PACKAGE_JSON_GLIB
> +	select BR2_PACKAGE_LIBOPENSSL
> +	select BR2_PACKAGE_LIBTASN1
> +	select BR2_PACKAGE_LIBTOOL
> +	select BR2_PACKAGE_LIBTPMS

... it should select target packages.

Usually, unless there is a good reason, we do not expose in menuconfig,
host packages that only provide libraries used by other host packages.

[--SNIP--]
> diff --git a/package/swtpm/swtpm.mk b/package/swtpm/swtpm.mk
> new file mode 100644
> index 0000000000..29c8e37c47
> --- /dev/null
> +++ b/package/swtpm/swtpm.mk
> @@ -0,0 +1,17 @@
> +################################################################################
> +#
> +# swtpm
> +#
> +################################################################################
> +
> +SWTPM_VERSION = 0.8.2
> +SWTPM_SITE = $(call github,stefanberger,swtpm,v$(SWTPM_VERSION))
> +SWTPM_LICENSE = BSD-4-Clause
> +SWTPM_LICENSE_FILES = LICENSE
> +SWTPM_AUTORECONF = YES
> +
> +HOST_SWTPM_DEPENDENCIES = host-m4 host-libtool host-pkgconf host-json-glib \
> +			  host-libopenssl host-libtasn1 host-libtpms

Lists should be alphabetically sorted, and long lists should be one-item
per line:

HOST_SWTPM_DEPENDENCIES = \
    host-json-glib \
    host-libopenssl \
    host-libtasn1 \
    host-libtool \
    host-libtpms \
    host-m4 \
    host-pkgconf

host-m4 is usualy only required when you need to autoreconf, in which
case it is automatically pulled in (because _AUTORECONF pulls in
host-autoconf in _DEPENDENCIES, which in turns pulls in host-m4). And as
you do indeed autoreconf, there is no reason to explicitly pul it in,
unless swtpm does have explicit m4 scripts besides those in the
autotools machinery.

Regards,
Yann E. MORIN.

> +HOST_SWTPM_CONF_OPTS = --with-openssl --without-seccomp
> +
> +$(eval $(host-autotools-package))
> -- 
> 2.45.0
> 
> _______________________________________________
> buildroot mailing list
> buildroot@buildroot.org
> https://lists.buildroot.org/mailman/listinfo/buildroot
diff mbox series

Patch

diff --git a/DEVELOPERS b/DEVELOPERS
index db0dc702a8..732002f85b 100644
--- a/DEVELOPERS
+++ b/DEVELOPERS
@@ -1521,6 +1521,7 @@  F:	package/libvirt/
 N:	Jarkko Sakkinen <jarkko@kernel.org>
 F:	package/libtpms/
 F:	package/quota/
+F:	package/swtpm/
 
 N:	Jason Pruitt <jrspruitt@gmail.com>
 F:	package/librtlsdr/
diff --git a/package/Config.in.host b/package/Config.in.host
index 986b2854d0..0cf9dc3897 100644
--- a/package/Config.in.host
+++ b/package/Config.in.host
@@ -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"
diff --git a/package/swtpm/Config.in.host b/package/swtpm/Config.in.host
new file mode 100644
index 0000000000..264f74e458
--- /dev/null
+++ b/package/swtpm/Config.in.host
@@ -0,0 +1,16 @@ 
+config BR2_PACKAGE_HOST_SWTPM
+	bool "host swtpm"
+	select BR2_PACKAGE_JSON_GLIB
+	select BR2_PACKAGE_LIBOPENSSL
+	select BR2_PACKAGE_LIBTASN1
+	select BR2_PACKAGE_LIBTOOL
+	select BR2_PACKAGE_LIBTPMS
+	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
diff --git a/package/swtpm/swtpm.hash b/package/swtpm/swtpm.hash
new file mode 100644
index 0000000000..934d3b6ee0
--- /dev/null
+++ b/package/swtpm/swtpm.hash
@@ -0,0 +1,2 @@ 
+sha256  b281b4e8c39f68e1928675f788abc70072e4081152e129144359a8c5c304c06b  swtpm-0.8.2.tar.gz
+sha256  19d27d6e96d07022e5e688f75c974f1ceb9aae9e90e0fccae68666d02099cc4b  LICENSE
diff --git a/package/swtpm/swtpm.mk b/package/swtpm/swtpm.mk
new file mode 100644
index 0000000000..29c8e37c47
--- /dev/null
+++ b/package/swtpm/swtpm.mk
@@ -0,0 +1,17 @@ 
+################################################################################
+#
+# swtpm
+#
+################################################################################
+
+SWTPM_VERSION = 0.8.2
+SWTPM_SITE = $(call github,stefanberger,swtpm,v$(SWTPM_VERSION))
+SWTPM_LICENSE = BSD-4-Clause
+SWTPM_LICENSE_FILES = LICENSE
+SWTPM_AUTORECONF = YES
+
+HOST_SWTPM_DEPENDENCIES = host-m4 host-libtool host-pkgconf host-json-glib \
+			  host-libopenssl host-libtasn1 host-libtpms
+HOST_SWTPM_CONF_OPTS = --with-openssl --without-seccomp
+
+$(eval $(host-autotools-package))