From: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
To: barebox@lists.infradead.org
Subject: [PATCH 7/7] bootargs: switch globalvar to it's own device
Date: Sat, 26 Jan 2013 00:55:32 +0100 [thread overview]
Message-ID: <1359158132-8023-7-git-send-email-plagnioj@jcrosoft.com> (raw)
In-Reply-To: <1359158132-8023-1-git-send-email-plagnioj@jcrosoft.com>
Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
---
common/bootargs.c | 14 ++++++++++++--
1 file changed, 12 insertions(+), 2 deletions(-)
diff --git a/common/bootargs.c b/common/bootargs.c
index 6624f72..d82d853 100644
--- a/common/bootargs.c
+++ b/common/bootargs.c
@@ -22,9 +22,11 @@
#include <magicvar.h>
#include <globalvar.h>
#include <environment.h>
+#include <init.h>
static char *linux_bootargs;
static int linux_bootargs_overwritten;
+static char *global_linux_dev;
/*
* This returns the Linux bootargs
@@ -45,11 +47,11 @@ const char *linux_bootargs_get(void)
free(linux_bootargs);
- bootargs = globalvar_get_match("linux.bootargs.", " ");
+ bootargs = global_get_match(global_linux_dev, "bootargs.", " ");
if (!strlen(bootargs))
return getenv("bootargs");
- mtdparts = globalvar_get_match("linux.mtdparts.", ";");
+ mtdparts = global_get_match(global_linux_dev, "mtdparts.", ";");
if (strlen(mtdparts)) {
linux_bootargs = asprintf("%s mtdparts=%s", bootargs, mtdparts);
@@ -76,5 +78,13 @@ int linux_bootargs_overwrite(const char *bootargs)
return 0;
}
+static int bootargs_init(void)
+{
+ global_linux_dev = global_add_device("linux");
+
+ return 0;
+}
+late_initcall(bootargs_init);
+
BAREBOX_MAGICVAR_NAMED(global_linux_bootargs_, global.linux.bootargs.*, "Linux bootargs variables");
BAREBOX_MAGICVAR_NAMED(global_linux_mtdparts_, global.linux.mtdparts.*, "Linux mtdparts variables");
--
1.7.10.4
_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox
next prev parent reply other threads:[~2013-01-25 23:56 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-01-25 23:53 [PATCH 0/7] globalvar: add multiple device support Jean-Christophe PLAGNIOL-VILLARD
2013-01-25 23:55 ` [PATCH 1/7] params: allow to access first sub-device and params via env Jean-Christophe PLAGNIOL-VILLARD
2013-01-25 23:55 ` [PATCH 2/7] globalvar: add it's own bus Jean-Christophe PLAGNIOL-VILLARD
2013-01-25 23:55 ` [PATCH 3/7] globalvar: allow to register multiple device Jean-Christophe PLAGNIOL-VILLARD
2013-01-25 23:55 ` [PATCH 4/7] net: switch to global device Jean-Christophe PLAGNIOL-VILLARD
2013-01-25 23:55 ` [PATCH 5/7] dhcp: switch globalvar to it's own device Jean-Christophe PLAGNIOL-VILLARD
2013-01-25 23:55 ` [PATCH 6/7] bootm: " Jean-Christophe PLAGNIOL-VILLARD
2013-01-25 23:55 ` Jean-Christophe PLAGNIOL-VILLARD [this message]
2013-01-26 0:45 ` [PATCH 1/7] params: allow to access first sub-device and params via env Alexander Aring
2013-01-27 10:08 ` [PATCH 0/7] globalvar: add multiple device support Sascha Hauer
2013-01-27 10:38 ` Jean-Christophe PLAGNIOL-VILLARD
2013-01-27 10:56 ` Sascha Hauer
2013-03-13 18:01 [PATCH 0/7 v2] " Jean-Christophe PLAGNIOL-VILLARD
2013-03-13 18:05 ` [PATCH 1/7] params: allow to access first sub-device and params via env Jean-Christophe PLAGNIOL-VILLARD
2013-03-13 18:05 ` [PATCH 7/7] bootargs: switch globalvar to it's own device Jean-Christophe PLAGNIOL-VILLARD
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=1359158132-8023-7-git-send-email-plagnioj@jcrosoft.com \
--to=plagnioj@jcrosoft.com \
--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