From: Jan Kiszka <[email protected]>

This allows to start on platforms that have no drivers with out issuing
a warning. We now fail if there are no drivers, AND a non-zero timeout
was specified.

If we have drivers and the timeout is set to zero, we keep on issueing a
warning.

Signed-off-by: Jan Kiszka <[email protected]>
---
 main.c | 21 ++++++++++++---------
 1 file changed, 12 insertions(+), 9 deletions(-)

diff --git a/main.c b/main.c
index a50bd05..4787c86 100644
--- a/main.c
+++ b/main.c
@@ -33,8 +33,15 @@ extern CHAR16 *boot_medium_path;
 static EFI_STATUS probe_watchdogs(EFI_LOADED_IMAGE *loaded_image, UINTN 
timeout)
 {
        if (init_array_end - init_array_start == 0) {
-               WARNING(L"No watchdog drivers registered.\n");
-               return EFI_NOT_FOUND;
+               if (timeout > 0) {
+                       ERROR(L"No watchdog drivers registered, but timeout is 
non-zero.\n");
+                       return EFI_UNSUPPORTED;
+               }
+               return EFI_SUCCESS;
+       }
+       if (timeout == 0) {
+               WARNING(L"Watchdog is disabled.\n");
+               return EFI_SUCCESS;
        }
 
        UINTN handle_count = 0;
@@ -164,13 +171,9 @@ EFI_STATUS efi_main(EFI_HANDLE image_handle, 
EFI_SYSTEM_TABLE *system_table)
                WARNING(L"Cannot close volumes.\n", status);
        }
 
-       if (bg_loader_params.timeout == 0) {
-               WARNING(L"Watchdog is disabled.\n");
-       } else {
-               status = probe_watchdogs(loaded_image, 
bg_loader_params.timeout);
-               if (EFI_ERROR(status)) {
-                       error_exit(L"Cannot probe watchdog", status);
-               }
+       status = probe_watchdogs(loaded_image, bg_loader_params.timeout);
+       if (EFI_ERROR(status)) {
+               error_exit(L"Cannot probe watchdog", status);
        }
 
        /* Load and start image */
-- 
2.34.1

-- 
You received this message because you are subscribed to the Google Groups "EFI 
Boot Guard" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/efibootguard-dev/93cd2ae1-4c71-c26b-1a6c-c50bf7217130%40siemens.com.

Reply via email to