]> git.ipfire.org Git - thirdparty/systemd.git/commit - units/meson.build
units: add a tpm2.target synchronization point and small generator that pulls in
authorLennart Poettering <lennart@poettering.net>
Fri, 24 Nov 2023 17:01:56 +0000 (18:01 +0100)
committerLennart Poettering <lennart@poettering.net>
Wed, 3 Jan 2024 12:49:02 +0000 (13:49 +0100)
commit4e1f0037b85d1b3c272e13862f44eb35844a18b1
tree4dc975d7a968241a756335a29af76efce12a358f
parent6018a27cb72d631ec70903fa37e8adfa30f86e66
units: add a tpm2.target synchronization point and small generator that pulls in

Distributions apparently only compile a subset of TPM2 drivers into the
kernel. For those not compiled it but provided as kmod we need a
synchronization point: we must wait before the first TPM2 interaction
until the driver is available and accessible.

This adds a tpm2.target unit as such a synchronization point. It's
ordered after /dev/tpmrm0, and is pulled in by a generator whenever we
detect that the kernel reported a TPM2 to exist but we have no device
for it yet.

This should solve the issue, but might create problems: if there are TPM
devices supported by firmware that we don't have Linux drivers for we'll
hang for a bit. Hence let's add a kernel cmdline switch to disable (or
alternatively force) this logic.

Fixes: #30164
19 files changed:
man/rules/meson.build
man/systemd-tpm2-generator.xml [new file with mode: 0644]
man/systemd.special.xml
rules.d/99-systemd.rules.in
src/basic/special.h
src/tpm2-setup/meson.build
src/tpm2-setup/tpm2-generator.c [new file with mode: 0644]
units/meson.build
units/systemd-pcrextend.socket
units/systemd-pcrextend@.service.in
units/systemd-pcrfs-root.service.in
units/systemd-pcrfs@.service.in
units/systemd-pcrmachine.service.in
units/systemd-pcrphase-initrd.service.in
units/systemd-pcrphase-sysinit.service.in
units/systemd-pcrphase.service.in
units/systemd-tpm2-setup-early.service.in
units/systemd-tpm2-setup.service.in
units/tpm2.target [new file with mode: 0644]