############################################################################
#
# 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.
#
############################################################################


clear

while :
do

  clear

  echo
  echo "Porting"
  echo "-------"
  echo
  echo "WARNING: The porting option is only experimental and for advanced"
  echo "users only.  The scripts use a general set of rules for porting a"
  echo "ROM, so additional steps may need to be performed manually by the"
  echo "user for the ROM to be ported properly."
  echo
  echo "If you are new to ROM development, then do not use this option"
  echo "until you have built some basic (non-ported!) ROMs and have"
  echo "understood how they work!"
  echo
  echo "Enter a choice:"
  echo 

  echo "  a = Port ROM from another device"
  echo "  e = Extract kernel and modules from another ROM"
  echo "  x = Exit"
  echo
  echo -n "? "

  read enterLetter

  if [ "$enterLetter" == "a" ]
  then
    scripts/port_rom
    
    if [ "$?" == "1" ]
    then
      continue
    fi

  elif [ "$enterLetter" == "e" ]
  then
    scripts/call_extract_kernel_and_modules
  elif [ "$enterLetter" == "x" ]
  then
    exit 0
  else 
    echo "Invalid option"
    continue
  fi

  scripts/press_enter

done
