Buildroot Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Jarkko Sakkinen <jarkko@kernel.org>
To: buildroot@buildroot.org
Cc: Jarkko Sakkinen <jarkko@kernel.org>,
	Stefan Berger <stefanb@linux.ibm.com>
Subject: [Buildroot] [PATCH RFC 2/2] package/swtpm: add host package
Date: Thu, 21 Mar 2024 20:21:26 +0200	[thread overview]
Message-ID: <20240321182126.24115-3-jarkko@kernel.org> (raw)
In-Reply-To: <20240321182126.24115-1-jarkko@kernel.org>

Add swtpm and its dependency libtpms to host packages. These are useful
for emulating TPM in QEMU environment.

Link: https://gitlab.com/jarkkojs/linux-tpmdd-test
Signed-off-by: Jarkko Sakkinen <jarkko@kernel.org>
---
 package/libtpms/Config.in                     |  9 ++++
 package/libtpms/libtpms.hash                  |  1 +
 package/libtpms/libtpms.mk                    | 15 ++++++
 .../0001-comment-out-expect-and-socat.patch   | 46 +++++++++++++++++++
 package/swtpm/Config.host.in                  |  8 ++++
 package/swtpm/swtpm.hash                      |  1 +
 package/swtpm/swtpm.mk                        | 17 +++++++
 7 files changed, 97 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/0001-comment-out-expect-and-socat.patch
 create mode 100644 package/swtpm/Config.host.in
 create mode 100644 package/swtpm/swtpm.hash
 create mode 100644 package/swtpm/swtpm.mk

