u-boot/doc/develop/version.rst
Pali Rohár 11275e4f72 smbios: Fix calculating BIOS Release Date
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 <pali@kernel.org>
Reviewed-by: Simon Glass <sjg@chromium.org>
2021-07-24 10:49:51 +02:00

100 lines
3.3 KiB
ReStructuredText

.. SPDX-License-Identifier: GPL-2.0+
.. Copyright (c) 2013 The Chromium OS Authors.
Version information
===================
U-Boot releases are named by year and patch level, for example 2020.10 means the
release that came out in October 2020. Release candidates are tagged every few
weeks as the project heads to the next release. So 2020.10-rc1 was the first
release candidate (RC), tagged soon after 2020.07 was released.
See https://www.denx.de/wiki/view/U-Boot/ReleaseCycle for full details.
Within the build system, various Makefile variables are created, making use of
VERSION, PATCHLEVEL and EXTRAVERSION defined at the top of 'Makefile'. There is
also SUBLEVEL available for downstream use. See also CONFIG_IDENT_STRING.
Some variables end up in a generated header file at
include/generated/version_autogenerated.h and can be accessed from C source by
including <version.h>
The following are available:
UBOOTRELEASE (Makefile)
Full release version as a string. If this is not a tagged release, it also
includes the number of commits since the last tag as well as the the git
hash. If there are uncommitted changes a '-dirty' suffix is added too.
This is written by scripts/setlocalversion (maintained by Linux) to
include/config/uboot.release and ends up in the UBOOTRELEASE Makefile
variable.
Examples::
2020.10-rc3
2021.01-rc5-00248-g60dd854f3ba-dirty
PLAIN_VERSION (string #define)
This is UBOOTRELEASE but available in C source.
Examples::
2020.10
2021.01-rc5-00248-g60dd854f3ba-dirty
UBOOTVERSION (Makefile)
This holds just the first three components of UBOOTRELEASE (i.e. not the
git hash, etc.)
Examples::
2020.10
2021.01-rc5
U_BOOT_VERSION (string #define)
"U-Boot " followed by UBOOTRELEASE, for example::
U-Boot 2020.10
U-Boot 2021.01-rc5
This is used as part of the banner string when U-Boot starts.
U_BOOT_VERSION_STRING (string #define)
U_BOOT_VERSION followed by build-time information
and CONFIG_IDENT_STRING.
Examples::
U-Boot 2020.10 (Jan 06 2021 - 08:50:36 -0700)
U-Boot 2021.01-rc5-00248-g60dd854f3ba-dirty (Jan 06 2021 - 08:50:36 -0700) for spring
U_BOOT_VERSION_NUM (integer #define)
Release year, e.g. 2021 for release 2021.01. Note
this is an integer, not a string.
U_BOOT_VERSION_NUM_PATCH (integer #define)
Patch number, e.g. 1 for release 2020.01. Note
this is an integer, not a string.
Build date/time is also included. See the generated file
include/generated/timestamp_autogenerated.h for the available
fields. For example::
#define U_BOOT_DATE "Jan 06 2021" (US format only)
#define U_BOOT_TIME "08:50:36" (24-hour clock)
#define U_BOOT_TZ "-0700" (Time zone in hours)
#define U_BOOT_BUILD_DATE 0x20210106 (hex yyyymmdd format)
#define U_BOOT_EPOCH 1609948236
The Epoch is the number of seconds since midnight on 1/1/70. You can convert
this to a time with::
$ date -u -d @1609948236
Wed 06 Jan 2021 03:50:36 PM UTC
$ date -d 'Wed 06 Jan 2021 03:50:36 PM UTC' +%s
1609948236
Every time you build U-Boot this will update based on the time
on your build machine. See 'Reproducible builds' if you want to
avoid that.