#!/bin/sh

PREREQ=""

prereqs()
{
        echo "$PREREQ"
}

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


. /usr/share/initramfs-tools/hook-functions


echo "Preparing the Fliwi embeded-root..."
system_root_tar="$CONFDIR/../../system_root.tar"
fliwi_in_memory_system_base_conf="$CONFDIR/../../fliwi-in-memory-system_base.conf"
EMBED_ROOt_tar=$DESTDIR/system_root.tar
cp $system_root_tar $EMBED_ROOt_tar
mkdir -p $DESTDIR/etc/fliwi-in-memory-system
cp $fliwi_in_memory_system_base_conf $DESTDIR/etc/fliwi-in-memory-system/base.conf
echo "DONE"

if [ ! -d "$DESTDIR/lib64" ]; then
  echo "Adding support for /lib64"
  if [ -e "$DESTDIR/lib64" ] || \
     [ -L "$DESTDIR/lib64" ]; then
    rm -f $DESTDIR/lib64
  fi
  ln -s /lib $DESTDIR/lib64
  echo "DONE"
fi

