#!/bin/sh
#
# (C)2007 Broadcom Corporation
# This script prepares a settop/dtv for the DirectFB driver.
#
# this script sets LD_LIBRARY_PATH environment variable
# and checks consistence of the system configuration
LD_LIBRARY_PATH=.:${LD_LIBRARY_PATH}
export LD_LIBRARY_PATH
PATH=.:${PATH}
export PATH

case $1 in
install)
		. nexus.install
	    [ -f "/usr/bin/nexus.974xx" ] && . /usr/bin/nexus.974xx
		# Specify DFB hotplug script instead of /sbin/stbhotplug
		#echo "HOTPLUG_DIR/dfbhotplug" > /proc/sys/kernel/hotplug
		echo "Done"
	;;
join)
    shift
	# Start whatever application is requested
	target=$1;
	shift
	exec ${target} $@ --dfb:module-dir=/usr/lib/directfb-1.7-1
	;;
*)
	# Run a platform-specific script in order to install drivers
	#[ -f "/usr/bin/nexus_user.974xx" ] && . /usr/bin/nexus_user.974xx

	# Start whatever application is requested
	target=$1;
	shift
	exec ${target} $@
	;;
esac
