Commit 6b76a45c authored by Thanassis Tsiodras's avatar Thanassis Tsiodras

Merge branch 'addons-freertos' into 'master'

FreeRTOS added to add-ons

See merge request !3
parents 0f4c4846 12ba02e3
function InstallBSP() {
DESCRIPTION="$1"
URL="$2"
BASE="$3"
FOLDER="${BASE}/$4"
echo '[-] This will install '"${DESCRIPTION}"','
echo '[-] under:'
echo '[-] '
echo '[-] '"${FOLDER}"
echo '[-] '
[ -e "${FOLDER}" ] && { \
echo '[-] It will remove anything that is currently there.'
echo '[-] '
}
echo -n '[-] Are you sure you want this? (y/n) '
#!/bin/bash
DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
# shellcheck source=../install/common.sh
. "${DIR}/../install/common.sh"
function CheckTargetFolder() {
local DESCRIPTION="$1"
local FOLDER="$2"
echo "[-]"
echo "[-] This script will install ${DESCRIPTION}"
echo "[-] under:"
echo "[-]"
echo "[-] ${FOLDER}"
echo "[-]"
if [ -e "${FOLDER}" ] ; then
echo "[-] WARNING: It will remove everything that is currently there."
echo "[-]"
fi
echo -n "[-] Are you sure you want this? (y/n)"
read -r ANS
if [ "$ANS" != "y" ] ; then
echo '[-] Response was not "y", aborting...'
exit 1
fi
sudo rm -rf "${FOLDER}" 2>/dev/null
wget -q -O - "${URL}" | \
( cd "${BASE}" || exit 1 ; sudo tar jxvf - )
}
function DownloadAndExtract() {
local DESCRIPTION="$1"
local URL="$2"
local PREFIX="${3:-/opt}"
local COMPRESSION="${4:-j}"
echo "[-]"
echo "[-] Downloading and uncompressing ${DESCRIPTION}..."
echo "[-]"
if ! wget -q --show-progress -O - "${URL}" | \
( cd "${PREFIX}" || exit 1 ; sudo tar "xv${COMPRESSION}f" - )
then
echo "Downloading ${DESCRIPTION} has failed."
echo Aborting...
exit 1
fi
}
function InstallBSP() {
local DESCRIPTION="$1"
local URL="$2"
local BASE="$3"
local FOLDER="${BASE}/$4"
CheckTargetFolder "$DESCRIPTION" "$FOLDER"
DownloadAndExtract "$DESCRIPTION" "$URL" "$BASE"
}
function DownloadToTemp() {
local DESCRIPTION="$1"
local URL="$2"
local TMP_DIR="${3:-/tmp}"
DOWNLOADED_FILE=$(mktemp --tmpdir="$TMP_DIR")
echo "[-]"
echo "[-] Downloading ${DESCRIPTION}..."
echo "[-]"
if ! wget -q --show-progress -O "${DOWNLOADED_FILE}" "${URL}"
then
echo "Downloading ${DESCRIPTION} has failed."
echo "Aborting..."
exit 1
fi
}
#!/bin/bash
DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
# shellcheck source=common.sh
. "${DIR}/common.sh"
DESCRIPTION="FreeRTOS"
FREERTOS_VERSION="10.2.1"
PREFIX="/opt"
INSTALL_PATH="$PREFIX/FreeRTOSv$FREERTOS_VERSION"
CheckTargetFolder "${DESCRIPTION}" "${INSTALL_PATH}"
DownloadToTemp "${DESCRIPTION}" "https://sourceforge.net/projects/freertos/files/FreeRTOS/V${FREERTOS_VERSION}/FreeRTOSv${FREERTOS_VERSION}.zip/download"
echo "[-]"
echo "[-] Installing FreeRTOS..."
echo "[-]"
sudo unzip "$DOWNLOADED_FILE" -d "$PREFIX"
rm "$DOWNLOADED_FILE"
echo "[-] Creating FREERTOS_PATH enviroment variable"
UpdatePROFILE "export FREERTOS_PATH=\"$INSTALL_PATH\""
echo "[-] Reload terminal (or source ~/.bashrc.taste) to apply change"
#!/bin/bash
DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
# shellcheck source=common.sh
. "${DIR}/common.sh"
echo "[-] Checking if Gaisler's RTEMS 4.10 is already under /opt/rtems-4.10..."
if [ -e /opt/rtems-4.10 ] ; then
echo '[-] /opt/rtems-4.10 is there already. Aborting...'
exit 1
fi
DESCRIPTION="Gaisler's RTEMS 4.10"
PREFIX="/opt"
INSTALL_PATH="$PREFIX/rtems-4.10"
URL="http://www.gaisler.com/j25/anonftp/rcc/bin/linux/sparc-rtems-4.10-gcc-4.4.6-1.2.21-linux.tar.bz2"
echo "[-] Downloading and uncompressing Gaisler's RTEMS 4.10..."
echo "[-]"
cd /opt || exit 1
wget -q -O - http://www.gaisler.com/j25/anonftp/rcc/bin/linux/sparc-rtems-4.10-gcc-4.4.6-1.2.21-linux.tar.bz2 | sudo tar jxvf -
if [ $? -ne 0 ] ; then
echo "Downloading Gaisler's RTEMS 4.10 toolchain has failed."
echo Aborting...
exit 1
fi
CheckTargetFolder "${DESCRIPTION}" "${INSTALL_PATH}"
DownloadAndExtract "${DESCRIPTION}" "${URL}" "${PREFIX}"
#!/bin/bash
DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
. "${DIR}/common.sh"
echo "[-] Checking if Gaisler's RCC1.3-rc4 is already under /opt/..."
if [ -e /opt/rcc-1.3-rc4 ] ; then
echo '[-] /opt/rcc-1.3-rc4 is there already. Aborting...'
exit 1
fi
echo "[-] Downloading and uncompressing Gaisler's RCC1.3-rc4..."
echo "[-]"
cd /opt || exit 1
wget -q -O - https://www.gaisler.com/anonftp/rcc/bin/linux/sparc-rtems-5-gcc-7.2.0-1.3-rc4-linux.txz | sudo tar Jxvf -
if [ $? -ne 0 ] ; then
echo "Downloading Gaisler's RCC1.3-rc4 toolchain has failed."
echo Aborting...
exit 1
fi
#!/bin/bash
DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
# shellcheck source=common.sh
. "${DIR}/common.sh"
echo "[-] Checking if Gaisler's RCC1.3-rc5 is already under /opt/..."
if [ -e /opt/rcc-1.3-rc5-gcc ] ; then
echo '[-] /opt/rcc-1.3-rc5-gcc is there already. All good.'
exit 1
fi
DESCRIPTION="Gaisler's RCC1.3-rc5"
PREFIX="/opt"
INSTALL_PATH="$PREFIX/rcc-1.3.-rc5"
URL="https://www.gaisler.com/anonftp/rcc/bin/linux/sparc-rtems-5-gcc-7.2.0-1.3-rc5-linux.txz"
echo "[-] Downloading and uncompressing Gaisler's RCC1.3-rc5-gcc..."
echo "[-]"
cd /opt || exit 1
wget -q -O - https://www.gaisler.com/anonftp/rcc/bin/linux/sparc-rtems-5-gcc-7.2.0-1.3-rc5-linux.txz | sudo tar Jxvf -
if [ $? -ne 0 ] ; then
echo "Downloading Gaisler's RCC1.3-rc5-gcc toolchain has failed."
echo Aborting...
exit 1
fi
CheckTargetFolder "${DESCRIPTION}" "${INSTALL_PATH}"
DownloadAndExtract "${DESCRIPTION}" "${URL}" "${PREFIX}" "J"
#!/bin/bash
DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
# shellcheck source=common.sh
. "${DIR}/common.sh"
DESCRIPTION="Gaisler's RCC1.3-rc6"
PREFIX="/opt"
INSTALL_PATH="$PREFIX/rcc-1.3.-rc6"
URL="https://www.gaisler.com/anonftp/rcc/bin/linux/sparc-rtems-5-gcc-7.2.0-1.3-rc6-linux.txz"
CheckTargetFolder "${DESCRIPTION}" "${INSTALL_PATH}"
DownloadAndExtract "${DESCRIPTION}" "${URL}" "${PREFIX}" "J"
#!/bin/bash
DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
. ${DIR}/common.sh
# shellcheck source=common.sh
. "${DIR}/common.sh"
# Fetch and install latest AdaCore ARM release
SIG=$(/usr/gnat/bin/arm-eabi-gcc -v 2>&1 | tail -1)
......@@ -24,5 +26,4 @@ if [ "${SIG}" != "gcc version 6.3.1 20170510 (for GNAT GPL 2017 20170515) (GCC)
fi
# Add to PATH
PATH_CMD='export PATH=$PATH:'"/usr/gnat/bin"
UpdatePATH
UpdatePROFILE "export PATH=\$PATH:/usr/gnat/bin"
#!/bin/bash
DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
# shellcheck source=common.sh
. "${DIR}/common.sh"
InstallBSP \
......
#!/bin/bash
DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
# shellcheck source=common.sh
. "${DIR}/common.sh"
InstallBSP \
......
#!/bin/bash
DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
. "${DIR}/common.sh"
echo "[-] Checking if Texas Instruments MSP430-GCC is already under /opt/msp430-gcc..."
echo "[-]"
# shellcheck source=common.sh
. "${DIR}/common.sh"
if [ -e /opt/msp430-gcc ] ; then
echo '[-] /opt/msp430-gcc is there already. Aborting...'
exit 1
fi
DESCRIPTION="MSP430 GCC Toolchain"
INSTALL_PATH="/opt/msp430-gcc"
echo "[-] No MSP430-GCC present - installing."
CheckTargetFolder "${DESCRIPTION}" "${INSTALL_PATH}"
MACHINE_TYPE=`uname -m`
if [ ${MACHINE_TYPE} == 'x86_64' ]; then
ARCH_INFIX="-x64"
echo "[-] Selected 64bit version."
MACHINE_TYPE=$(uname -m)
if [ "${MACHINE_TYPE}" == 'x86_64' ]; then
ARCH_INFIX="-x64"
echo "[-] Selected 64bit version."
else
ARCH_INFIX=""
echo "[-] Selected 32bit version."
ARCH_INFIX=""
echo "[-] Selected 32bit version."
fi
echo "[-]"
echo "[-] Downloading MSP430-GCC..."
echo "[-]"
cd ~/Downloads || exit 1
wget -q -O msp430-gcc-installer.run http://software-dl.ti.com/msp430/msp430_public_sw/mcu/msp430/MSPGCC/8_3_1_0/export/msp430-gcc-full-linux${ARCH_INFIX}-installer-8.3.1.0.run
if [ $? -ne 0 ] ; then
echo "Downloading MSP430-GCC toolchain has failed."
echo Aborting...
exit 1
fi
DownloadToTemp "${DESCRIPTION}" http://software-dl.ti.com/msp430/msp430_public_sw/mcu/msp430/MSPGCC/8_3_1_0/export/msp430-gcc-full-linux${ARCH_INFIX}-installer-8.3.1.0.run
echo "[-]"
echo "[-] Installing MSP430-GCC..."
echo "[-]"
chmod +x msp430-gcc-installer.run
sudo ./msp430-gcc-installer.run \
chmod +x "${DOWNLOADED_FILE}"
sudo "${DOWNLOADED_FILE}" \
--mode unattended \
--unattendedmodeui minimal \
--prefix /opt/msp430-gcc
rm msp430-gcc-installer.run
rm "${DOWNLOADED_FILE}"
echo "[-] Appending /opt/msp430-gcc/bin to PATH"
echo -e "\n# MSP-430 support\nexport PATH=\$PATH:/opt/msp430-gcc/bin" >> ~/.bashrc.taste
echo "[-] Appending ${INSTALL_PATH}/bin to PATH"
UpdatePROFILE "export PATH=\$PATH:${INSTALL_PATH}/bin"
echo "[-] Reload terminal (or source ~/.bashrc.taste) to apply change"
#!/bin/bash
export DISABLE_TASTE_BANNER=1
TASTE_PATHS=$HOME/.bashrc.taste
PREFIX=$HOME/tool-inst
TASTE_PROFILE=$HOME/.bashrc.taste
# shellcheck disable=SC1090
[ -e "${TASTE_PROFILE}" ] && . "${TASTE_PROFILE}"
[ -e $HOME/.bashrc.taste ] && . $HOME/.bashrc.taste
UpdatePROFILE() {
if [ -z "$1" ] ; then
echo You forgot to pass argument. Aborting...
exit 1
fi
grep "$1$" "${TASTE_PROFILE}" >/dev/null || echo "$1" >> "${TASTE_PROFILE}"
}
# kept for now for backward compatibility
UpdatePATH() {
if [ -z "${PATH_CMD}" ] ; then
echo You forgot to set your PATH_CMD. Aborting...
exit 1
fi
grep "${PATH_CMD}$" ${TASTE_PATHS} >/dev/null || echo "${PATH_CMD}" >> ${TASTE_PATHS}
UpdatePROFILE "${PATH_CMD}"
}
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment