summaryrefslogtreecommitdiff
path: root/src/boot/efi
diff options
context:
space:
mode:
Diffstat (limited to 'src/boot/efi')
-rw-r--r--src/boot/efi/.gitignore2
-rw-r--r--src/boot/efi/boot.c5
-rw-r--r--src/boot/efi/measure.c2
-rw-r--r--src/boot/efi/meson.build4
-rw-r--r--src/boot/efi/stub.c5
5 files changed, 7 insertions, 11 deletions
diff --git a/src/boot/efi/.gitignore b/src/boot/efi/.gitignore
deleted file mode 100644
index e193acbe12..0000000000
--- a/src/boot/efi/.gitignore
+++ /dev/null
@@ -1,2 +0,0 @@
-/systemd_boot.so
-/stub.so
diff --git a/src/boot/efi/boot.c b/src/boot/efi/boot.c
index 1e990b3825..12176f1fe0 100644
--- a/src/boot/efi/boot.c
+++ b/src/boot/efi/boot.c
@@ -1650,15 +1650,14 @@ static EFI_STATUS image_start(EFI_HANDLE parent_image, const Config *config, con
loaded_image->LoadOptions = options;
loaded_image->LoadOptionsSize = (StrLen(loaded_image->LoadOptions)+1) * sizeof(CHAR16);
-#ifdef SD_BOOT_LOG_TPM
+#if ENABLE_TPM
/* Try to log any options to the TPM, especially to catch manually edited options */
err = tpm_log_event(SD_TPM_PCR,
(EFI_PHYSICAL_ADDRESS) loaded_image->LoadOptions,
loaded_image->LoadOptionsSize, loaded_image->LoadOptions);
if (EFI_ERROR(err)) {
Print(L"Unable to add image options measurement: %r", err);
- uefi_call_wrapper(BS->Stall, 1, 3 * 1000 * 1000);
- return err;
+ uefi_call_wrapper(BS->Stall, 1, 200 * 1000);
}
#endif
}
diff --git a/src/boot/efi/measure.c b/src/boot/efi/measure.c
index b22d37b62d..324d1c8b9e 100644
--- a/src/boot/efi/measure.c
+++ b/src/boot/efi/measure.c
@@ -11,7 +11,7 @@
*
*/
-#ifdef SD_BOOT_LOG_TPM
+#if ENABLE_TPM
#include <efi.h>
#include <efilib.h>
diff --git a/src/boot/efi/meson.build b/src/boot/efi/meson.build
index 5ef5b2d20b..eb0be02977 100644
--- a/src/boot/efi/meson.build
+++ b/src/boot/efi/meson.build
@@ -30,7 +30,7 @@ stub_sources = '''
stub.c
'''.split()
-if conf.get('ENABLE_EFI', false) and get_option('gnu-efi') != 'false'
+if conf.get('ENABLE_EFI') == 1 and get_option('gnu-efi') != 'false'
efi_cc = get_option('efi-cc')
efi_ld = get_option('efi-ld')
@@ -64,7 +64,7 @@ if have_gnu_efi
efi_conf = configuration_data()
efi_conf.set_quoted('PACKAGE_VERSION', meson.project_version())
efi_conf.set_quoted('EFI_MACHINE_TYPE_NAME', EFI_MACHINE_TYPE_NAME)
- efi_conf.set('SD_BOOT_LOG_TPM', get_option('tpm'))
+ efi_conf.set10('ENABLE_TPM', get_option('tpm'))
efi_conf.set('SD_TPM_PCR', get_option('tpm-pcrindex'))
efi_config_h = configure_file(
diff --git a/src/boot/efi/stub.c b/src/boot/efi/stub.c
index bab5d46de9..e85ebf2c3f 100644
--- a/src/boot/efi/stub.c
+++ b/src/boot/efi/stub.c
@@ -87,15 +87,14 @@ EFI_STATUS efi_main(EFI_HANDLE image, EFI_SYSTEM_TABLE *sys_table) {
line[i] = options[i];
cmdline = line;
-#ifdef SD_BOOT_LOG_TPM
+#if ENABLE_TPM
/* Try to log any options to the TPM, especially manually edited options */
err = tpm_log_event(SD_TPM_PCR,
(EFI_PHYSICAL_ADDRESS) loaded_image->LoadOptions,
loaded_image->LoadOptionsSize, loaded_image->LoadOptions);
if (EFI_ERROR(err)) {
Print(L"Unable to add image options measurement: %r", err);
- uefi_call_wrapper(BS->Stall, 1, 3 * 1000 * 1000);
- return err;
+ uefi_call_wrapper(BS->Stall, 1, 200 * 1000);
}
#endif
}