#!/bin/sh 

# nasty pandora hack for Zaxxon #7549: switch to 16bpp now because:
# - X startup will glitch due to similar mode change hack in slim-init
# - SGX may init in 32bpp mode and after switch to 16bpp,
#   it will still render at 32bpp (yet another bug..)
fbset -depth 16

if grep -qE '\s?psplash=false\s?' /proc/cmdline; then
	echo "Boot splashscreen disabled"
	exit 0;
fi

if [ -e /etc/rcS.d/S40configure ]; then
	echo "First boot, splashscreen disabled"
	exit 0;
fi

. /etc/init.d/functions
. /etc/default/psplash

export TMPDIR=/mnt/.splash
mount tmpfs -t tmpfs $TMPDIR -o,size=40k

# temporary hack - separate logo for experimental kernel
kernel_major=`uname -r | cut -c 1`
if [ "$kernel_major" = "3" ]; then
	PARAMS="$PARAMS -2"
fi

/usr/bin/psplash $PARAMS &

# Timetrap against hanging with splash hiding console messages.
(sleep 600; psplash-write "QUIT") &
