#
#
#
#  splashy_update commands
#
#cmd = "progress",
#cmd = "PROGRESS",
#cmd = "print",
#cmd = "TEXT",
#cmd = "scroll",
#cmd = "SCROLL",
#cmd = "CLEAR",
#cmd = "clear",
#cmd = "chvt",
#cmd = "allowchvt",
#cmd = "exit",
#cmd = "QUIT",
#cmd = "getstring",
#cmd = "getpass",
#cmd = "chroot",


if [ -x /sbin/splashy_update ]; then

    rm -rf $DESTDIR/etc/splashy
    mkdir -p $DESTDIR/etc/splashy/themes

    cat << EOF > $DESTDIR/etc/splashy/config.xml
<?xml version="1.0" encoding="UTF-8"?>
<!-- Automatically generated by gentcos. Do not edit -->
<splashy>
    <!-- themes directory: conventional path /etc/splashy/themes -->
    <themes>/etc/splashy/themes</themes>
    <!-- current theme could be relative the themes defined above or full path -->
    <current_theme>tcos</current_theme>
    <!-- full path to theme to fall back in case of problems. DO NOT CHANGE -->
    <default_theme>/etc/splashy/themes/default</default_theme>
    <pid>/etc/splashy/splashy.pid</pid>
</splashy>
EOF

    cp -ra /etc/splashy/themes/tcos $DESTDIR/etc/splashy/themes


    cpifexists /sbin/splashy /sbin
    cpifexists /sbin/splashy_chvt /sbin
    cpifexists /sbin/splashy_update /sbin

    mv $DESTDIR/usr/lib/directfb-1.0-0/ $DESTDIR/lib/directfb-1.0-0/
    cat << EOF > $DESTDIR/scripts/init-top/00_splashy
#!/bin/sh

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

mkdir -p /usr/lib
ln -s /lib/directfb-1.0-0 /usr/lib/directfb-1.0-0


EOF
chmod +x $DESTDIR/scripts/init-top/00_splashy
fi
