From patchwork Mon Dec 19 17:43:22 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: [2/2] scripts/contrib: add a script to create a psplash image header Date: Mon, 19 Dec 2011 17:43:22 -0000 From: Paul Eggleton X-Patchwork-Id: 17263 Message-Id: <213394d20dfff3710de9e9c8953a85303a226c9b.1324316137.git.paul.eggleton@linux.intel.com> To: openembedded-core@lists.openembedded.org 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 --- 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 + +