############################################################################
#
# Copyright (c) 2011 - dsixda (dislam@rocketmail.com)
#
# Android Kitchen is 100% free.  This script file is intended for personal
# and/or educational use only.  It may not be duplicated for monetary
# benefit or any other purpose without the permission of the developer.
#
############################################################################


dest_dir=$1
kitchen_dir=`pwd`

if [ "$dest_dir" == "" ]
then
  cd WORKING_*
  dest_dir=`pwd`
else
  cd $dest_dir
fi

if [ ! -e boot.img ]
then

  echo
  echo  "Warning: A valid boot.img is not found.  You have the option to add a"
  echo  "         'fake' boot.img so that the features of the kitchen can still"
  echo  "         function normally."
  echo 
  echo  "         This boot.img will be automatically removed from your ROM's"
  echo  "         ZIP file when it is built."
  echo 
  echo -n \
        "Add boot.img (y/n)? (default: y): "

  read add_it
  echo

  if [ "$add_it" != "n" ]
  then
    echo "Copying null boot.img ..."
    cp $kitchen_dir/tools/nullBoot.img $dest_dir/boot.img
  else
    echo "Cancelled"
  fi

  cd $kitchen_dir
  echo
fi
