From 3f1ff6b730ec17ce635fcf38770358d8042e80b4 Mon Sep 17 00:00:00 2001 From: Sascha Hauer Date: Fri, 1 Apr 2011 15:13:55 +0200 Subject: move version_string to seperate file 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 --- common/Makefile | 1 + common/command.c | 4 ---- common/console.c | 10 ++-------- common/console_simple.c | 2 ++ common/version.c | 13 +++++++++++++ 5 files changed, 18 insertions(+), 12 deletions(-) create mode 100644 common/version.c (limited to 'common') diff --git a/common/Makefile b/common/Makefile index 6cc61435d5..d8c302f0a3 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 f1aeeb9df0..ab02ed5322 100644 --- a/common/command.c +++ b/common/command.c @@ -33,12 +33,8 @@ #include #include #include -#include #include -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 5548a409ac..d33a249c92 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 1b58deaff7..7304d8ee05 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 0000000000..945475fc3d --- /dev/null +++ b/common/version.c @@ -0,0 +1,13 @@ +#include +#include +#include + +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")); +} + -- cgit v1.2.3