mail archive of the barebox mailing list
 help / color / mirror / Atom feed
From: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
To: barebox@lists.infradead.org
Subject: [PATCH 3/3] defaultenv-2: create a specific defaultenv for splash
Date: Tue, 13 Jan 2015 07:21:10 +0100	[thread overview]
Message-ID: <1421130070-31704-3-git-send-email-plagnioj@jcrosoft.com> (raw)
In-Reply-To: <1421130070-31704-1-git-send-email-plagnioj@jcrosoft.com>

This will allow to factorize splash init

Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
---
 arch/arm/boards/at91sam9m10ihd/env/init/splash |  8 --------
 common/Kconfig                                 |  5 +++++
 defaultenv/Makefile                            |  1 +
 defaultenv/defaultenv-2-splash/init/splash     | 15 +++++++++++++++
 defaultenv/defaultenv-2-splash/rc.d/010-splash |  1 +
 defaultenv/defaultenv.c                        |  2 ++
 6 files changed, 24 insertions(+), 8 deletions(-)
 delete mode 100644 arch/arm/boards/at91sam9m10ihd/env/init/splash
 create mode 100644 defaultenv/defaultenv-2-splash/init/splash
 create mode 120000 defaultenv/defaultenv-2-splash/rc.d/010-splash

diff --git a/arch/arm/boards/at91sam9m10ihd/env/init/splash b/arch/arm/boards/at91sam9m10ihd/env/init/splash
deleted file mode 100644
index 18e74df..0000000
--- a/arch/arm/boards/at91sam9m10ihd/env/init/splash
+++ /dev/null
@@ -1,8 +0,0 @@
-#!/bin/sh
-
-splash=/env/splash.png
-
-if [ -f ${splash} -a -e /dev/fb0 ]; then
-	splash -o ${splash}
-	fb0.enable=1
-fi
diff --git a/common/Kconfig b/common/Kconfig
index 00e4f36..6e19e9f 100644
--- a/common/Kconfig
+++ b/common/Kconfig
@@ -650,6 +650,11 @@ config DEFAULT_ENVIRONMENT_GENERIC_NEW_DFU
 	depends on USB_GADGET_DFU
 	default y
 
+config DEFAULT_ENVIRONMENT_GENERIC_NEW_SPLASH
+	bool
+	depends on CMD_SPLASH
+	default y
+
 config DEFAULT_ENVIRONMENT_GENERIC
 	bool
 	depends on !HAVE_DEFAULT_ENVIRONMENT_NEW
diff --git a/defaultenv/Makefile b/defaultenv/Makefile
index fc679eb..03d241c 100644
--- a/defaultenv/Makefile
+++ b/defaultenv/Makefile
@@ -1,6 +1,7 @@
 bbenv-$(CONFIG_DEFAULT_ENVIRONMENT_GENERIC_NEW) += defaultenv-2-base
 bbenv-$(CONFIG_DEFAULT_ENVIRONMENT_GENERIC_NEW_MENU) += defaultenv-2-menu
 bbenv-$(CONFIG_DEFAULT_ENVIRONMENT_GENERIC_NEW_DFU) += defaultenv-2-dfu
+bbenv-$(CONFIG_DEFAULT_ENVIRONMENT_GENERIC_NEW_SPLASH) += defaultenv-2-splash
 bbenv-$(CONFIG_DEFAULT_ENVIRONMENT_GENERIC) += defaultenv-1
 obj-$(CONFIG_DEFAULT_ENVIRONMENT) += defaultenv.o
 extra-y += barebox_default_env barebox_default_env.h barebox_default_env$(DEFAULT_COMPRESSION_SUFFIX)
diff --git a/defaultenv/defaultenv-2-splash/init/splash b/defaultenv/defaultenv-2-splash/init/splash
new file mode 100644
index 0000000..f70804d
--- /dev/null
+++ b/defaultenv/defaultenv-2-splash/init/splash
@@ -0,0 +1,15 @@
+#!/bin/sh
+
+img="/env/splash.png"
+
+if [ ! -e ${img} ]; then
+	return
+fi
+
+splash ${img}
+
+if [ $? = 0 ]; then
+	fb0.enable=1
+else
+	echo "Cannot show splash image"
+fi
diff --git a/defaultenv/defaultenv-2-splash/rc.d/010-splash b/defaultenv/defaultenv-2-splash/rc.d/010-splash
new file mode 120000
index 0000000..f00f86e
--- /dev/null
+++ b/defaultenv/defaultenv-2-splash/rc.d/010-splash
@@ -0,0 +1 @@
+../init/splash
\ No newline at end of file
diff --git a/defaultenv/defaultenv.c b/defaultenv/defaultenv.c
index 3b4efcf..712502d 100644
--- a/defaultenv/defaultenv.c
+++ b/defaultenv/defaultenv.c
@@ -48,6 +48,8 @@ static void defaultenv_add_base(void)
 		defaultenv_append_directory(defaultenv_2_menu);
 	if (IS_ENABLED(CONFIG_DEFAULT_ENVIRONMENT_GENERIC_NEW_DFU))
 		defaultenv_append_directory(defaultenv_2_dfu);
+	if (IS_ENABLED(CONFIG_DEFAULT_ENVIRONMENT_GENERIC_NEW_SPLASH))
+		defaultenv_append_directory(defaultenv_2_splash);
 	if (IS_ENABLED(CONFIG_DEFAULT_ENVIRONMENT_GENERIC))
 		defaultenv_append_directory(defaultenv_1);
 }
-- 
2.1.3


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

  parent reply	other threads:[~2015-01-13  6:21 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-01-13  6:19 [PATCH 0/3] defaultenv2: introduce init order Jean-Christophe PLAGNIOL-VILLARD
2015-01-13  6:21 ` [PATCH 1/3] defaultenv-2: fix misplace NV dir in env Jean-Christophe PLAGNIOL-VILLARD
2015-01-13  6:21   ` [PATCH 2/3] defaultenv-2: introduce /env/rc.d Jean-Christophe PLAGNIOL-VILLARD
2015-01-13  8:25     ` Sascha Hauer
2015-01-13  8:29       ` Jean-Christophe PLAGNIOL-VILLARD
2015-01-13  9:12         ` Jan Lübbe
2015-01-13  9:22           ` Jean-Christophe PLAGNIOL-VILLARD
2015-01-13  6:21   ` Jean-Christophe PLAGNIOL-VILLARD [this message]
2015-01-13  8:11   ` [PATCH 1/3] defaultenv-2: fix misplace NV dir in env 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=1421130070-31704-3-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