[PATCH 2/8] Add a global.version variable

Sascha Hauer s.hauer at pengutronix.de
Thu Aug 15 03:28:55 EDT 2013


So far we only had the version command which is able to print
the barebox version. To make the barebox version available for
scripts add a globalvar for it.

Signed-off-by: Sascha Hauer <s.hauer at pengutronix.de>
---
 common/globalvar.c | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/common/globalvar.c b/common/globalvar.c
index 6fd1d88..545b34f 100644
--- a/common/globalvar.c
+++ b/common/globalvar.c
@@ -3,6 +3,7 @@
 #include <globalvar.h>
 #include <init.h>
 #include <environment.h>
+#include <magicvar.h>
 #include <generated/utsrelease.h>
 
 static struct device_d global_device = {
@@ -78,6 +79,10 @@ static int globalvar_init(void)
 {
 	register_device(&global_device);
 
+	globalvar_add_simple("version", UTS_RELEASE);
+
 	return 0;
 }
 postconsole_initcall(globalvar_init);
+
+BAREBOX_MAGICVAR_NAMED(global_version, global.version, "The barebox version");
-- 
1.8.4.rc2




More information about the barebox mailing list