For TPM-less systems it's sometimes valuable to have a fill-in software TPM running from early boot on, so that TPM-based functionality can "just work" and rely on TPM semantics, even if it's at a substantially weaker security level. This adds a wrapper around swtpm. It's a binary that chainloads swtpm but does a few preparatory steps and integrates into systemd's logic otherwise. All this is then exposed as systemd-tpm2-swtpm.service. The service is not hooked into much yet, that is added in later commits.
27 lines
914 B
Plaintext
27 lines
914 B
Plaintext
# SPDX-License-Identifier: LGPL-2.1-or-later
|
|
#
|
|
# This file is part of systemd.
|
|
#
|
|
# systemd is free software; you can redistribute it and/or modify it
|
|
# under the terms of the GNU Lesser General Public License as published by
|
|
# the Free Software Foundation; either version 2.1 of the License, or
|
|
# (at your option) any later version.
|
|
|
|
[Unit]
|
|
Description=Fallback Software TPM
|
|
Documentation=man:systemd-tpm2-swtpm.service(8)
|
|
DefaultDependencies=no
|
|
After=systemd-sysusers.service
|
|
Wants=modprobe@tpm_vtpm_proxy.service
|
|
After=modprobe@tpm_vtpm_proxy.service
|
|
Before=tpm2.target sysinit.target
|
|
|
|
[Service]
|
|
Type=notify
|
|
RuntimeDirectory=systemd/swtpm
|
|
ExecStart={{LIBEXECDIR}}/systemd-tpm2-swtpm
|
|
# Write out volatile state (so that we can read it back after the initrd transition
|
|
ExecStop=swtpm_ioctl --unix %t/systemd/swtpm/socket -v
|
|
# Initiate graceful shutdown
|
|
ExecStop=swtpm_ioctl --unix %t/systemd/swtpm/socket -s
|