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 06/11] bootm: move globalvars from command to common
Date: Tue, 24 Sep 2013 09:08:42 +0200	[thread overview]
Message-ID: <1380006527-2599-7-git-send-email-s.hauer@pengutronix.de> (raw)
In-Reply-To: <1380006527-2599-1-git-send-email-s.hauer@pengutronix.de>

The globalvars should be available even if the bootm command
is not directly present.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
---
 commands/bootm.c | 14 --------------
 common/bootm.c   | 16 ++++++++++++++++
 2 files changed, 16 insertions(+), 14 deletions(-)

diff --git a/commands/bootm.c b/commands/bootm.c
index c1d2ec4..005d582 100644
--- a/commands/bootm.c
+++ b/commands/bootm.c
@@ -158,20 +158,6 @@ err_out:
 	return 1;
 }
 
-static int bootm_init(void)
-{
-	globalvar_add_simple("bootm.image", NULL);
-	globalvar_add_simple("bootm.image.loadaddr", NULL);
-	globalvar_add_simple("bootm.oftree", NULL);
-	if (IS_ENABLED(CONFIG_CMD_BOOTM_INITRD)) {
-		globalvar_add_simple("bootm.initrd", NULL);
-		globalvar_add_simple("bootm.initrd.loadaddr", NULL);
-	}
-
-	return 0;
-}
-late_initcall(bootm_init);
-
 BAREBOX_CMD_HELP_START(bootm)
 BAREBOX_CMD_HELP_USAGE("bootm [OPTIONS] image\n")
 BAREBOX_CMD_HELP_SHORT("Boot an application image.\n")
diff --git a/common/bootm.c b/common/bootm.c
index 6b2c2a6..259feac 100644
--- a/common/bootm.c
+++ b/common/bootm.c
@@ -16,6 +16,8 @@
 #include <fs.h>
 #include <malloc.h>
 #include <memory.h>
+#include <globalvar.h>
+#include <init.h>
 
 static LIST_HEAD(handler_list);
 
@@ -322,3 +324,17 @@ err_out:
 
 	return ret;
 }
+
+static int bootm_init(void)
+{
+	globalvar_add_simple("bootm.image", NULL);
+	globalvar_add_simple("bootm.image.loadaddr", NULL);
+	globalvar_add_simple("bootm.oftree", NULL);
+	if (IS_ENABLED(CONFIG_CMD_BOOTM_INITRD)) {
+		globalvar_add_simple("bootm.initrd", NULL);
+		globalvar_add_simple("bootm.initrd.loadaddr", NULL);
+	}
+
+	return 0;
+}
+late_initcall(bootm_init);
-- 
1.8.4.rc3


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

  parent reply	other threads:[~2013-09-24  7:09 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-09-24  7:08 Bootm patches Sascha Hauer
2013-09-24  7:08 ` [PATCH 01/11] bootm: fix possible memory leak Sascha Hauer
2013-09-24  7:08 ` [PATCH 02/11] bootm: fix " Sascha Hauer
2013-09-24  7:08 ` [PATCH 03/11] bootm: check for os image file Sascha Hauer
2013-09-24  7:08 ` [PATCH 04/11] bootm: remove unused define Sascha Hauer
2013-09-24  7:08 ` [PATCH 05/11] bootm: move getenv_loadaddr from command to common Sascha Hauer
2013-09-24  7:08 ` Sascha Hauer [this message]
2013-09-24  7:08 ` [PATCH 07/11] bootm: separate bootm input data and internal data Sascha Hauer
2013-09-24  7:08 ` [PATCH 08/11] bootm: Add dryrun support Sascha Hauer
2013-09-24  7:08 ` [PATCH 09/11] ARM: compile bootm code depending on CONFIG_BOOTM Sascha Hauer
2013-09-24  7:08 ` [PATCH 10/11] command: Let builtin command take precedence Sascha Hauer
2013-09-24  7:08 ` [PATCH 11/11] defenv-2: replace boot script with command 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=1380006527-2599-7-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