On 24.02.24 18:51, 'Earl Chew' via EFI Boot Guard wrote:
> Support a configuration option to insert a delay before
> starting the image to give the operator a chance to capture
> diagnostic messages.
> 
> Signed-off-by: Earl Chew <earl_c...@yahoo.com>
> ---
>  configure.ac | 17 +++++++++++++++++
>  main.c       |  2 ++
>  2 files changed, 19 insertions(+)
> 
> diff --git a/configure.ac b/configure.ac
> index b000603..de7ef3e 100644
> --- a/configure.ac
> +++ b/configure.ac
> @@ -156,6 +156,22 @@ AC_ARG_WITH([env-backend],
>  
>  AC_SUBST([env_api_file], [${ENV_API_FILE}])
>  
> +AC_ARG_WITH([boot-delay],
> +         AS_HELP_STRING([--with-boot-delay=INT],
> +                        [specify the additional boot delay in seconds, 
> defaults to 3]),
> +         [
> +             # Limit the boot delay to 1 hour to avoid overflowing
> +             # BS->Stall() on 32 bit hosts.
> +             ENV_BOOT_DELAY=${withval:-3}
> +             AS_IF([test "${ENV_BOOT_DELAY}" -lt "0" -o "${ENV_BOOT_DELAY}" 
> -gt "3600"],
> +                   [
> +                     AC_MSG_ERROR([Invalid boot delay.])
> +                   ])
> +         ],
> +         [ ENV_BOOT_DELAY=0 ])
> +
> +AC_DEFINE_UNQUOTED([ENV_BOOT_DELAY], [${ENV_BOOT_DELAY}], [Additional boot 
> delay])
> +
>  AC_ARG_WITH([num-config-parts],
>           AS_HELP_STRING([--with-num-config-parts=INT],
>                          [specify the number of used config partitions, 
> defaults to 2]),
> @@ -248,4 +264,5 @@ AC_MSG_RESULT([
>       environment backend:     ${ENV_API_FILE}.c
>       number of config parts:  ${ENV_NUM_CONFIG_PARTS}
>       reserved for uservars:   ${ENV_MEM_USERVARS} bytes
> +     boot delay:              ${ENV_BOOT_DELAY} seconds
>  ])
> diff --git a/main.c b/main.c
> index 0ff121a..a0b1b60 100644
> --- a/main.c
> +++ b/main.c
> @@ -214,5 +214,7 @@ EFI_STATUS efi_main(EFI_HANDLE image_handle, 
> EFI_SYSTEM_TABLE *system_table)
>       INFO(L"Starting %s with watchdog set to %d seconds ...\n",
>            bg_loader_params.payload_path, bg_loader_params.timeout);
>  
> +     BS->Stall(1000 * 1000 * ENV_BOOT_DELAY);
> +
>       return BS->StartImage(payload_handle, NULL, NULL);
>  }

Thanks, merged. Please consider checking latest next in the future to
avoid conflicts (resolved this one myself).

Jan

-- 
Siemens AG, Technology
Linux Expert Center

-- 
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 efibootguard-dev+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/efibootguard-dev/a61d738c-c3b9-49ff-9f64-aa2930ff5004%40siemens.com.

Reply via email to