summaryrefslogtreecommitdiffstats
path: root/common
diff options
context:
space:
mode:
authorSteffen Trumtrar <s.trumtrar@pengutronix.de>2020-09-23 12:34:17 +0200
committerSascha Hauer <s.hauer@pengutronix.de>2020-09-28 11:08:58 +0200
commitc600d8812e9f3b98591a7d80d0feed33fa35d0f5 (patch)
tree8612ac0c0e0ecfccaaf788901ba8b47edf005960 /common
parentc7dcac9de597f006fdc8c2680eb25e92ff62df7d (diff)
downloadbarebox-c600d8812e9f3b98591a7d80d0feed33fa35d0f5.tar.gz
barebox-c600d8812e9f3b98591a7d80d0feed33fa35d0f5.tar.xz
common: globalvar: add variable for buildsystem_version_string
Now that the buildsystem version is available, make it accessible as a global variable for runtime usage. If the buildsystem version is not present (i.e. empty), don't add the variable at all. Signed-off-by: Steffen Trumtrar <s.trumtrar@pengutronix.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Diffstat (limited to 'common')
-rw-r--r--common/globalvar.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/common/globalvar.c b/common/globalvar.c
index 5bde86aad0..09479da548 100644
--- a/common/globalvar.c
+++ b/common/globalvar.c
@@ -652,11 +652,17 @@ static int globalvar_init(void)
globalvar_add_simple("version", UTS_RELEASE);
+ if (strlen(buildsystem_version_string) > 0)
+ globalvar_add_simple("buildsystem.version", buildsystem_version_string);
+
return 0;
}
pure_initcall(globalvar_init);
BAREBOX_MAGICVAR_NAMED(global_version, global.version, "The barebox version");
+BAREBOX_MAGICVAR_NAMED(global_buildsystem_version,
+ global.buildsystem.version,
+ "version of buildsystem barebox was built with");
/**
* nvvar_save - save NV variables to persistent environment