mail archive of the barebox mailing list
 help / color / mirror / Atom feed
From: Sascha Hauer <s.hauer@pengutronix.de>
To: barebox@lists.infradead.org
Subject: [PATCH 2/8] Add a global.version variable
Date: Thu, 15 Aug 2013 09:28:55 +0200	[thread overview]
Message-ID: <1376551741-16438-3-git-send-email-s.hauer@pengutronix.de> (raw)
In-Reply-To: <1376551741-16438-1-git-send-email-s.hauer@pengutronix.de>

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


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

  parent reply	other threads:[~2013-08-15  7:29 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-08-15  7:28 [PATCH] move BOARDINFO to globalvar Sascha Hauer
2013-08-15  7:28 ` [PATCH 1/8] globalvar: Allow to set initial value Sascha Hauer
2013-08-15  7:28 ` Sascha Hauer [this message]
2013-08-15  7:28 ` [PATCH 3/8] globalvar: move globalvar init to pure_initcall Sascha Hauer
2013-08-15  7:28 ` [PATCH 4/8] remove remaining references of CONFIG_BOARDINFO Sascha Hauer
2013-08-15  7:28 ` [PATCH 5/8] introduce barebox_set_model Sascha Hauer
2013-08-15  7:28 ` [PATCH 6/8] Make hostname available to C Code Sascha Hauer
2013-08-15  7:29 ` [PATCH 7/8] Set model and hostname at boardlevel Sascha Hauer
2013-08-15  7:39   ` Alexander Shiyan
2013-08-15  9:13     ` Sascha Hauer
2013-08-15  9:07   ` Sebastian Hesselbarth
2013-08-15  9:13     ` Sascha Hauer
2013-08-15  9:19       ` Sebastian Hesselbarth
2013-08-15  7:29 ` [PATCH 8/8] export model as globalvar Sascha Hauer

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=1376551741-16438-3-git-send-email-s.hauer@pengutronix.de \
    --to=s.hauer@pengutronix.de \
    --cc=barebox@lists.infradead.org \
    /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