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/16] move version_string to seperate file
Date: Fri,  8 Apr 2011 16:36:56 +0200	[thread overview]
Message-ID: <1302273422-6987-11-git-send-email-s.hauer@pengutronix.de> (raw)
In-Reply-To: <1302273422-6987-1-git-send-email-s.hauer@pengutronix.de>

In a noninteractive environment barebox will be compiled without
command support. So move version_string to a seperate file which
is compiled unconditionally.
Also, display the banner when the simple console support is used.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
---
 common/Makefile         |    1 +
 common/command.c        |    4 ----
 common/console.c        |   10 ++--------
 common/console_simple.c |    2 ++
 common/version.c        |   13 +++++++++++++
 include/common.h        |    1 +
 6 files changed, 19 insertions(+), 12 deletions(-)
 create mode 100644 common/version.c

diff --git a/common/Makefile b/common/Makefile
index 6cc6143..d8c302f 100644
--- a/common/Makefile
+++ b/common/Makefile
@@ -9,6 +9,7 @@ obj-$(CONFIG_POLLER)		+= poller.o
 
 obj-y += dlmalloc.o
 obj-y += clock.o
+obj-y += version.o
 obj-y += command.o
 obj-$(CONFIG_CONSOLE_FULL) += console.o
 obj-$(CONFIG_CONSOLE_SIMPLE) += console_simple.o
diff --git a/common/command.c b/common/command.c
index f1aeeb9..ab02ed5 100644
--- a/common/command.c
+++ b/common/command.c
@@ -33,12 +33,8 @@
 #include <linux/list.h>
 #include <init.h>
 #include <complete.h>
-#include <generated/utsrelease.h>
 #include <getopt.h>
 
-const char version_string[] =
-	"barebox " UTS_RELEASE " (" __DATE__ " - " __TIME__ ")";
-
 LIST_HEAD(command_list);
 EXPORT_SYMBOL(command_list);
 
diff --git a/common/console.c b/common/console.c
index 5548a40..d33a249 100644
--- a/common/console.c
+++ b/common/console.c
@@ -45,12 +45,6 @@ EXPORT_SYMBOL(console_list);
 #define CONSOLE_INIT_EARLY	1
 #define CONSOLE_INIT_FULL	2
 
-static void display_banner (void)
-{
-	printf (RELOC("\n\n%s\n\n"), RELOC_VAR(version_string));
-	printf(RELOC("Board: " CONFIG_BOARDINFO "\n"));
-}
-
 static int __early_initdata initialized = 0;
 
 static int console_std_set(struct device_d *dev, struct param_d *param,
@@ -169,7 +163,7 @@ int console_register(struct console_device *newcdev)
 
 #ifndef CONFIG_HAS_EARLY_INIT
 	if (first)
-		display_banner();
+		barebox_banner();
 #endif
 
 	return 0;
@@ -420,7 +414,7 @@ void early_console_start(const char *name, int baudrate)
 		early_console_init(base, baudrate);
 		INITDATA(initialized) = CONSOLE_INIT_EARLY;
 		INITDATA(early_console_base) = base;
-		display_banner();
+		barebox_banner();
 	}
 }
 
diff --git a/common/console_simple.c b/common/console_simple.c
index 1b58dea..7304d8e 100644
--- a/common/console_simple.c
+++ b/common/console_simple.c
@@ -152,6 +152,8 @@ int console_register(struct console_device *newcdev)
 		console = newcdev;
 		console_list.prev = console_list.next = &newcdev->list;
 		newcdev->list.prev = newcdev->list.next = &console_list;
+
+		barebox_banner();
 	}
 	return 0;
 }
diff --git a/common/version.c b/common/version.c
new file mode 100644
index 0000000..945475f
--- /dev/null
+++ b/common/version.c
@@ -0,0 +1,13 @@
+#include <common.h>
+#include <reloc.h>
+#include <generated/utsrelease.h>
+
+const char version_string[] =
+	"barebox " UTS_RELEASE " (" __DATE__ " - " __TIME__ ")";
+
+void barebox_banner (void)
+{
+	printf (RELOC("\n\n%s\n\n"), RELOC_VAR(version_string));
+	printf(RELOC("Board: " CONFIG_BOARDINFO "\n"));
+}
+
diff --git a/include/common.h b/include/common.h
index 35ad7b9..491bc98 100644
--- a/include/common.h
+++ b/include/common.h
@@ -219,6 +219,7 @@ int run_shell(void);
 int memory_display(char *addr, ulong offs, ulong nbytes, int size);
 
 extern const char version_string[];
+void barebox_banner(void);
 
 #define IOMEM(addr)	((void __force __iomem *)(addr))
 
-- 
1.7.2.3


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

  parent reply	other threads:[~2011-04-08 14:37 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-04-08 14:36 various cleanup patches Sascha Hauer
2011-04-08 14:36 ` [PATCH 01/16] fs: remove unused field 'type' from struct fs_driver_d Sascha Hauer
2011-04-08 14:36 ` [PATCH 02/16] mci: make it compile without info support Sascha Hauer
2011-04-08 14:36 ` [PATCH 03/16] ubi: do not use filep Sascha Hauer
2011-04-08 14:36 ` [PATCH 04/16] devfs: remove unused struct filep* argument from open/close Sascha Hauer
2011-04-08 14:36 ` [PATCH 05/16] fs: implement flush function Sascha Hauer
2011-04-08 14:36 ` [PATCH 06/16] devfs: factor out core devfs functionality Sascha Hauer
2011-04-08 14:36 ` [PATCH 07/16] nand: remove unused header file Sascha Hauer
2011-04-08 14:36 ` [PATCH 08/16] startup: we can only mount root and devfs when compiled in Sascha Hauer
2011-04-08 14:36 ` [PATCH 09/16] nand: remove unused nand_util file Sascha Hauer
2011-04-08 14:36 ` Sascha Hauer [this message]
2011-04-08 14:36 ` [PATCH 11/16] fs: use safe_strncpy instead of sprintf Sascha Hauer
2011-04-08 14:36 ` [PATCH 12/16] script: update git ignore file Sascha Hauer
2011-04-08 14:36 ` [PATCH 13/16] serial 16550: use xzalloc Sascha Hauer
2011-04-08 14:37 ` [PATCH 14/16] ARM: compile in image size and magic into barebox image Sascha Hauer
2011-04-10  4:33   ` Marc Reilly
2011-04-11  7:41     ` Sascha Hauer
2011-04-11  7:46       ` Robert Schwebel
2011-04-11  8:42       ` Marc Reilly
2011-04-08 14:37 ` [PATCH 15/16] commands: seperate usb command from usb core Sascha Hauer
2011-04-08 14:37 ` [PATCH 16/16] fs mount: fix error handling 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=1302273422-6987-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