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 10/11] globalvar: Add support for printing all global variables
Date: Thu,  6 Nov 2014 13:59:37 +0100	[thread overview]
Message-ID: <1415278778-20826-11-git-send-email-s.hauer@pengutronix.de> (raw)
In-Reply-To: <1415278778-20826-1-git-send-email-s.hauer@pengutronix.de>

This could previously only be done with 'devinfo global'. While
this is still possible this adds a more direct access via the
globalvar command. This variant also adds a '*' in front of
the variable if the corresponding non volatile variable exists.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
---
 commands/global.c   | 5 +++++
 common/globalvar.c  | 5 +++++
 include/globalvar.h | 1 +
 3 files changed, 11 insertions(+)

diff --git a/commands/global.c b/commands/global.c
index f14df38..581913d 100644
--- a/commands/global.c
+++ b/commands/global.c
@@ -37,6 +37,11 @@ static int do_global(int argc, char *argv[])
 		}
 	}
 
+	if (argc == optind) {
+		globalvar_print();
+		return 0;
+	}
+
 	argc -= optind;
 	argv += optind;
 
diff --git a/common/globalvar.c b/common/globalvar.c
index ec23c24..9a793ac 100644
--- a/common/globalvar.c
+++ b/common/globalvar.c
@@ -197,6 +197,11 @@ void nvvar_print(void)
 	device_param_print(&nv_device);
 }
 
+void globalvar_print(void)
+{
+	device_param_print(&global_device);
+}
+
 /*
  * globalvar_get_match
  *
diff --git a/include/globalvar.h b/include/globalvar.h
index 56b23fd..8b2caf1 100644
--- a/include/globalvar.h
+++ b/include/globalvar.h
@@ -77,6 +77,7 @@ int nvvar_load(void);
 void nvvar_print(void);
 int nvvar_add(const char *name, const char *value);
 int nvvar_remove(const char *name);
+void globalvar_print(void);
 
 #else
 static inline int globalvar_add_simple(const char *name, const char *value)
-- 
2.1.1


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

  parent reply	other threads:[~2014-11-06 13:00 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-11-06 12:59 non volatile variables and incremental envrironment Sascha Hauer
2014-11-06 12:59 ` [PATCH 01/11] environment: drop unnecessary casts Sascha Hauer
2014-11-06 12:59 ` [PATCH 02/11] environment: remove unused variable Sascha Hauer
2014-11-06 12:59 ` [PATCH 03/11] environment: refactor saveenv Sascha Hauer
2014-11-06 12:59 ` [PATCH 04/11] environment: Only save changes to the defaultenv Sascha Hauer
2014-11-06 12:59 ` [PATCH 05/11] magicvar: Add support for dynamically added magicvars Sascha Hauer
2014-11-06 12:59 ` [PATCH 06/11] Add support for non volatile variables Sascha Hauer
2014-11-06 12:59 ` [PATCH 07/11] libfile: Add copy_recursive Sascha Hauer
2014-11-06 12:59 ` [PATCH 08/11] cp: Add recursive copy Sascha Hauer
2014-11-06 12:59 ` [PATCH 09/11] Add defaultenv command Sascha Hauer
2014-11-06 12:59 ` Sascha Hauer [this message]
2014-11-06 12:59 ` [PATCH 11/11] defaultenv-2: Make use of nonvolatile variables 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=1415278778-20826-11-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