Buildroot Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Jarkko Sakkinen via buildroot <buildroot@buildroot.org>
To: buildroot@buildroot.org
Cc: Jarkko Sakkinen <jarkko@kernel.org>
Subject: [Buildroot] [PATCH] package/tpm2sh: new package tpm2sh 0.17.2
Date: Thu, 11 Jun 2026 13:54:34 +0300	[thread overview]
Message-ID: <20260611105434.3164134-1-jarkko@kernel.org> (raw)

tpm2sh is a TPM 2.0 command-line shell and troubleshooting tool for Linux
with low dependencies. It communicates directly with /dev/tpm{rm}0. It
is most useful in kernel testing.

Among other things it can be used to query and manipulate the chip
memory:

~ main
❯ tpm2sh memory
HANDLE     CLASS      DETAILS
01c00002   nv-index   rsa-2048:sha256
01c0000a   nv-index   ecc-nist-p256:sha256

~ main
❯ tpm2sh memory 01c0000a
-----BEGIN CERTIFICATE-----
[CENSORED]
-----END CERTIFICATE-----

And all this makes it also sort of useful embedded debugging tool too.

Signed-off-by: Jarkko Sakkinen <jarkko@kernel.org>
---
Sorry if I missed some detail. Tried to check but this is my first Rust
package for BR2 so anything is possible.
 package/Config.in          |  1 +
 package/tpm2sh/Config.in   | 18 ++++++++++++++++++
 package/tpm2sh/tpm2sh.hash |  2 ++
 package/tpm2sh/tpm2sh.mk   | 14 ++++++++++++++
 4 files changed, 35 insertions(+)
 create mode 100644 package/tpm2sh/Config.in
 create mode 100644 package/tpm2sh/tpm2sh.hash
 create mode 100644 package/tpm2sh/tpm2sh.mk

diff --git a/package/Config.in b/package/Config.in
index 630662477b..05b5060651 100644
--- a/package/Config.in
+++ b/package/Config.in
@@ -2888,6 +2888,7 @@ menu "System tools"
 	source "package/tpm-tools/Config.in"
 	source "package/tpm2-abrmd/Config.in"
 	source "package/tpm2-tools/Config.in"
+	source "package/tpm2sh/Config.in"
 	source "package/tpm2-totp/Config.in"
 	source "package/ugetty/Config.in"
 	source "package/unscd/Config.in"
diff --git a/package/tpm2sh/Config.in b/package/tpm2sh/Config.in
new file mode 100644
index 0000000000..5268d0df6e
--- /dev/null
+++ b/package/tpm2sh/Config.in
@@ -0,0 +1,18 @@
+config BR2_PACKAGE_TPM2SH
+	bool "tpm2sh"
+	depends on BR2_PACKAGE_HOST_RUSTC_TARGET_ARCH_SUPPORTS
+	select BR2_PACKAGE_HOST_RUSTC
+	select BR2_PACKAGE_HOST_PKGCONF
+	select BR2_PACKAGE_OPENSSL
+	select BR2_PACKAGE_OPENSSL_FORCE_LIBOPENSSL
+	select BR2_PACKAGE_LIBOPENSSL
+	help
+	  TPM 2.0 command-line interface.
+
+	  tpm2sh is a command-line interface for interacting with TPM 2.0 chips
+	  directly through /dev/tpm0 or /dev/tpmrm0.
+
+	  https://gitlab.com/tpm-protocol/tpm2sh
+
+comment "tpm2sh needs a toolchain with Rust support"
+	depends on !BR2_PACKAGE_HOST_RUSTC_TARGET_ARCH_SUPPORTS
diff --git a/package/tpm2sh/tpm2sh.hash b/package/tpm2sh/tpm2sh.hash
new file mode 100644
index 0000000000..567a7751f9
--- /dev/null
+++ b/package/tpm2sh/tpm2sh.hash
@@ -0,0 +1,2 @@
+sha256  90b557b6d6a6a8f8e2bf946edf5db18cd33b09245c11d38e8543ff0f486f6a40  tpm2sh-0.17.2-git4-cargo5.tar.gz
+sha256  3972dc9744f6499f0f9b2dbf76696f2ae7ad8af9b23dde66d6af86c9dfb36986  LICENSE
diff --git a/package/tpm2sh/tpm2sh.mk b/package/tpm2sh/tpm2sh.mk
new file mode 100644
index 0000000000..573eb88ad5
--- /dev/null
+++ b/package/tpm2sh/tpm2sh.mk
@@ -0,0 +1,14 @@
+################################################################################
+#
+# tpm2sh
+#
+################################################################################
+
+TPM2SH_VERSION = 0.17.2
+TPM2SH_SITE = https://gitlab.com/tpm-protocol/tpm2sh
+TPM2SH_SITE_METHOD = git
+TPM2SH_LICENSE = GPL-3.0-or-later
+TPM2SH_LICENSE_FILES = LICENSE
+TPM2SH_DEPENDENCIES = host-pkgconf openssl
+
+$(eval $(cargo-package))
-- 
2.47.3

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

             reply	other threads:[~2026-06-11 10:54 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-06-11 10:54 Jarkko Sakkinen via buildroot [this message]
2026-08-06 20:42 ` [Buildroot] [PATCH] package/tpm2sh: new package tpm2sh 0.17.2 Fiona Klute via buildroot
2026-08-10 15:42   ` Jarkko Sakkinen via buildroot

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=20260611105434.3164134-1-jarkko@kernel.org \
    --to=buildroot@buildroot.org \
    --cc=jarkko@kernel.org \
    /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