From: Ahmad Fatoum <a.fatoum@pengutronix.de>
To: barebox@lists.infradead.org
Cc: ejo@pengutronix.de, Ahmad Fatoum <a.fatoum@pengutronix.de>
Subject: [PATCH v2 1/2] Documentation: document querying of barebox version
Date: Wed, 16 Apr 2025 12:13:54 +0200 [thread overview]
Message-ID: <20250416101355.214289-1-a.fatoum@pengutronix.de> (raw)
We have a short reference to barebox-version fixup in the device tree section
of the manual. Expand on this by adding a proper documentation section.
Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de>
---
v1 -> v2:
- s/integrator/integration/ (Enrico)
- Fix ReST markup in list (Enrico)
- Mention CONFIG_IMD_TARGET
---
Documentation/user/user-manual.rst | 1 +
Documentation/user/versioning.rst | 59 ++++++++++++++++++++++++++++++
2 files changed, 60 insertions(+)
create mode 100644 Documentation/user/versioning.rst
diff --git a/Documentation/user/user-manual.rst b/Documentation/user/user-manual.rst
index 83ba9e4c3505..b8272b2235e4 100644
--- a/Documentation/user/user-manual.rst
+++ b/Documentation/user/user-manual.rst
@@ -33,6 +33,7 @@ Contents:
reset-reason
system-reset
state
+ versioning
random
optee
debugging
diff --git a/Documentation/user/versioning.rst b/Documentation/user/versioning.rst
new file mode 100644
index 000000000000..0c3001b97433
--- /dev/null
+++ b/Documentation/user/versioning.rst
@@ -0,0 +1,59 @@
+.. _versioning:
+
+barebox Artifact Versioning
+===========================
+
+In addition to the usual barebox release (e.g. ``v2025.03.0``), the
+version number can be extended to encode integration-specific version
+information:
+
+ * When built from git, ``scripts/setlocalversion`` will factor in
+ git revision information into the version string.
+ * The ``EXTRAVERSION = `` in the top-level ``Makefile`` can be used
+ to add a suffix to the version. This is useful if patches are applied
+ on top of the tarball release.
+ * The build host can set the ``BUILDSYSTEM_VERSION`` environment variable
+ prior to executing ``make`` to encode a board support package version.
+ This is useful to encode information about built-in environment
+ and firmware.
+
+Query from barebox
+^^^^^^^^^^^^^^^^^^
+
+When ``CONFIG_BANNER`` is enabled, the version information will be printed
+to the console. From the shell, there is the
+:ref:`version command <command_version>` for interactive use and the
+``global.version`` and ``global.buildsystem.version`` :ref:`magicvars`
+for use in scripts.
+
+Query from OS
+^^^^^^^^^^^^^
+
+The barebox version (formatted as ``barebox-$version``) can be queried
+after boot by different means:
+
+ * If the OS is booted with device tree, barebox will fixup a
+ ``/chosen/barebox-version`` property into the kernel device tree with
+ the version string. Under Linux, this can be accessed at:
+
+ * ``/sys/firmware/devicetree/base/chosen/barebox-version``
+ * ``/proc/device-tree/base/chosen/barebox-version``
+
+ * If the system is booted through barebox as EFI application (payload),
+ a ``LoaderInfo`` EFI variable with the systemd vendor GUID will
+ be set to the version string. Under Linux, the string is shown in
+ ``bootctl`` output
+
+Query without booting
+^^^^^^^^^^^^^^^^^^^^^
+
+If the barebox boot medium is known, ``bareboximd`` can be used
+to read the barebox :ref:`imd`, provided that barebox was
+compiled with ``CONFIG_IMD=y`` (and ``CONFIG_IMD_TARGET=y`` for
+the target tool)::
+
+ linux$ bareboximd /dev/mmc2.boot0 -t release
+ 2025.03.0-20250403-1
+
+ barebox$ imd /dev/mmc2.boot0 -t release
+ 2025.03.0-20250403-1
--
2.39.5
next reply other threads:[~2025-04-16 10:34 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-04-16 10:13 Ahmad Fatoum [this message]
2025-04-16 10:13 ` [PATCH v2 2/2] Documentation: devicetree: add of_diff hint for visualizing fixups Ahmad Fatoum
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=20250416101355.214289-1-a.fatoum@pengutronix.de \
--to=a.fatoum@pengutronix.de \
--cc=barebox@lists.infradead.org \
--cc=ejo@pengutronix.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox