1.. 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 72 U_BOOT_VERSION_NUM (integer #define) 73 Release year, e.g. 2021 for release 2021.01. Note 74 this is an integer, not a string. 75 76 U_BOOT_VERSION_NUM_PATCH (integer #define) 77 Patch number, e.g. 1 for release 2020.01. Note 78 this is an integer, not a string. 79 80Build date/time is also included. See the generated file 81include/generated/timestamp_autogenerated.h for the available 82fields. For example:: 83 84 #define U_BOOT_DATE "Jan 06 2021" (US format only) 85 #define U_BOOT_TIME "08:50:36" (24-hour clock) 86 #define U_BOOT_TZ "-0700" (Time zone in hours) 87 #define U_BOOT_DMI_DATE "01/06/2021" (US format only) 88 #define U_BOOT_BUILD_DATE 0x20210106 (hex yyyymmdd format) 89 #define U_BOOT_EPOCH 1609948236 90 91The Epoch is the number of seconds since midnight on 1/1/70. You can convert 92this to a time with:: 93 94 $ date -u -d @1609948236 95 Wed 06 Jan 2021 03:50:36 PM UTC 96 $ date -d 'Wed 06 Jan 2021 03:50:36 PM UTC' +%s 97 1609948236 98 99Every time you build U-Boot this will update based on the time 100on your build machine. See 'Reproducible builds' if you want to 101avoid that. 102