mirror of
https://github.com/morgan9e/systemd
synced 2026-04-14 00:14:32 +09:00
boot: Add TPM to status info
This commit is contained in:
@@ -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");
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user