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.eggle...@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

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
+
+
-- 
1.7.5.4


_______________________________________________
Openembedded-core mailing list
Openembedded-core@lists.openembedded.org
http://lists.linuxtogo.org/cgi-bin/mailman/listinfo/openembedded-core

Reply via email to