blob: 6da31a4a1e7e1a92a4409dd6950ec9e3bd23d848 [file] [log] [blame]
Simon Glass9b95f3f2021-02-04 21:17:12 -07001.. SPDX-License-Identifier: GPL-2.0+
2.. Copyright (c) 2013 The Chromium OS Authors.
3
4Version information
5===================
6
7U-Boot releases are named by year and patch level, for example 2020.10 means the
8release that came out in October 2020. Release candidates are tagged every few
9weeks as the project heads to the next release. So 2020.10-rc1 was the first
10release candidate (RC), tagged soon after 2020.07 was released.
11
12See https://www.denx.de/wiki/view/U-Boot/ReleaseCycle for full details.
13
14Within the build system, various Makefile variables are created, making use of
15VERSION, PATCHLEVEL and EXTRAVERSION defined at the top of 'Makefile'. There is
16also SUBLEVEL available for downstream use. See also CONFIG_IDENT_STRING.
17
18Some variables end up in a generated header file at
19include/generated/version_autogenerated.h and can be accessed from C source by
20including <version.h>
21
22The following are available:
23
24 UBOOTRELEASE (Makefile)
25 Full release version as a string. If this is not a tagged release, it also
26 includes the number of commits since the last tag as well as the the git
27 hash. If there are uncommitted changes a '-dirty' suffix is added too.
28
29 This is written by scripts/setlocalversion (maintained by Linux) to
30 include/config/uboot.release and ends up in the UBOOTRELEASE Makefile
31 variable.
32
33 Examples::
34
35 2020.10-rc3
36 2021.01-rc5-00248-g60dd854f3ba-dirty
37
38 PLAIN_VERSION (string #define)
39 This is UBOOTRELEASE but available in C source.
40
41 Examples::
42
43 2020.10
44 2021.01-rc5-00248-g60dd854f3ba-dirty
45
46 UBOOTVERSION (Makefile)
47 This holds just the first three components of UBOOTRELEASE (i.e. not the
48 git hash, etc.)
49
50 Examples::
51
52 2020.10
53 2021.01-rc5
54
55 U_BOOT_VERSION (string #define)
56 "U-Boot " followed by UBOOTRELEASE, for example::
57
58 U-Boot 2020.10
59 U-Boot 2021.01-rc5
60
61 This is used as part of the banner string when U-Boot starts.
62
63 U_BOOT_VERSION_STRING (string #define)
64 U_BOOT_VERSION followed by build-time information
65 and CONFIG_IDENT_STRING.
66
67 Examples::
68
69 U-Boot 2020.10 (Jan 06 2021 - 08:50:36 -0700)
70 U-Boot 2021.01-rc5-00248-g60dd854f3ba-dirty (Jan 06 2021 - 08:50:36 -0700) for spring
71
72Build date/time is also included. See the generated file
73include/generated/timestamp_autogenerated.h for the available
74fields. For example::
75
76 #define U_BOOT_DATE "Jan 06 2021" (US format only)
77 #define U_BOOT_TIME "08:50:36" (24-hour clock)
78 #define U_BOOT_TZ "-0700" (Time zone in hours)
79 #define U_BOOT_DMI_DATE "01/06/2021" (US format only)
80 #define U_BOOT_BUILD_DATE 0x20210106 (hex yyyymmdd format)
81 #define U_BOOT_EPOCH 1609948236
82
83The Epoch is the number of seconds since midnight on 1/1/70. You can convert
84this to a time with::
85
86 $ date -u -d @1609948236
87 Wed 06 Jan 2021 03:50:36 PM UTC
88 $ date -d 'Wed 06 Jan 2021 03:50:36 PM UTC' +%s
89 1609948236
90
91Every time you build U-Boot this will update based on the time
92on your build machine. See 'Reproducible builds' if you want to
93avoid that.