From b9f896e14b98880835c078590088b200c0b761a4 Mon Sep 17 00:00:00 2001 From: Sebastien Bourdeauducq Date: Sat, 4 Jul 2020 23:41:28 +0800 Subject: [PATCH] remote_run: support specifying ssh options --- remote_run.sh | 19 +++++++++++-------- 1 file changed, 11 insertions(+), 8 deletions(-) diff --git a/remote_run.sh b/remote_run.sh index aa87e6ff..7c121068 100755 --- a/remote_run.sh +++ b/remote_run.sh @@ -6,8 +6,9 @@ target_host="rpi-4.m-labs.hk" impure=0 pure_dir="result" impure_dir="build" +sshopts="" -while getopts "h:id:" opt; do +while getopts "h:id:o:" opt; do case "$opt" in \?) exit 1 ;; @@ -18,21 +19,23 @@ while getopts "h:id:" opt; do d) pure_dir=$OPTARG; impure_dir=$OPTARG; ;; + o) sshopts=$OPTARG + ;; esac done target_folder=/tmp/zynq-$USER echo "Creating $target_folder..." -ssh $target_host "mkdir -p $target_folder" +ssh $sshopts $target_host "mkdir -p $target_folder" echo "Copying files..." -rsync openocd/* $target_host:$target_folder +rsync -e "ssh $sshopts" openocd/* $target_host:$target_folder if [ $impure -eq 1 ]; then - rsync $impure_dir/firmware/armv7-none-eabihf/release/szl $target_host:$target_folder/szl.elf - rsync $impure_dir/gateware/top.bit $target_host:$target_folder + rsync -e "ssh $sshopts" $impure_dir/firmware/armv7-none-eabihf/release/szl $target_host:$target_folder/szl.elf + rsync -e "ssh $sshopts" $impure_dir/gateware/top.bit $target_host:$target_folder else - rsync -Lc $pure_dir/szl.elf $target_host:$target_folder - rsync -Lc $pure_dir/top.bit $target_host:$target_folder + rsync -e "ssh $sshopts" -Lc $pure_dir/szl.elf $target_host:$target_folder + rsync -e "ssh $sshopts" -Lc $pure_dir/top.bit $target_host:$target_folder fi echo "Programming board..." -ssh $target_host "cd $target_folder; openocd -f zc706.cfg -c 'pld load 0 top.bit; load_image szl.elf; resume 0; exit'" +ssh $sshopts $target_host "cd $target_folder; openocd -f zc706.cfg -c 'pld load 0 top.bit; load_image szl.elf; resume 0; exit'"