Device access
The TPM is accessible via/dev/tpm0 (raw) and /dev/tpmrm0 (resource-managed). The resource manager is preferred for userspace applications as it handles context saving automatically.
| Interface | Kernel driver | Typical use |
|---|---|---|
| SPI | tpm_tis_spi | Most external TPM modules |
| I2C | tpm_tis_i2c | Low-pin-count designs |
| I2C userspace | i2c-dev | Debugging and custom tooling |
The CM5 does not have an onboard TPM. An external module must be connected to the SPI or I2C header on the Exaviz Cruiser carrier board.
Udev rule
The udev rule for the TPM device node sets group ownership totss and tags the device for systemd dependency tracking:
/etc/udev/rules.d/99-tpm.rules
tpm.sh bring-up script
tpm.sh handles the case where the SPI driver is not loaded automatically. It force-loads spi_bcm2835 and tpm_tis_spi, then blocks until /dev/tpm0 appears (with a 5-second timeout).
tpm.sh
ExecStartPre command in any service that depends on the TPM:
Dracut module: 90exaviz
The 90exaviz dracut module embeds TPM, AI accelerator, and PoE bring-up tooling into the initramfs. It ensures the I2C and TPM drivers are available in the early boot environment.
90exaviz/module-setup.sh
Kernel modules included
| Module | Purpose |
|---|---|
tpm_tis_spi | TPM 2.0 over SPI (TIS interface) |
tpm_tis_i2c | TPM 2.0 over I2C (TIS interface) |
i2c-dev | I2C userspace device access |
hostonly='' forces these modules to be included regardless of whether they are detected on the build host. This is necessary when building the initramfs in a chroot or QEMU environment that does not have the TPM hardware present.
Install the module:
zentyal-tpm-wait.service
zentyal-tpm-wait.service gates Samba AD DC and slapd startup on the TPM being present and readable. It reads PCR banks 0 and 7 to confirm the TPM is operational before LDAP services start.
zentyal-tpm-wait.service
ConditionPathExists=/dev/tpm0 means the service is skipped silently if the TPM is absent. On systems without a TPM, slapd and samba-ad-dc start normally without the PCR read gate.PCR values
tpm2_pcrread sha256:0,7 reads two specific PCR banks:
| PCR | Measures |
|---|---|
| 0 | Core system firmware (UEFI) |
| 7 | Secure Boot policy and state |