summaryrefslogtreecommitdiff
path: root/automated/bin/fetch_skipgen.sh
diff options
context:
space:
mode:
Diffstat (limited to 'automated/bin/fetch_skipgen.sh')
-rwxr-xr-xautomated/bin/fetch_skipgen.sh50
1 files changed, 50 insertions, 0 deletions
diff --git a/automated/bin/fetch_skipgen.sh b/automated/bin/fetch_skipgen.sh
new file mode 100755
index 0000000..3a13b38
--- /dev/null
+++ b/automated/bin/fetch_skipgen.sh
@@ -0,0 +1,50 @@
+#!/bin/sh
+set -e
+
+# Retrieve a given version of skipgen from
+# https://github.com/Linaro/skipgen/releases and copy to the
+# arm64/armeabi/x86_64 directories.
+
+if [ -z "$1" ]; then
+ echo "Usage: ${0} <skipgen_version_number>"
+ echo "For example:"
+ echo " ${0} 0.2.1"
+ echo ""
+ echo "Be sure to not include the leaving 'v'."
+ echo ""
+ exit 1
+fi
+
+SKIPGEN_VERSION=$1
+ROOT_PATH=$(dirname "$0")
+ARCHS="arm64 armeabi x86_64"
+
+for arch in ${ARCHS}; do
+
+ # Translate test-definition arch names to skipgen arch names
+ skipgen_arch=""
+ case ${arch} in
+ arm64)
+ skipgen_arch="arm64"
+ ;;
+ armeabi)
+ skipgen_arch="armv7"
+ ;;
+ x86_64)
+ skipgen_arch="amd64"
+ ;;
+ *)
+ echo "Unknown architecture ${arch}"
+ exit 1
+ ;;
+ esac
+
+ # Fetch tar file, save in /tmp
+ wget -O "/tmp/skipgen_${SKIPGEN_VERSION}_linux_${skipgen_arch}.tar.gz" \
+ "https://github.com/Linaro/skipgen/releases/download/v${SKIPGEN_VERSION}/skipgen_${SKIPGEN_VERSION}_linux_${skipgen_arch}.tar.gz"
+ # Extract skipgen binary from tar, save in the local arch folder
+ tar xvzf "/tmp/skipgen_${SKIPGEN_VERSION}_linux_${skipgen_arch}.tar.gz" -C "${ROOT_PATH}/${arch}/" skipgen
+ # Remove tmp file
+ rm -f "/tmp/skipgen_${SKIPGEN_VERSION}_linux_${skipgen_arch}.tar.gz"
+
+done