#!/bin/bash set -e set -x echo "Perfoming Toolchain Benchmark Setup!" cd ~ mkdir -p toolchain cd toolchain echo "Fetching and Unpacking Toolchain!" curl $2 | tar --strip-components=1 -xvJ cd bin ls -al export CROSS_COMPILE=$(pwd)/$4 echo "Cross Compiler Configuration!" echo $CROSS_COMPILE echo "GCC Version!" /root/toolchain/bin/arm-linux-gnueabihf-gcc -v cd ~ echo "Fetching Benchmark Binaries!" curl $5 > SPEC2xxx.tar.xz echo "Fetching Benchmark Scripts!" git clone $3 scripts mkdir -p /tmp/spec echo "Generating RSA Keys!" ssh-keygen -t rsa -N "" -f ~/.ssh/id_rsa echo StrictHostKeyChecking=no > ~/.ssh/config echo "Toolchain Benchmark Setup Complete!" echo "Configuring Toolchain Benchmark!" echo "Forcing NTP Update!" service ntp stop ntpd -gq service ntp start echo "Dumping Network Info!" ifconfig -a route echo "LAVA Network Broadcast!" lava-network broadcast $1 echo "LAVA Network Collect!" lava-network collect $1 echo "LAVA Group Gather Host Hostname!" export HOST_HOSTNAME=$(lava-group | grep host | awk '{print $1}') echo $HOST_HOSTNAME echo "LAVA Group Gather Target Hostname!" export TARGET_HOSTNAME=$(lava-group | grep target | awk '{print $1}') echo $TARGET_HOSTNAME echo "LAVA Network Query For Target IP!" export TARGET=$(lava-network query $TARGET_HOSTNAME ipv4 | grep -o '[0-9]\{1,3\}\.[0-9]\{1,3\}\.[0-9]\{1,3\}\.[0-9]\{1,3\}') echo $TARGET echo "LAVA Network Query for Host IP!" export HOST=$(lava-network query $HOST_HOSTNAME ipv4 | grep -o '[0-9]\{1,3\}\.[0-9]\{1,3\}\.[0-9]\{1,3\}\.[0-9]\{1,3\}') echo $HOST echo "Setting SPEC PATH!" export SPEC=/tmp/spec echo $SPEC echo "Dumping LAVA Network Cache!" cat /tmp/lava_multi_node_network_cache.txt echo "Exchanging Host Key!" lava-sync host-key-exchange-start cat ~/.ssh/id_rsa.pub cat ~/.ssh/id_rsa.pub | nc -l 1337 lava-sync host-key-exchange-done echo "Exchanging Target Key!" lava-sync target-key-exchange-start sleep 20 nc $TARGET 1337 > ~/.ssh/authorized_keys cat ~/.ssh/authorized_keys lava-sync target-key-exchange-done cd ~/scripts export CONFIG=linaro-cross-$(date +%Y%m%dT%H%M%S) echo "CONFIG is:" echo $CONFIG echo "Running SPEC2 Check!" lava-test-case spec2xxx-check --shell ./spec2xxx-check echo "Running SPEC2 Install!" lava-test-case spec2xxx-install --shell ./spec2xxx-install ~/SPEC2xxx.tar.xz echo "Running SPEC2 Prepare!" lava-test-case spec2xxx-prepare --shell ./spec2xxx-prepare ./linux-armv7l-gcc4-linaro.in $CROSS_COMPILE echo "Running SPEC2 Build!" lava-test-case spec2xxx-build --shell ./spec2xxx-build echo "Running SPEC2!" lava-test-case spec2xxx-run --shell ./spec2xxx-run echo "Running SPEC2 Results" mkdir -p result lava-test-case spec2xxx-result --shell ./spec2xxx-result ./result export FILES=$(pwd)/result/* for file in $FILES do lava-test-case-attach test-attach $file text/plain cat $FILE done lava-sync done