fixed patch script

Signed-off-by: Mahmoud Bazzal <>
diff --git a/RTFParallella/ b/RTFParallella/
index 1d2113e..b3acef0 100644
--- a/RTFParallella/
+++ b/RTFParallella/
@@ -11,40 +11,45 @@
 #   Contributors:
 #        Dortmund University of Applied Sciences and Arts - initial API and implementation
-echo "Parallella Deployment Script version 1.0"
+echo "RTFP patching Script version 1.0"
 echo "welcome to the world of tomorrow"
-#Board connection parameters
-#SSH key file
-#path and file name inputs
-DEPOLYMENT_BINARY=${1?Error: no host binary given}
-#proper ssh, use this to open an ssh connection to parallella for execution
-#sudo ssh -p 32767 -i ~/.ssh/key
-#clear hostOfflad path before copying new files
-#transfer host and device binaries to parallella board
-echo "---------------------------------------"
-echo "copying binaries to remote board..."
-if [[ $? != 0 ]]; then
-  echo "Transfer failed!"
-  exit 1
-  echo "Transfer complete."
-echo "---------------------------------------"
-echo "Running program $HOST_BINARY"
-echo "***************************************"
-#run the binaries remotely on parallella
+#Path to the cloned RTFP repo
+echo "*****************************************************"
+echo "cloning dependencies..."
+#clone FreeRTOS kernel from svn
+echo "cloning FreeRTOS kernel"
+svn checkout svn:// $KERNEL_FOLDER > /dev/null
+#Clone original port repo
+echo "cloning contribute Epiphany port"
+mkdir Epiphay_port
+cd Epiphay_port
+git clone
+cd FreeRTOS
+#create patch file of original port commit
+git format-patch -1 78e8efaf3ca9aa56c389e00411f2c3bcb0222b64
+#apply the patch to kernel
+echo "exit FreeRTOS"
+cd ..
+echo "exit Epiphay_port"
+cd ..
+echo "enter KERNEL_FOLDER"
+echo "enter patch dir"
+cd FreeRTOS
+echo "*****************************************************"
+echo "patching port"
+patch -p2 < ../../Epiphay_port/FreeRTOS/0001-runs-on-the-epiphany-processor-core-as-present-on-th.patch 
+#patch Epiphany port with RTFP fix
+cd ../../
+patch $KERNEL_FOLDER/FreeRTOS/Source/portable/GCC/Epiphany/port.c < port_patch.patch 
+patch $KERNEL_FOLDER/FreeRTOS/Source/portable/GCC/Epiphany/portasm.s < portasm.patch
+echo "port patched with RTFP fix"
+echo "*****************************************************"
+echo "cleaning kernel and port"
 echo "***************************************"
 echo "done"
\ No newline at end of file