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

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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


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




[Index of Archives]     [Linux Embedded]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [XFree86]

  Powered by Linux