[PATCH] uefi: uefirttime: fix the time zone to exact value

Ivan Hu ivan.hu at canonical.com
Tue Nov 7 08:09:11 UTC 2017


UEFI spec defined the time zone value for -1440 to 1440 and 2047(unspecified
time zone). Using timezone 1 is allowed by UEFI spec, however value 1 is not
exact value on earth. Some firmware will check the exact timezone value on
earth, so the test will fail. Modify the timezone value test with 0 and 2047
for testing.

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

diff --git a/src/uefi/uefirttime/uefirttime.c b/src/uefi/uefirttime/uefirttime.c
index 7998f7f..d6df9d1 100644
--- a/src/uefi/uefirttime/uefirttime.c
+++ b/src/uefi/uefirttime/uefirttime.c
@@ -321,7 +321,8 @@ static int uefirttime_test4(fwts_framework *fw)
 	if (time.TimeZone != 0)
 		time.TimeZone = 0;
 	else
-		time.TimeZone = 1;
+		/* Unspecified timezone, local time */
+		time.TimeZone = 2047;
 
 	settime.Time = &time;
 	settime.status = &status;
@@ -370,7 +371,7 @@ static int uefirttime_test4(fwts_framework *fw)
 		return FWTS_ERROR;
 	}
 
-	if (!((oldtime.TimeZone == 0) && (newtime.TimeZone == 1)) &&
+	if (!((oldtime.TimeZone == 0) && (newtime.TimeZone == 2047)) &&
 	    !((oldtime.TimeZone != 0) && (newtime.TimeZone == 0))) {
 		fwts_failed(fw, LOG_LEVEL_HIGH, "UEFIRuntimeSetTimeTimezone",
 			"Failed to set timezone with UEFI runtime service.");
-- 
2.7.4




More information about the fwts-devel mailing list