Skip to content

Commit

Permalink
add support for tcm devices
Browse files Browse the repository at this point in the history
  • Loading branch information
chench246 authored and deepin-ci-robot committed Sep 4, 2024
1 parent 0a194a2 commit cdd7f61
Show file tree
Hide file tree
Showing 3 changed files with 50 additions and 0 deletions.
6 changes: 6 additions & 0 deletions debian/changelog
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
tpm2-abrmd (3.0.0-1.1deepin1) unstable; urgency=low

* add support for TCM devices

-- chench <[email protected]> Tue, 20 Aug 2024 21:02:02 +0800

tpm2-abrmd (3.0.0-1.1) unstable; urgency=medium

* Non-maintainer upload
Expand Down
43 changes: 43 additions & 0 deletions debian/patches/add-support-for-tcm-devices.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
From f0beb9dd436873d74ea28fc917eeeba15fdfd7f5 Mon Sep 17 00:00:00 2001
From: chench <[email protected]>
Date: Fri, 12 Apr 2024 10:04:47 +0800
Subject: [PATCH] add support for tcm devices

Change-Id: I04cf0027025d1ef630aa37a4e7c32893e8561e0e
---
dist/tpm2-abrmd.service.in | 5 +++--
src/tabrmd-defaults.h | 2 +-
2 files changed, 4 insertions(+), 3 deletions(-)

diff --git a/dist/tpm2-abrmd.service.in b/dist/tpm2-abrmd.service.in
index b0b562c..0effaa9 100644
--- a/dist/tpm2-abrmd.service.in
+++ b/dist/tpm2-abrmd.service.in
@@ -2,8 +2,9 @@
Description=TPM2 Access Broker and Resource Management Daemon
# These settings are needed when using the device TCTI. If the
# TCP mssim is used then the settings should be commented out.
-After=dev-tpm0.device
-Requires=dev-tpm0.device
+After=dev-tpm0.device dev-tcm0.device
+ConditionPathExists=|/dev/tpm0
+ConditionPathExists=|/dev/tcm0

[Service]
Type=dbus
diff --git a/src/tabrmd-defaults.h b/src/tabrmd-defaults.h
index 7387a47..0396189 100644
--- a/src/tabrmd-defaults.h
+++ b/src/tabrmd-defaults.h
@@ -16,7 +16,7 @@
#define TABRMD_ENTROPY_SRC_DEFAULT "/dev/urandom"
#define TABRMD_SESSIONS_MAX_DEFAULT 4
#define TABRMD_SESSIONS_MAX 64
-#define TABRMD_TCTI_CONF_DEFAULT "device:/dev/tpm0"
+#define TABRMD_TCTI_CONF_DEFAULT ((!access("/dev/tcm0", F_OK)) ? ("device:/dev/tcm0") : ("device:/dev/tpm0"))
#define TABRMD_TRANSIENT_MAX_DEFAULT 27
#define TABRMD_TRANSIENT_MAX 100

--
2.17.1

1 change: 1 addition & 0 deletions debian/patches/series
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
Fix-macro-warning-error-by-adding-escaped-symbol.patch
Use-dpkg-parsechangelog-to-fetch-version-instead-of-git-t.patch
add-support-for-tcm-devices.patch

0 comments on commit cdd7f61

Please sign in to comment.