TestPage2: Difference between revisions

From Variscite Wiki
No edit summary
(test codeblocks script sections)
 
Line 6: Line 6:
--> {{PageHeader|{{#var:HARDWARE_NAME}} test page }} {{DocImage|category1={{#varexists:B2QT_BSP_VERSION | Boot2Qt | Yocto }}|category2={{#var:HARDWARE_NAME}}}}__toc__
--> {{PageHeader|{{#var:HARDWARE_NAME}} test page }} {{DocImage|category1={{#varexists:B2QT_BSP_VERSION | Boot2Qt | Yocto }}|category2={{#var:HARDWARE_NAME}}}}__toc__


BSP type: {{#varexists:B2QT_BSP_VERSION | B2QT | YOCTO }}
BSP version: {{#varexists:B2QT_BSP_VERSION | {{#var:B2QT_BRANCH}} | {{#var:YOCTO_BRANCH}} }}
Category1: {{#var:category1}}
Category2: {{#var:category2}}
<section begin=SCRIPT_CODEBLOCKS_VAR_SDK/>
<syntaxhighlight lang="bash">
TARGET_DIR="/home/root"
TARGET_IP="192.168.73.165"
TARGET_PORT="3000"
SSH_OPTIONS="-oStrictHostKeyChecking=no"
</syntaxhighlight>
<section end=SCRIPT_CODEBLOCKS_VAR_SDK/>


BSP type: {{#varexists:B2QT_BSP_VERSION | B2QT | YOCTO }}
<section begin=SCRIPT_CODEBLOCKS_VAR_SDK_DEPLOY/>
<syntaxhighlight lang="bash">
#!/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}
</syntaxhighlight>
<section end=SCRIPT_CODEBLOCKS_VAR_SDK_DEPLOY/>
 
<section begin=SCRIPT_CODEBLOCKS_VAR_SDK_DEBUG/>
<syntaxhighlight lang="bash">
#!/bin/bash
 
readonly PROGRAM="$1"
PROGRAMNAME="$(basename $PROGRAM)"
 
. /home/user/bin/var-sdk.conf


BSP version: {{#varexists:B2QT_BSP_VERSION | {{#var:B2QT_BRANCH}} | {{#var:YOCTO_BRANCH}} }}
echo "Starting GDB Server on Target"


Category1: {{#var:category1}}
# kill gdbserver on target
ssh ${SSH_OPTIONS} root@${TARGET_IP} "sh -c '/usr/bin/killall -q gdbserver'"


Category2: {{#var:category2}}
# 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}'" &
</syntaxhighlight>
<section end=SCRIPT_CODEBLOCKS_VAR_SDK_DEBUG/>

Latest revision as of 18:34, 25 April 2023

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}'" &