TestPage2
From Variscite Wiki
DART-6UL test page
BSP type: YOCTO BSP version: morty Category1: Category2:
TARGET_DIR="/home/root"
TARGET_IP="192.168.73.165"
TARGET_PORT="3000"
SSH_OPTIONS="-oStrictHostKeyChecking=no"
#!/bin/bash
readonly PROGRAM="$1"
PROGRAMNAME="$(basename $PROGRAM)"
. /home/user/bin/var-sdk.conf
echo "Deploying to target"
# prevent "Host key verification failed"
ssh-keygen -f "${HOME}/.ssh/known_hosts" -R "${TARGET_IP}"
# delete old binary
ssh ${SSH_OPTIONS} root@${TARGET_IP} "sh -c 'rm -rf ${TARGET_DIR}/${PROGRAMNAME}'"
# send the program to the target
scp ${PROGRAM} root@${TARGET_IP}:${TARGET_DIR}/${PROGRAMNAME}
#!/bin/bash
readonly PROGRAM="$1"
PROGRAMNAME="$(basename $PROGRAM)"
. /home/user/bin/var-sdk.conf
echo "Starting GDB Server on Target"
# kill gdbserver on target
ssh ${SSH_OPTIONS} root@${TARGET_IP} "sh -c '/usr/bin/killall -q gdbserver'"
# start gdbserver on target and fork
ssh ${SSH_OPTIONS} -t root@${TARGET_IP} "sh -c 'XDG_RUNTIME_DIR=/run/user/0 gdbserver localhost:${TARGET_PORT} ${TARGET_DIR}/${PROGRAMNAME}'" &