From 62c73bb540d57842d2d52e2b8b5c8a449a5ad57f Mon Sep 17 00:00:00 2001 From: Dreaded_X Date: Thu, 9 Jan 2020 00:12:03 +0100 Subject: [PATCH] Added script to make sure required tools are installed/downloaded --- .gitignore | 2 ++ setup.sh | 25 +++++++++++++++++++++++++ 2 files changed, 27 insertions(+) create mode 100644 .gitignore create mode 100755 setup.sh diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..9f08d29 --- /dev/null +++ b/.gitignore @@ -0,0 +1,2 @@ +dfu-util +arm-none-eabi-gcc diff --git a/setup.sh b/setup.sh new file mode 100755 index 0000000..f062105 --- /dev/null +++ b/setup.sh @@ -0,0 +1,25 @@ +#!/bin/bash +command -v make >/dev/null 2>&1 || echo >&2 "Please install make" +command -v zasm >/dev/null 2>&1 || echo >&2 "Please install zasm" +command -v grep >/dev/null 2>&1 || echo >&2 "Please install grep" +command -v wget >/dev/null 2>&1 || echo >&2 "Please install wget" +command -v unzip >/dev/null 2>&1 || echo >&2 "Please install unzip" +command -v tar >/dev/null 2>&1 || echo >&2 "Please install tar" + +# @todo Check if pyserial is installed +# @todo Check if a serial terminal is installed +if [ "$(uname -r | sed -n 's/.*\( *Microsoft *\).*/\1/p')" == "Microsoft" ]; then + wget http://dfu-util.sourceforge.net/releases/dfu-util-0.9-win64.zip -O dfu-util.zip + unzip dfu-util.zip + mv dfu-util-0.9-win64 dfu-util + rm dfu-util.zip + # todo Check python3 +else + command -v python3 >/dev/null 2>&1 || echo >&2 "Please install python3" +fi + +wget https://github.com/xpack-dev-tools/arm-none-eabi-gcc-xpack/releases/download/v9.2.1-1.1/xpack-arm-none-eabi-gcc-9.2.1-1.1-linux-x64.tar.gz -O arm-none-eabi-gcc.tar.gz +tar xvf arm-none-eabi-gcc.tar.gz +mv xpack-arm-none-eabi-gcc-9.2.1-1.1 arm-none-eabi-gcc +rm arm-none-eabi-gcc.tar.gz +