1
0
mirror of https://github.com/systemd/systemd synced 2026-04-25 16:34:50 +02:00

Compare commits

...

2 Commits

Author SHA1 Message Date
Lennart Poettering
127927b2c2 update TODO 2022-04-22 10:56:47 +02:00
Lennart Poettering
44d5dd655e tpm2-util: if we run in a container, ignore /sys/class/tpmrm/* contents 2022-04-22 10:15:21 +02:00
2 changed files with 17 additions and 6 deletions

4
TODO
View File

@ -171,6 +171,10 @@ Features:
so that we might even open up up the random seed logic to non-SecureBoot
systems?
* sd-boot: also include the hyperv "vm generation id" in the random seed hash,
to cover nicely for machine clones. It's found in the ACPI tables, which
should be easily accessible from UEFI.
* sd-boot: add menu item for shutdown? or hotkey?
* sd-device has an API to create an sd_device object from a device id, but has

View File

@ -5,6 +5,7 @@
#include "parse-util.h"
#include "stat-util.h"
#include "tpm2-util.h"
#include "virt.h"
#if HAVE_TPM2
#include "alloc-util.h"
@ -1460,12 +1461,18 @@ Tpm2Support tpm2_support(void) {
Tpm2Support support = TPM2_SUPPORT_NONE;
int r;
r = dir_is_empty("/sys/class/tpmrm");
if (r < 0) {
if (r != -ENOENT)
log_debug_errno(r, "Unable to test whether /sys/class/tpmrm/ exists and is populated, assuming it is not: %m");
} else if (r == 0) /* populated! */
support |= TPM2_SUPPORT_DRIVER;
if (detect_container() <= 0) {
/* Check if there's a /dev/tpmrm* device via sysfs. If we run in a container we likely just
* got the host sysfs mounted. Since devices are generally not virtualized for containers,
* let's assume containers never have a TPM, at least for now. */
r = dir_is_empty("/sys/class/tpmrm");
if (r < 0) {
if (r != -ENOENT)
log_debug_errno(r, "Unable to test whether /sys/class/tpmrm/ exists and is populated, assuming it is not: %m");
} else if (r == 0) /* populated! */
support |= TPM2_SUPPORT_DRIVER;
}
if (efi_has_tpm2())
support |= TPM2_SUPPORT_FIRMWARE;