From 11275e4f72d6d2170db444df95e8f6b6ab627e8e Mon Sep 17 00:00:00 2001 From: Pali Rohár Date: Thu, 22 Apr 2021 18:09:57 +0200 Subject: smbios: Fix calculating BIOS Release Date MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit BIOS Release Date must be in format mm/dd/yyyy and must be release date. U-Boot currently sets BIOS Release Date from U_BOOT_DMI_DATE macro which is generated from current build timestamp. Fix this issue by setting U_BOOT_DMI_DATE macro to U-Boot version which is better approximation of U-Boot release date than current build timestamp. Current U-Boot versioning is in format yyyy.mm so as a day choose 01. Some operating systems are using BIOS Release Date for detecting when was SMBIOS table filled or if it could support some feature (e.g. BIOS from 1990 cannot support features invented in 2000). So this change also ensures that recompiling U-Boot from same sources but in different year does not change behavior of some operating systems. Macro U_BOOT_DMI_DATE is not used in other file than lib/smbios.c so remove it from global autogenerated files and also from Makefile. Signed-off-by: Pali Rohár Reviewed-by: Simon Glass --- Makefile | 2 -- 1 file changed, 2 deletions(-) (limited to 'Makefile') diff --git a/Makefile b/Makefile index ca2432c8ce..281b81d6cd 100644 --- a/Makefile +++ b/Makefile @@ -1905,7 +1905,6 @@ define filechk_timestamp.h LC_ALL=C $${DATE} -u -d "$${SOURCE_DATE}" +'#define U_BOOT_DATE "%b %d %C%y"'; \ LC_ALL=C $${DATE} -u -d "$${SOURCE_DATE}" +'#define U_BOOT_TIME "%T"'; \ LC_ALL=C $${DATE} -u -d "$${SOURCE_DATE}" +'#define U_BOOT_TZ "%z"'; \ - LC_ALL=C $${DATE} -u -d "$${SOURCE_DATE}" +'#define U_BOOT_DMI_DATE "%m/%d/%Y"'; \ LC_ALL=C $${DATE} -u -d "$${SOURCE_DATE}" +'#define U_BOOT_BUILD_DATE 0x%Y%m%d'; \ LC_ALL=C $${DATE} -u -d "$${SOURCE_DATE}" +'#define U_BOOT_EPOCH %s'; \ else \ @@ -1915,7 +1914,6 @@ define filechk_timestamp.h LC_ALL=C date +'#define U_BOOT_DATE "%b %d %C%y"'; \ LC_ALL=C date +'#define U_BOOT_TIME "%T"'; \ LC_ALL=C date +'#define U_BOOT_TZ "%z"'; \ - LC_ALL=C date +'#define U_BOOT_DMI_DATE "%m/%d/%Y"'; \ LC_ALL=C date +'#define U_BOOT_BUILD_DATE 0x%Y%m%d'; \ LC_ALL=C date +'#define U_BOOT_EPOCH %s'; \ fi) -- cgit v1.2.3