#!/bin/sh

# new header not using prereqs
if [ "$1" = "prereqs" ]; then
  echo ""
  exit 0
fi

. /scripts/functions
. /conf/tcos.conf
. /conf/tcos-run-functions

# kill usplash if cmdline have "nousplash" or "nosplash"
for x in $(cat /proc/cmdline); do
        case $x in
        nosplash)
		KILL_SPLASH=true
                ;;
        nousplash)
		KILL_SPLASH=true
                ;;
        esac
done

if [ "$KILL_SPLASH" = "true" ] ; then
  echo -e "#!/bin/sh\nexit 0" > /scripts/init-top/framebuffer
  [ -e /scripts/init-premount/framebuffer ] && echo -e "#!/bin/sh\nexit 0" > /scripts/init-premount/framebuffer
  [ -e /scripts/init-top/usplash ] && echo -e "#!/bin/sh\nexit 0" > /scripts/init-top/usplash
  [ -e /scripts/init-top/plymouth ] && echo -e "#!/bin/sh\nexit 0" > /scripts/init-top/plymouth
  [ -e /scripts/init-premount/plymouth ] && echo -e "#!/bin/sh\nexit 0" > /scripts/init-premount/plymouth
  [ -e /scripts/init-top/00_splashy ] && echo -e "#!/bin/sh\nexit 0" > /scripts/init-top/00_splashy
  kill_splash
fi


