boot: Add TPM to status info

This commit is contained in:
Jan Janssen
2022-01-07 11:09:08 +01:00
parent 578fe556df
commit a87e9cd79f
3 changed files with 9 additions and 0 deletions

View File

@@ -461,6 +461,7 @@ static void print_status(Config *config, CHAR16 *loaded_image_path) {
Print(L" OS indications: %lu\n", get_os_indications_supported());
Print(L" secure boot: %s (%s)\n", yes_no(IN_SET(secure, SECURE_BOOT_USER, SECURE_BOOT_DEPLOYED)), secure_boot_mode_to_string(secure));
ps_bool(L" shim: %s\n", shim_loaded());
ps_bool(L" TPM: %s\n", tpm_present());
Print(L" console mode: %d/%d (%lu x %lu)\n", ST->ConOut->Mode->Mode, ST->ConOut->Mode->MaxMode - 1LL, x_max, y_max);
Print(L"\n--- Press any key to continue. ---\n\n");

View File

@@ -135,6 +135,10 @@ static EFI_TCG2 * tcg2_interface_check(void) {
return tcg;
}
BOOLEAN tpm_present(void) {
return tcg2_interface_check() || tcg1_interface_check();
}
EFI_STATUS tpm_log_event(UINT32 pcrindex, const EFI_PHYSICAL_ADDRESS buffer, UINTN buffer_size, const CHAR16 *description) {
EFI_TCG *tpm1;
EFI_TCG2 *tpm2;

View File

@@ -5,11 +5,15 @@
#if ENABLE_TPM
BOOLEAN tpm_present(void);
EFI_STATUS tpm_log_event(UINT32 pcrindex, const EFI_PHYSICAL_ADDRESS buffer, UINTN buffer_size, const CHAR16 *description);
EFI_STATUS tpm_log_load_options(const CHAR16 *cmdline);
#else
static inline BOOLEAN tpm_present(void) {
return FALSE;
}
static inline EFI_STATUS tpm_log_event(UINT32 pcrindex, const EFI_PHYSICAL_ADDRESS buffer, UINTN buffer_size, const CHAR16 *description) {
return EFI_SUCCESS;
}