Mahmoud Bazzal | 69a0a24 | 2019-08-22 17:36:17 +0200 | [diff] [blame] | 1 | #!/usr/bin/env bash |
| 2 | #******************************************************************************* |
| 3 | # Copyright (c) 2019 Dortmund University of Applied Sciences and Arts and others. |
| 4 | # |
| 5 | # This program and the accompanying materials are made |
| 6 | # available under the terms of the Eclipse Public License 2.0 |
| 7 | # which is available at https://www.eclipse.org/legal/epl-2.0/ |
| 8 | # |
| 9 | # SPDX-License-Identifier: EPL-2.0 |
| 10 | # |
| 11 | # Contributors: |
| 12 | # Dortmund University of Applied Sciences and Arts - initial API and implementation |
| 13 | #******************************************************************************* |
Mahmoud Bazzal | f1a3feb | 2019-08-22 20:39:05 +0200 | [diff] [blame] | 14 | echo "RTFP patching Script version 1.0" |
Mahmoud Bazzal | 69a0a24 | 2019-08-22 17:36:17 +0200 | [diff] [blame] | 15 | echo "welcome to the world of tomorrow" |
| 16 | |
Mahmoud Bazzal | f1a3feb | 2019-08-22 20:39:05 +0200 | [diff] [blame] | 17 | #Path to the cloned RTFP repo |
| 18 | #RTFP_REPO_PATH="~/boardExec" |
| 19 | KERNEL_FOLDER="RTFP_RTOS_KERNEL_PATCHED" |
| 20 | echo "*****************************************************" |
| 21 | echo "cloning dependencies..." |
| 22 | #clone FreeRTOS kernel from svn |
| 23 | echo "cloning FreeRTOS kernel" |
| 24 | svn checkout svn://svn.code.sf.net/p/freertos/code/trunk@2712 $KERNEL_FOLDER > /dev/null |
| 25 | #Clone original port repo |
| 26 | echo "cloning contribute Epiphany port" |
| 27 | mkdir Epiphay_port |
| 28 | cd Epiphay_port |
| 29 | git clone https://github.com/mahmood1994ha/FreeRTOS.git |
| 30 | cd FreeRTOS |
| 31 | #create patch file of original port commit |
| 32 | git format-patch -1 78e8efaf3ca9aa56c389e00411f2c3bcb0222b64 |
| 33 | PORT_PATCH_FILE="0001-runs-on-the-epiphany-processor-core-as-present-on-th.patch" |
| 34 | #apply the patch to kernel |
| 35 | echo "exit FreeRTOS" |
| 36 | cd .. |
| 37 | echo "exit Epiphay_port" |
| 38 | cd .. |
| 39 | echo "enter KERNEL_FOLDER" |
| 40 | cd $KERNEL_FOLDER |
| 41 | echo "enter patch dir" |
| 42 | cd FreeRTOS |
| 43 | echo "*****************************************************" |
| 44 | echo "patching port" |
| 45 | patch -p2 < ../../Epiphay_port/FreeRTOS/0001-runs-on-the-epiphany-processor-core-as-present-on-th.patch |
| 46 | #patch Epiphany port with RTFP fix |
| 47 | cd ../../ |
| 48 | patch $KERNEL_FOLDER/FreeRTOS/Source/portable/GCC/Epiphany/port.c < port_patch.patch |
| 49 | patch $KERNEL_FOLDER/FreeRTOS/Source/portable/GCC/Epiphany/portasm.s < portasm.patch |
| 50 | echo "port patched with RTFP fix" |
| 51 | echo "*****************************************************" |
| 52 | echo "cleaning kernel and port" |
| 53 | pwd |
Mahmoud Bazzal | 69a0a24 | 2019-08-22 17:36:17 +0200 | [diff] [blame] | 54 | echo "***************************************" |
| 55 | echo "done" |