mail archive of the barebox mailing list
 help / color / mirror / Atom feed
* [PATCH 1/4] Makefile: add buildsystem version variable
@ 2020-09-23 10:34 Steffen Trumtrar
  2020-09-23 10:34 ` [PATCH 2/4] common: print buildsystem version in barebox banner Steffen Trumtrar
                   ` (3 more replies)
  0 siblings, 4 replies; 5+ messages in thread
From: Steffen Trumtrar @ 2020-09-23 10:34 UTC (permalink / raw)
  To: Barebox List

Introduce a new variable to store a buildsystem version information.
The exact information that is stored here (git commit, git tag,...) is
defined by the buildsystem.
It is intended to have the possibility to get information about the
exact barebox binary, environment and configuration.

The variable is utilized the same as KERNELVERSION for linux:

   make BUILDSYSTEM_VERSION=$COMMITISH

Via scripts/mkcompile_h this information is injected into the barebox
codebase.

Signed-off-by: Steffen Trumtrar <s.trumtrar@pengutronix.de>
---
 Makefile            | 3 ++-
 scripts/mkcompile_h | 3 +++
 2 files changed, 5 insertions(+), 1 deletion(-)

diff --git a/Makefile b/Makefile
index d27b78201bda..d829e33c4621 100644
--- a/Makefile
+++ b/Makefile
@@ -311,7 +311,8 @@ include scripts/Kbuild.include
 # Read KERNELRELEASE from include/config/kernel.release (if it exists)
 KERNELRELEASE = $(shell cat include/config/kernel.release 2> /dev/null)
 KERNELVERSION = $(VERSION)$(if $(PATCHLEVEL),.$(PATCHLEVEL)$(if $(SUBLEVEL),.$(SUBLEVEL)))$(EXTRAVERSION)
-export VERSION PATCHLEVEL SUBLEVEL KERNELRELEASE KERNELVERSION
+BUILDSYSTEM_VERSION =
+export VERSION PATCHLEVEL SUBLEVEL KERNELRELEASE KERNELVERSION BUILDSYSTEM_VERSION
 
 # Cross compiling and selecting different set of gcc/bin-utils
 # ---------------------------------------------------------------------------
diff --git a/scripts/mkcompile_h b/scripts/mkcompile_h
index 60b20cafc65e..49aadc153d44 100755
--- a/scripts/mkcompile_h
+++ b/scripts/mkcompile_h
@@ -54,6 +54,7 @@ fi
 UTS_VERSION="#$VERSION"
 CONFIG_FLAGS=""
 UTS_VERSION="$UTS_VERSION $CONFIG_FLAGS $TIMESTAMP"
+BUILDSYSTEM_VERSION="$BUILDSYSTEM_VERSION"
 
 # Truncate to maximum length
 
@@ -69,6 +70,8 @@ UTS_TRUNCATE="cut -b -$UTS_LEN"
 
   echo \#define UTS_VERSION \"`echo $UTS_VERSION | $UTS_TRUNCATE`\"
 
+  echo \#define BUILDSYSTEM_VERSION \"`echo $BUILDSYSTEM_VERSION`\"
+
   echo \#define BAREBOX_COMPILE_BY \"`echo $BAREBOX_COMPILE_BY | $UTS_TRUNCATE`\"
   echo \#define BAREBOX_COMPILE_HOST \"`echo $BAREBOX_COMPILE_HOST | $UTS_TRUNCATE`\"
 
-- 
2.28.0


_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2020-09-25 14:36 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-09-23 10:34 [PATCH 1/4] Makefile: add buildsystem version variable Steffen Trumtrar
2020-09-23 10:34 ` [PATCH 2/4] common: print buildsystem version in barebox banner Steffen Trumtrar
2020-09-23 10:34 ` [PATCH 3/4] common: globalvar: add variable for buildsystem_version_string Steffen Trumtrar
2020-09-23 10:34 ` [PATCH 4/4] imd: add buildsystem version to metadata Steffen Trumtrar
2020-09-25 14:35 ` [PATCH 1/4] Makefile: add buildsystem version variable Sascha Hauer

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox