annotate tools/ecsx @ 1:b5139af1a420 tip basis

Fixed permissions on compile scripts
author Mike Spivey <mike@cs.ox.ac.uk>
date Fri, 13 Oct 2017 17:27:58 +0100
parents bfdcc3820b32
children
rev   line source
mike@0 1 #!/bin/bash
mike@0 2
mike@0 3 # Usage: ecsx b.s pas0.c
mike@0 4
mike@0 5 HOST=ecs.ox.ac.uk
mike@0 6 ARMGCC='arm-linux-gnueabihf-gcc -marm -march=armv6'
mike@0 7 QEMU=qemu-arm
mike@0 8
mike@0 9 # Make sure socket directory exists
mike@0 10 mkdir -p ~/.ssh/sockets
mike@0 11
mike@0 12 # Remote temp directory for this test
mike@0 13 dir="ecsx-$$"
mike@0 14
mike@0 15 # Form a batch job
mike@0 16 ( echo /bin/mkdir -p $dir
mike@0 17 # Create source files
mike@0 18 for f in $*; do
mike@0 19 echo "/bin/cat >$dir/$f <<\\EOF"
mike@0 20 cat $f
mike@0 21 echo EOF
mike@0 22 done
mike@0 23 # Compile and run
mike@0 24 echo "(cd $dir; set -x;
mike@0 25 $ARMGCC $* -static -o b.out && $QEMU ./b.out)"
mike@0 26 # Delete the directory
mike@0 27 echo /bin/rm -rf $dir ) \
mike@0 28 |
mike@0 29 # Submit it to the server, reusing a previous connection if possible
mike@0 30 ssh -o 'ControlMaster auto' -o 'ControlPath ~/.ssh/sockets/%r@%h-%p' \
mike@0 31 -o 'ControlPersist 600' $HOST /bin/bash
mike@0 32