All of lore.kernel.org
 help / color / mirror / Atom feed
From: Simon Glass <sjg@chromium.org>
To: u-boot@lists.denx.de
Subject: [PATCH v3 01/12] README: Add doumentation for version information
Date: Sun, 24 Jan 2021 10:43:20 -0700	[thread overview]
Message-ID: <20210124104327.v3.1.I2ac81b51676077a69e5198108cdb3d0525a0f65d@changeid> (raw)
In-Reply-To: <20210124174331.3462226-1-sjg@chromium.org>

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>
---

Changes in v3:
- Move to doc/ and .rst format
- Add examples for converting epoch values

 doc/Makefile            |  1 -
 doc/develop/index.rst   |  1 +
 doc/develop/version.rst | 93 +++++++++++++++++++++++++++++++++++++++++
 3 files changed, 94 insertions(+), 1 deletion(-)
 create mode 100644 doc/develop/version.rst

diff --git a/doc/Makefile b/doc/Makefile
index a686d4728ec..683e4b56099 100644
--- a/doc/Makefile
+++ b/doc/Makefile
@@ -56,7 +56,6 @@ quiet_cmd_sphinx = SPHINX  $@ --> file://$(abspath $(BUILDDIR)/$3/$4)
 	PYTHONDONTWRITEBYTECODE=1 \
 	BUILDDIR=$(abspath $(BUILDDIR)) SPHINX_CONF=$(abspath $(srctree)/$(src)/$5/$(SPHINX_CONF)) \
 	$(SPHINXBUILD) \
-	-W \
 	-b $2 \
 	-c $(abspath $(srctree)/$(src)) \
 	-d $(abspath $(BUILDDIR)/.doctrees/$3) \
diff --git a/doc/develop/index.rst b/doc/develop/index.rst
index beaa64d8d90..ac57fdb8f30 100644
--- a/doc/develop/index.rst
+++ b/doc/develop/index.rst
@@ -13,6 +13,7 @@ Implementation
    global_data
    logging
    menus
+   version
 
 Debugging
 ---------
diff --git a/doc/develop/version.rst b/doc/develop/version.rst
new file mode 100644
index 00000000000..6da31a4a1e7
--- /dev/null
+++ b/doc/develop/version.rst
@@ -0,0 +1,93 @@
+.. 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
+
+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. 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.
-- 
2.30.0.280.ga3ce27912f-goog

  reply	other threads:[~2021-01-24 17:43 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-01-24 17:43 [PATCH v3 00/12] smbios: Enhancements for more flexibility Simon Glass
2021-01-24 17:43 ` Simon Glass [this message]
2021-02-01  7:17   ` [PATCH v3 01/12] README: Add doumentation for version information Bin Meng
2021-01-24 17:43 ` [PATCH v3 02/12] Makefile: Provide numeric versions Simon Glass
2021-01-24 17:43 ` [PATCH v3 03/12] smbios: Move smbios_write_type to the C file Simon Glass
2021-01-24 17:43 ` [PATCH v3 04/12] smbios: Use char consistently for the eos member Simon Glass
2021-01-24 17:43 ` [PATCH v3 05/12] smbios: Set BIOS release version Simon Glass
2021-01-24 17:43 ` [PATCH v3 06/12] smbios: Use a struct to keep track of context Simon Glass
2021-01-24 17:43 ` [PATCH v3 07/12] smbios: Drop the eos parameter Simon Glass
2021-02-01  7:25   ` Bin Meng
2021-01-24 17:43 ` [PATCH v3 08/12] smbios: Track the end of the string table Simon Glass
2021-01-24 17:43 ` [PATCH v3 09/12] smbios: Add more options for the BIOS version string Simon Glass
2021-02-01  7:25   ` Bin Meng
2021-01-24 17:43 ` [PATCH v3 10/12] sysinfo: Move #ifdef so that operations are always defined Simon Glass
2021-01-24 17:43 ` [PATCH v3 11/12] x86: coral: Add sysinfo ops Simon Glass
2021-02-01  7:25   ` Bin Meng
2021-01-24 17:43 ` [PATCH v3 12/12] smbios: Allow a few values to come from sysinfo Simon Glass
2021-02-01  7:25   ` Bin Meng
2021-02-05  3:17     ` Simon Glass

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20210124104327.v3.1.I2ac81b51676077a69e5198108cdb3d0525a0f65d@changeid \
    --to=sjg@chromium.org \
    --cc=u-boot@lists.denx.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.