#!/bin/bash # Usage ./invoke_session # Hack for now until lava-test-shell is smart enough to know it's dispatcher ip gateway=$1 listener_addr=$2 listener_port=$3 echo "Target's Gateway: $gateway" if ! grep 'invoke_session' /etc/rc.local then sed -i '/bin/a invoke_session &' /etc/rc.local fi # Obtain target IP and Hostname ip_addr=$(ifconfig `ip route get $gateway | cut -d ' ' -f3` | grep 'inet addr' |awk -F: '{split($2,a," "); print a[1] }') hostname=$(cat /etc/hostname) # Set the PATH to use the LAVA api echo "export PATH=/lava/bin/:$PATH" > ~/.bashrc echo "" echo "" echo "*********************************************************************************************" echo -n "Please connect to: " echo -n "ssh -A" echo -n "-o UserKnownHostsFile=/dev/null " echo -n "-o StrictHostKeyChecking=no " echo -n "root@" echo -n ${ip_addr}.lab echo -n " " echo -n "Then:" echo -n "1) Copy compiler into place on that target" echo -n "2) Run run.sh : " echo -n "" echo -n "For example:" echo -n "wget http://releases.linaro.org/14.11/components/toolchain/binaries/arm-linux-gnueabihf/gcc-linaro-4.9-2014.11-x86_64_arm-linux-gnueabihf.tar.xz" echo -n "tar xf gcc-linaro-4.9-2014.11-x86_64_arm-linux-gnueabihf.tar.xz" echo -n "run.sh bogden:foo fakebench ${HOME}/gcc-linaro-4.9-2014.11-x86_64_arm-linux-gnueabihf/bin/arm-linux-gnueabihf-gcc juno-a57" echo "*********************************************************************************************" echo "" echo "" mkdir -p /run mkdir -p /run/hacking echo $$ > /run/hacking/hacking.pid #suspend in a way that is portable across shells and doesn't involve a busy-wait pid= trap 'kill $pid trap - SIGCONT' SIGCONT echo "Benchmarking session active..." sleep 999d& #timeout after 2 or 3 years... the job is likely to have a rather shorter timeout associated with it pid=$! wait echo "Benchmarking session ended..." echo ": exiting"