Patchwork [2/2] scripts/contrib: add a script to create a psplash image header

login
register
mail settings
Submitter Paul Eggleton
Date Dec. 19, 2011, 5:43 p.m.
Message ID <213394d20dfff3710de9e9c8953a85303a226c9b.1324316137.git.paul.eggleton@linux.intel.com>
Download mbox | patch
Permalink /patch/17263/
State New
Headers show

Comments

Paul Eggleton - Dec. 19, 2011, 5:43 p.m.
Adds a convenience script for converting an image file to a header
suitable for use in psplash, as well as a comment pointing to the
script in the default OpenEmbedded psplash image header.

Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
---
 meta/recipes-core/psplash/files/psplash-img.h |    5 ++++-
 scripts/contrib/make-psplash-img-header.sh    |   22 ++++++++++++++++++++++
 2 files changed, 26 insertions(+), 1 deletions(-)
 create mode 100755 scripts/contrib/make-psplash-img-header.sh

Patch

diff --git a/meta/recipes-core/psplash/files/psplash-img.h b/meta/recipes-core/psplash/files/psplash-img.h
index 1c85a72..9530131 100644
--- a/meta/recipes-core/psplash/files/psplash-img.h
+++ b/meta/recipes-core/psplash/files/psplash-img.h
@@ -1,4 +1,7 @@ 
-/* OpenEmbedded logo image for psplash */
+/* OpenEmbedded logo image for psplash
+ *
+ * Created using scripts/contrib/make-psplash-img-header.sh
+ */
 
 /* GdkPixbuf RGBA C-Source image dump 1-byte-run-length-encoded */
 
diff --git a/scripts/contrib/make-psplash-img-header.sh b/scripts/contrib/make-psplash-img-header.sh
new file mode 100755
index 0000000..23a825d
--- /dev/null
+++ b/scripts/contrib/make-psplash-img-header.sh
@@ -0,0 +1,22 @@ 
+#!/bin/sh
+# Creates a header file from an image suitable for building into psplash
+# Derived from make-image-header.sh from the psplash project
+
+if [ "$1" = "" ] || [ ! -f $1 ] ; then
+	echo "Please specify an input image"
+	exit 1
+fi
+
+res=`which gdk-pixbuf-csource 2>/dev/null`
+if [ $? -ne 0 ] ; then
+	echo "Please install gdk-pixbuf-csource (e.g. libgdk-pixbuf2.0-dev package on Ubuntu/Debian)"
+	exit 1
+fi
+
+imageh="psplash-img.h"
+name="POKY_IMG"
+echo "Writing psplash image header to $imageh"
+gdk-pixbuf-csource --macros $1 > $imageh.tmp
+sed -e "s/MY_PIXBUF/${name}/g" -e "s/guint8/uint8/g" $imageh.tmp > $imageh && rm $imageh.tmp
+
+