version.rst 3.3 KB

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