blob: b3acef080fea73dc73f8a2a4841fb39624588215 [file] [log] [blame]
Mahmoud Bazzal69a0a242019-08-22 17:36:17 +02001#!/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 Bazzalf1a3feb2019-08-22 20:39:05 +020014echo "RTFP patching Script version 1.0"
Mahmoud Bazzal69a0a242019-08-22 17:36:17 +020015echo "welcome to the world of tomorrow"
16
Mahmoud Bazzalf1a3feb2019-08-22 20:39:05 +020017#Path to the cloned RTFP repo
18#RTFP_REPO_PATH="~/boardExec"
19KERNEL_FOLDER="RTFP_RTOS_KERNEL_PATCHED"
20echo "*****************************************************"
21echo "cloning dependencies..."
22#clone FreeRTOS kernel from svn
23echo "cloning FreeRTOS kernel"
24svn checkout svn://svn.code.sf.net/p/freertos/code/trunk@2712 $KERNEL_FOLDER > /dev/null
25#Clone original port repo
26echo "cloning contribute Epiphany port"
27mkdir Epiphay_port
28cd Epiphay_port
29git clone https://github.com/mahmood1994ha/FreeRTOS.git
30cd FreeRTOS
31#create patch file of original port commit
32git format-patch -1 78e8efaf3ca9aa56c389e00411f2c3bcb0222b64
33PORT_PATCH_FILE="0001-runs-on-the-epiphany-processor-core-as-present-on-th.patch"
34#apply the patch to kernel
35echo "exit FreeRTOS"
36cd ..
37echo "exit Epiphay_port"
38cd ..
39echo "enter KERNEL_FOLDER"
40cd $KERNEL_FOLDER
41echo "enter patch dir"
42cd FreeRTOS
43echo "*****************************************************"
44echo "patching port"
45patch -p2 < ../../Epiphay_port/FreeRTOS/0001-runs-on-the-epiphany-processor-core-as-present-on-th.patch
46#patch Epiphany port with RTFP fix
47cd ../../
48patch $KERNEL_FOLDER/FreeRTOS/Source/portable/GCC/Epiphany/port.c < port_patch.patch
49patch $KERNEL_FOLDER/FreeRTOS/Source/portable/GCC/Epiphany/portasm.s < portasm.patch
50echo "port patched with RTFP fix"
51echo "*****************************************************"
52echo "cleaning kernel and port"
53pwd
Mahmoud Bazzal69a0a242019-08-22 17:36:17 +020054echo "***************************************"
55echo "done"