#!/bin/sh

# HISTORY
#
# CRMS00229648 tcremel 20100506
#
# 2011/12/20   PRID369339 Ting He
#              Add new feature SW awareness
#
# 2013/01/24    PR261951 Jerry ZHOU
#               Reduce time of unavailability during boot time
##################################################
. /etc/init.d/rc.config
SEND_INFRA=/usr/bin/send_infra
JPG2FB=/usr/sbin/jpg2fb

if [[ ! -f $applicationManagerPid ]] || [[ ! -d /proc/$(cat $applicationManagerPid) ]]; then
	# application manager not running
	stepnum=`cat $stepFile`
	eval "splash=\${step${stepnum}Splash:-}"
	if [ "$splash" == "" ]
		then
		splash="-c 0x00000000"
# CRMS00229648 BEGIN
	else 
		if [ ! -s $splash ]
		then
		splash="-c 0x00400000"
		fi
# CRMS00229648 END
	fi
#PR261951 jerryzh+
# PR Id 369339 BEGIN
        [[ -f /etc/versions ]] && source /etc/versions
        VersionSoft=${VersionSoft:-"Unknown"}
#PR261951 jerryzh-                                                                                              
        $JPG2FB -t "$VersionSoft" -X 8 -Y 47  $splash        
        $JPG2FB -t "$*" -X 8 -Y 35  -a                       
else                                                         
        $SEND_INFRA init_message "$*"   
# PR Id 369339 END
                   
fi                    
