diff mbox series

[01/10] README: Add doumentation for version information

Message ID 20210106212153.1.I2ac81b51676077a69e5198108cdb3d0525a0f65d@changeid
State Superseded
Delegated to: Bin Meng
Headers show
Series smbios: Enhancements for more flexibility | expand

Commit Message

Simon Glass Jan. 7, 2021, 4:21 a.m. UTC
There are quite a few available version options in U-Boot. Add a list of
the available Makefile variables and #defines, along with examples.

Signed-off-by: Simon Glass <sjg@chromium.org>
---

 README | 84 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
 1 file changed, 84 insertions(+)

Comments

Patrick Delaunay Feb. 8, 2021, 1:52 p.m. UTC | #1
Hi Simon

on tipo in title:

s/doumentation/documentation/

On 1/7/21 5:21 AM, Simon Glass wrote:
> There are quite a few available version options in U-Boot. Add a list of
> the available Makefile variables and #defines, along with examples.
>
> Signed-off-by: Simon Glass <sjg@chromium.org>
> ---
>
>   README | 84 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
>   1 file changed, 84 insertions(+)
>
Just one remark, this information could be integrated in generated 
U-Boot documentation

for example => develop/version.rst (under "Implementation")

Reviewed-by: Patrick Delaunay <patrick.delaunay@foss.st.com>

Thanks

Patrick
Simon Glass Feb. 8, 2021, 5:07 p.m. UTC | #2
Hi Patrick,

On Mon, 8 Feb 2021 at 06:52, Patrick DELAUNAY
<patrick.delaunay@foss.st.com> wrote:
>
> Hi Simon
>
> on tipo in title:
>
> s/doumentation/documentation/
>
> On 1/7/21 5:21 AM, Simon Glass wrote:
> > There are quite a few available version options in U-Boot. Add a list of
> > the available Makefile variables and #defines, along with examples.
> >
> > Signed-off-by: Simon Glass <sjg@chromium.org>
> > ---
> >
> >   README | 84 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
> >   1 file changed, 84 insertions(+)
> >
> Just one remark, this information could be integrated in generated
> U-Boot documentation
>
> for example => develop/version.rst (under "Implementation")
>
> Reviewed-by: Patrick Delaunay <patrick.delaunay@foss.st.com>

Actually yes Heinrich had the same suggestion and I sent a new version.

Regards,
Simon
diff mbox series

Patch

diff --git a/README b/README
index 5ca11f25ee5..02ed0504455 100644
--- a/README
+++ b/README
@@ -1830,6 +1830,90 @@  The following options need to be configured:
 		Time to wait after FPGA configuration. The default is
 		200 ms.
 
+- Version identification:
+
+		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 here for full details:
+		  https://www.denx.de/wiki/view/U-Boot/ReleaseCycle
+
+		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
+
+		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_DMI_DATE "01/06/2021"  (US format only)
+		  #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.
+		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.
+
 - Configuration Management:
 
 		CONFIG_IDENT_STRING