diff --git a/dist/tpm2-abrmd.service.in b/dist/tpm2-abrmd.service.in index b0b562ce..0effaa99 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 7387a470..edb3cc0a 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