#!/bin/sh

#     DESCRIPTION
#
# Generate in instrumental chroot /bootsplash/bootsplash file


#     REQUIRES
#
# Install to instrumental chroot package design-bootsplash-*


#     INFO
#
# This bootsplash file will be used in initramfs image.
# This is first step. Next see file initfs.

NAME="bootsplash"

verbose()
{
    if [ -n "$GLOBAL_VERBOSE" ]; then
        echo "HOOK: $NAME: $@"
    fi
}

RESOLUTION_DEFAULT="800x600"

verbose "has started"

if [ -d "/etc/bootsplash/themes/current/config" -a -x "/sbin/splash" ]; then
	themefile="/etc/bootsplash/themes/current/config/bootsplash-$RESOLUTION_DEFAULT.cfg"
	if [ -f "$themefile" ]; then
		mkdir /bootsplash
    	    /sbin/splash -f -s "$themefile" > /bootsplash/bootsplash
	fi
fi

verbose "finished"
