diff mbox series

uefirttime: add advice for the timezone 2047 failure (LP: #1933503)

Message ID 20210709072919.25978-1-ivan.hu@canonical.com
State Superseded
Headers show
Series uefirttime: add advice for the timezone 2047 failure (LP: #1933503) | expand

Commit Message

ivanhu July 9, 2021, 7:29 a.m. UTC
Some system firmwares do not support the timezone value
EFI_UNSPECIFIED_TIMEZONE(2047) and set the value 0 directly
instead of returning status EFI_INVALID_PARAMETER error.
Add the advice information for the failure.

Signed-off-by: Ivan Hu <ivan.hu@canonical.com>
---
 src/uefi/uefirttime/uefirttime.c | 5 +++++
 1 file changed, 5 insertions(+)

Comments

Colin Ian King July 9, 2021, 8:06 a.m. UTC | #1
On 09/07/2021 08:29, Ivan Hu wrote:
> Some system firmwares do not support the timezone value
> EFI_UNSPECIFIED_TIMEZONE(2047) and set the value 0 directly
> instead of returning status EFI_INVALID_PARAMETER error.
> Add the advice information for the failure.
> 
> Signed-off-by: Ivan Hu <ivan.hu@canonical.com>
> ---
>  src/uefi/uefirttime/uefirttime.c | 5 +++++
>  1 file changed, 5 insertions(+)
> 
> diff --git a/src/uefi/uefirttime/uefirttime.c b/src/uefi/uefirttime/uefirttime.c
> index 9c3d6a19..e4c7af51 100644
> --- a/src/uefi/uefirttime/uefirttime.c
> +++ b/src/uefi/uefirttime/uefirttime.c
> @@ -417,6 +417,11 @@ static int uefirttime_test4(fwts_framework *fw)
>  	    !((oldtime.TimeZone != 0) && (newtime.TimeZone == 0))) {
>  		fwts_failed(fw, LOG_LEVEL_HIGH, "UEFIRuntimeSetTimeTimezone",
>  			"Failed to set timezone with UEFI runtime service.");
> +		fwts_advice(fw,
> +			"Some system firmwares may not support the timezone "
> +			"value EFI_UNSPECIFIED_TIMEZONE(2047) and set the "
> +			"value 0 directly instead of returning an error which "
> +			"causes the failure.");
>  		return FWTS_ERROR;
>  	}
>  
> 

Thanks Ivan. Minor nitpick, should "firmwares" be "firmware"?  Perhaps
it's just a minor international use of word firmware that's fine. Not sure.

Colin
diff mbox series

Patch

diff --git a/src/uefi/uefirttime/uefirttime.c b/src/uefi/uefirttime/uefirttime.c
index 9c3d6a19..e4c7af51 100644
--- a/src/uefi/uefirttime/uefirttime.c
+++ b/src/uefi/uefirttime/uefirttime.c
@@ -417,6 +417,11 @@  static int uefirttime_test4(fwts_framework *fw)
 	    !((oldtime.TimeZone != 0) && (newtime.TimeZone == 0))) {
 		fwts_failed(fw, LOG_LEVEL_HIGH, "UEFIRuntimeSetTimeTimezone",
 			"Failed to set timezone with UEFI runtime service.");
+		fwts_advice(fw,
+			"Some system firmwares may not support the timezone "
+			"value EFI_UNSPECIFIED_TIMEZONE(2047) and set the "
+			"value 0 directly instead of returning an error which "
+			"causes the failure.");
 		return FWTS_ERROR;
 	}