#!/bin/sh

PREREQ=""

prereqs()
{
       echo "$PREREQ"
}

case $1 in
# get pre-requisites
prereqs)
       prereqs
       exit 0
       ;;
esac

CASPERNFSDEBUG=""
for x in $(cat /proc/cmdline) ; do
 case $x in
   *caspernfs-debug*)
    CASPERNFSDEBUG="yes"
  ;;
 esac
done
if [ "$CASPERNFSDEBUG" = "yes" ]; then
  if [ -x /sbin/usplash_write ]; then
          /sbin/usplash_write "QUIT"
  fi
  chvt 1
  if [ -x /bin/plymouth ] && plymouth --ping; then
          /bin/plymouth hide-splash > /dev/null 2>&1
  fi
fi

. /scripts/casper-functions
. /scripts/casper-helpers


# unionfs-fuse needs /dev to be bind-mounted for the duration of
# casper-bottom; udev's init script will take care of things after that
# umount here
if [ "${UNIONFS}" = unionfs-fuse ]; then
    umount "${rootmnt}/dev"
fi

if [ -x /sbin/usplash_write ]; then
        /sbin/usplash_write "QUIT"
fi
chvt 1
if [ -x /bin/plymouth ] && plymouth --ping; then
        /bin/plymouth hide-splash > /dev/null 2>&1
fi

if [ "$CASPERNFSDEBUG" = "yes" ]; then
  chvt 1
  /bin/sh
fi
