comparison tools/ecsx @ 0:bfdcc3820b32

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