From mboxrd@z Thu Jan 1 00:00:00 1970 Return-path: Received: from mail-ey0-f177.google.com ([209.85.215.177]) by canuck.infradead.org with esmtps (Exim 4.72 #1 (Red Hat Linux)) id 1PVsvl-0001vv-Mb for barebox@lists.infradead.org; Thu, 23 Dec 2010 21:42:38 +0000 Received: by eyd9 with SMTP id 9so4316365eyd.36 for ; Thu, 23 Dec 2010 13:42:34 -0800 (PST) MIME-Version: 1.0 Date: Thu, 23 Dec 2010 22:42:34 +0100 Message-ID: From: Franck JULLIEN List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: multipart/mixed; boundary="===============2050211041==" Sender: barebox-bounces@lists.infradead.org Errors-To: barebox-bounces+u.kleine-koenig=pengutronix.de@lists.infradead.org Subject: [PATCH] Add a board specific fancy banner To: barebox@lists.infradead.org --===============2050211041== Content-Type: multipart/alternative; boundary=0015174bef2860bcdf04981abf28 --0015174bef2860bcdf04981abf28 Content-Type: text/plain; charset=ISO-8859-1 Hello, This is the first time I'm using git and submit a patch so if I made a mistake be cool :) This is a small patch allowing the user to define a fancy banner for barebox. I don't know if you'll use it but it's kind of an experience for me. I have ported barebox to the altera nios2 processor. I think I'll submit the corresponding patch on january. However, I'll need some advices to generate such a big (or lot of small) patch. Thanks, Franck. ----- from: franck JULLIEN Date: Thu, 23 Dec 2010 22:31:22 +0100 Subject: [PATCH] Add a board specific fancy banner --- common/Kconfig | 6 ++++++ common/console.c | 10 ++++++++++ 2 files changed, 16 insertions(+), 0 deletions(-) diff --git a/common/Kconfig b/common/Kconfig index 617f640..d46c8fc 100644 --- a/common/Kconfig +++ b/common/Kconfig @@ -248,6 +248,12 @@ config HUSH_FANCY_PROMPT Allow to set PS1 from the command line. PS1 can have several escaped commands like \h for CONFIG_BOARDINFO or \w for the current working directory. +config BOARD_BANNER + bool + prompt "allow a board specific fancy banner" + help + Allow to define a custom board banner (you must define BOARD_BANNER in your config.h) + config HUSH_GETOPT bool depends on SHELL_HUSH diff --git a/common/console.c b/common/console.c index 82786f2..8a830e3 100644 --- a/common/console.c +++ b/common/console.c @@ -46,7 +46,17 @@ EXPORT_SYMBOL(console_list); static void display_banner (void) { printf (RELOC("\n\n%s\n\n"), RELOC_VAR(version_string)); +#ifdef CONFIG_BOARD_BANNER +#ifdef BOARD_BANNER + printf(RELOC(BOARD_BANNER)); +#else +#define VT100_YELLOW "\033[1;33m" +#define VT100_RESET "\033[1;0m" + printf(RELOC("Board: " VT100_YELLOW CONFIG_BOARDINFO VT100_RESET "\n")); +#endif +#else printf(RELOC("Board: " CONFIG_BOARDINFO "\n")); +#endif } static int __early_initdata initialized = 0; -- 1.7.0.4 --0015174bef2860bcdf04981abf28 Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Hello,

This is the first time I'm using git and subm= it a patch so if I made a mistake be cool :)
This is a small patc= h allowing the user to define a fancy banner for barebox. I don't know<= /div>
if you'll use it but it's kind of an experience for me.
<= div>
I have ported barebox to the altera nios2 processor. I t= hink I'll submit the corresponding patch
on january. However,= I'll need some advices to generate such a big (or lot of small) patch.=

Thanks,
Franck.

----= -

from: franck JULLIEN <franck.jullien@gmail.com>
Date: Th= u, 23 Dec 2010 22:31:22 +0100
Subject: [PATCH] Add a board specific fancy banner

---
=A0common/Kconfig =A0 | =A0 =A06 ++++++
=A0co= mmon/console.c | =A0 10 ++++++++++
=A02 files changed, 16 inserti= ons(+), 0 deletions(-)

diff --git a/common/Kconfig b/common/Kconfig
= index 617f640..d46c8fc 100644
--- a/common/Kconfig
+++ = b/common/Kconfig
@@ -248,6 +248,12 @@ config HUSH_FANCY_PROMPT
=A0 = =A0Allow to set PS1 from the command line. PS1 can have several escaped com= mands
=A0 =A0like \h for CONFIG_BOARDINFO or \w for the current working dir= ectory.
=A0
+config BOARD_BANNER
+ bool
+ prompt "allow a board s= pecific fancy banner"
+ help=
+ =A0Allow to define a custom board banner (you must define BOARD_BANNER i= n your config.h)
+
=A0config HUSH_GETOPT
=A0 bool
=A0 depends on SHELL_HUSH
diff --git a/common/console.c b/common/console.c
index 82786f2..8a830e3 100644
--- a/common/console.c
+++ b/common/console.c
@@ -46,7 +46,17 @@ EXPORT_SYMBOL(consol= e_list);
=A0static void display_banner (void)
=A0{
=A0 pr= intf (RELOC("\n\n%s\n\n"), RELOC_VAR(version_string));
= +#ifdef CONFIG_BOARD_BANNER
+#ifdef BOARD_BANNER
+ printf(RELOC(BO= ARD_BANNER));
+#else
+#define VT100_YELLOW "\033[1;33m"
+#define = VT100_RESET "\033[1;0m"
+ prin= tf(RELOC("Board: " VT100_YELLOW CONFIG_BOARDINFO VT100_RESET &quo= t;\n"));
+#endif
+#else
=A0 printf(RELOC("Bo= ard: " CONFIG_BOARDINFO "\n"));
+#endif
=A0}
=A0
=A0static int __early_i= nitdata initialized =3D 0;
--=A0
1.7.0.4

=
--0015174bef2860bcdf04981abf28-- --===============2050211041== Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline _______________________________________________ barebox mailing list barebox@lists.infradead.org http://lists.infradead.org/mailman/listinfo/barebox --===============2050211041==--