diff --git a/package/libtpms/Config.in b/package/libtpms/Config.in
new file mode 100644
index 0000000000..7ef61cf53c
--- /dev/null
+++ b/package/libtpms/Config.in
@@ -0,0 +1,9 @@
+config BR2_PACKAGE_LIBTPMS
+	bool "libtpms"
+        depends on BR2_USE_WCHAR # glib2
+        depends on BR2_TOOLCHAIN_HAS_THREADS # glib2
+        depends on BR2_USE_MMU # glib2
+	help
+	  TPM emulation library
+
+	  https://github.com/stefanberger/libtpms
diff --git a/package/libtpms/libtpms.hash b/package/libtpms/libtpms.hash
new file mode 100644
index 0000000000..c31d824af6
--- /dev/null
+++ b/package/libtpms/libtpms.hash
@@ -0,0 +1 @@
+sha256  2807466f1563ebe45fdd12dd26e501e8a0c4fbb99c7c428fbb508789efd221c0  v0.9.6.tar.gz
diff --git a/package/libtpms/libtpms.mk b/package/libtpms/libtpms.mk
new file mode 100644
index 0000000000..5b1151baff
--- /dev/null
+++ b/package/libtpms/libtpms.mk
@@ -0,0 +1,15 @@
+################################################################################
+#
+# libtpms
+#
+################################################################################
+
+LIBTPMS_VERSION = v0.9.6
+LIBTPMS_SOURCE = $(LIBTPMS_VERSION).tar.gz
+LIBTPMS_SITE = $(call github,stefanberger,libtpms,$(LIBTPMS_VERSION))
+LIBTPMS_LICENSE = BSD-3-Clause
+LIBTPMS_INSTALL_STAGING = YES
+LIBTPMS_AUTORECONF = YES
+
+$(eval $(autotools-package))
+$(eval $(host-autotools-package))
diff --git a/package/swtpm/0001-comment-out-expect-and-socat.patch b/package/swtpm/0001-comment-out-expect-and-socat.patch
new file mode 100644
index 0000000000..09dcc49a7b
--- /dev/null
+++ b/package/swtpm/0001-comment-out-expect-and-socat.patch
@@ -0,0 +1,46 @@
+From 067c32ba93774b273de9af872b5587798dcabb15 Mon Sep 17 00:00:00 2001
+From: Jarkko Sakkinen <jarkko@kernel.org>
+Date: Tue, 19 Dec 2023 05:21:20 +0200
+Subject: [PATCH] configure.ac: comment out "expect" and "socat"
+
+Signed-off-by: Jarkko Sakkinen <jarkko@kernel.org>
+---
+ configure.ac | 16 ++++++++--------
+ 1 file changed, 8 insertions(+), 8 deletions(-)
+
+diff --git a/configure.ac b/configure.ac
+index 49caf96..4acc763 100644
+--- a/configure.ac
++++ b/configure.ac
+@@ -394,20 +394,20 @@ AS_IF([test "x$enable_default_pcr_banks" != "x"],[
+ pcr_bank_checks
+ AC_SUBST([DEFAULT_PCR_BANKS])
+ 
+-AC_PATH_PROG([EXPECT], expect)
+-if test "x$EXPECT" = "x"; then
+-	AC_MSG_ERROR([expect is required: expect package])
+-fi
++# AC_PATH_PROG([EXPECT], expect)
++# if test "x$EXPECT" = "x"; then
++# 	AC_MSG_ERROR([expect is required: expect package])
++# fi
+ 
+ AC_PATH_PROG([GAWK], gawk)
+ if test "x$GAWK" = "x"; then
+ 	AC_MSG_ERROR([gawk is required: gawk package])
+ fi
+ 
+-AC_PATH_PROG([SOCAT], socat)
+-if test "x$SOCAT" = "x"; then
+-	AC_MSG_ERROR([socat is required: socat package])
+-fi
++# AC_PATH_PROG([SOCAT], socat)
++# if test "x$SOCAT" = "x"; then
++# 	AC_MSG_ERROR([socat is required: socat package])
++# fi
+ 
+ AC_PATH_PROG([BASE64], base64)
+ if test "x$BASE64" = "x"; then
+-- 
+2.40.1
+
diff --git a/package/swtpm/Config.host.in b/package/swtpm/Config.host.in
new file mode 100644
index 0000000000..e77eea2aa5
--- /dev/null
+++ b/package/swtpm/Config.host.in
@@ -0,0 +1,8 @@
+config BR2_PACKAGE_HOST_SWTPM
+	bool "swtpm-host"
+	depends on BR2_PACKAGE_GOBJECT_INTROSPECTION_ARCH_SUPPORTS # gobject-introspection
+	select BR2_PACKAGE_GOBJECT_INTROSPECTION
+	help
+	  Compiles SWTPM software TPM emulator for the host.
+
+	  https://github.com/stefanberger/swtpm
diff --git a/package/swtpm/swtpm.hash b/package/swtpm/swtpm.hash
new file mode 100644
index 0000000000..882f06d7a5
--- /dev/null
+++ b/package/swtpm/swtpm.hash
@@ -0,0 +1 @@
+sha256 7bba52aa41090f75087034fac5fe8daed10c3e7e7234df7c9558849318927f41  v0.8.1.tar.gz
diff --git a/package/swtpm/swtpm.mk b/package/swtpm/swtpm.mk
new file mode 100644
index 0000000000..79fbf1f420
--- /dev/null
+++ b/package/swtpm/swtpm.mk
@@ -0,0 +1,17 @@
+################################################################################
+#
+# swtpm
+#
+################################################################################
+
+SWTPM_VERSION = v0.8.1
+SWTPM_SOURCE = $(SWTPM_VERSION).tar.gz
+SWTPM_SITE = $(call github,stefanberger,swtpm,$(SWTPM_VERSION))
+SWTPM_LICENSE = BSD-3-Clause
+SWTPM_AUTORECONF = YES
+
+HOST_SWTPM_DEPENDENCIES = host-libtasn1 host-openssl host-pkgconf host-json-glib host-libtpms
+HOST_SWTPM_CONF_ENV = PKG_CONFIG="$(PKG_CONFIG_HOST_BINARY)"
+HOST_SWTPM_CONF_OPTS = --without-seccomp
+
+$(eval $(host-autotools-package))
-- 
2.43.0

_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot

  parent reply	other threads:[~2024-03-21 18:21 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-03-21 18:21 [Buildroot] [PATCH RFC 0/2] Add swtpm to host packages Jarkko Sakkinen
2024-03-21 18:21 ` [Buildroot] [PATCH RFC 1/2] package/json-glib: add host build Jarkko Sakkinen
2024-03-21 18:21 ` Jarkko Sakkinen [this message]
     [not found]   ` <be88778f-53fc-493b-829a-2434ea0782ef@linux.ibm.com>
2024-03-22  8:22     ` [Buildroot] [PATCH RFC 2/2] package/swtpm: add host package Jarkko Sakkinen
2024-03-22  8:35       ` Jarkko Sakkinen
2024-03-22  9:00         ` Jarkko Sakkinen
     [not found]           ` <72dda3ce-5cf6-4830-9f18-30a64a01af15@linux.ibm.com>
2024-03-22 15:11             ` Jarkko Sakkinen
     [not found]               ` <267dc37d-86aa-407f-96e0-5be4d2464b13@linux.ibm.com>
2024-03-22 16:46                 ` Jarkko Sakkinen
     [not found]                   ` <baa6bac2-394c-4dee-ac2b-65c3aebddd20@linux.ibm.com>
2024-03-23 19:01                     ` Jarkko Sakkinen
2024-03-22 20:47   ` Arnout Vandecappelle via buildroot
2024-03-23 18:52     ` Jarkko Sakkinen
2024-03-26 15:08     ` Peter Korsgaard
2024-03-26 17:06       ` Jarkko Sakkinen

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20240321182126.24115-3-jarkko@kernel.org \
    --to=jarkko@kernel.org \
    --cc=buildroot@buildroot.org \
    --cc=stefanb@linux.ibm.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox