@litmusautomation is the correct domain for this submission.

Thanks
-Dmitri

------ Original Message ------
From: "Jan Kiszka" <[email protected]>
To: [email protected]; [email protected]
Cc: "Dmitri Toubelis" <[email protected]>; "Dmitri Toubelis" <[email protected]>
Sent: 2018-02-01 8:40:23 AM
Subject: Re: [efibootguard][PATCH] Enable boot without watchdog

On 2018-02-01 14:24, [email protected] wrote:
From: Dmitri Toubelis <[email protected]>

This patch allows booting an image without arming watchdog timer
whwn "watchdog=0" parameter is passed to the to the module.

This covers the use case when availability of a hardware driver is
unknown ahead of time and can only be established upon first boot.
The code that runs on the first boot can then identify if supported
hardware watchdog is available and the required driver is present
in the kernel and either update boot configuration re-arming the
timer or issuing a warning unsupported hardware. This also allows
for booting images in virtual environments.

Allow "watchdog" be equal "0"

Move bypass switch to efi_main

Removing the last two lines (patch history usually goes after "---"), I
would take this into next now - if you could clarify your preferred
email domain (@alkeron or @litmusautomation). Just to be consistent
between authorship and signed off.

Thanks,
Jan


Signed-off-by: Dmitri Toubelis <[email protected]>
---
 main.c            | 11 ++++++++---
 tools/bg_setenv.c |  2 +-
 2 files changed, 9 insertions(+), 4 deletions(-)

diff --git a/main.c b/main.c
index b71f811..64d93b8 100644
--- a/main.c
+++ b/main.c
@@ -157,9 +157,14 @@ EFI_STATUS efi_main(EFI_HANDLE image_handle, EFI_SYSTEM_TABLE *system_table)
                    EFI_OUT_OF_RESOURCES);
        }

-       status = scan_devices(loaded_image, bg_loader_params.timeout);
-       if (EFI_ERROR(status)) {
-               error_exit(L"Could not probe watchdog.", status);
+       if (bg_loader_params.timeout == 0) {
+               Print(L"Watchdog is disabled.\n");
+               return EFI_SUCCESS;
+       } else {
+               status = scan_devices(loaded_image, bg_loader_params.timeout);
+               if (EFI_ERROR(status)) {
+                       error_exit(L"Could not probe watchdog.", status);
+               }
        }

        /* Load and start image */
diff --git a/tools/bg_setenv.c b/tools/bg_setenv.c
index b397aca..37f50ce 100644
--- a/tools/bg_setenv.c
+++ b/tools/bg_setenv.c
@@ -338,7 +338,7 @@ static error_t parse_opt(int key, char *arg, struct argp_state *state)
                break;
        case 'w':
                i = parse_int(arg);
-               if (errno || i == 0) {
+               if (errno || i < 0) {
                        fprintf(stderr,
                                "Invalid watchdog timeout specified.\n");
                        return 1;



--
Siemens AG, Corporate Technology, CT RDA IOT SES-DE
Corporate Competence Center Embedded Linux

--
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 post to this group, send email to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/efibootguard-dev/em2122e15e-efe4-474b-9480-0d2198c79cec%40master.
For more options, visit https://groups.google.com/d/optout.

Reply via email to