diff options
author | Romain Forlot <romain.forlot@iot.bzh> | 2017-06-15 07:57:00 +0000 |
---|---|---|
committer | Gerrit Code Review <gerrit@automotivelinux.org> | 2017-06-15 07:57:00 +0000 |
commit | 8d9b7f22c821e149a09824df50a6775fac43a977 (patch) | |
tree | fcdfe8d60457e66c5ab4dd75b3afe04b2c9fc576 | |
parent | 5a83e479e50eff90f1d98bd74a9f933a6340e3f6 (diff) | |
parent | b0a2632e28f03dd664b959f7f4b038741a62678b (diff) |
Merge changes I81a6d9f6,I67698bbb
* changes:
Fix: remove old bug about overwriten variables.
Fix gdb debugging and add widget install on target
-rw-r--r-- | cmake/common.cmake | 33 | ||||
-rw-r--r-- | cmake/config.cmake.sample | 2 | ||||
-rw-r--r-- | gdb/gdb-on-target.in | 18 | ||||
-rw-r--r-- | ssh/start-on-target.in | 4 | ||||
-rw-r--r-- | wgt/install-wgt-on-target.in | 19 | ||||
-rw-r--r-- | xds/xds-config.env.sample | 10 |
6 files changed, 74 insertions, 12 deletions
diff --git a/cmake/common.cmake b/cmake/common.cmake index 353e1ec..8e4cb6b 100644 --- a/cmake/common.cmake +++ b/cmake/common.cmake @@ -173,8 +173,8 @@ macro(remote_targets_populate) add_custom_target(remote-target-populate DEPENDS populate - COMMAND chmod +x ${CMAKE_CURRENT_BINARY_DIR}/target/start-on-${RSYNC_TARGET}.sh - COMMAND rsync --archive --delete ${PROJECT_PKG_BUILD_DIR}/ ${RSYNC_TARGET}:${RSYNC_PREFIX}/${PROJECT_NAME} + COMMAND chmod +x ${CMAKE_CURRENT_BINARY_DIR}/target/*.sh + COMMAND rsync -e "ssh -o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null" --archive --delete ${PROJECT_PKG_BUILD_DIR}/ ${RSYNC_TARGET}:${RSYNC_PREFIX}/${PROJECT_NAME} COMMENT "${REMOTE_LAUNCH}" ) endif() @@ -187,9 +187,9 @@ macro(wgt_package_build) if(NOT EXISTS ${WGT_TEMPLATE_DIR}/icon-default.png) MESSAGE(FATAL_ERROR "${Red}WARNING ! Missing mandatory files to build widget file.\nYou need ${PROJECT_ICON} file in ${WGT_TEMPLATE_DIR} folder.${ColourReset}") endif() - if(NOT WIDGET_TYPE) - MESSAGE(FATAL_ERROR "WIDGET_TYPE must be set in your config.cmake.\neg.: set(WIDGET_TYPE application/vnd.agl.service)") - endif() + if(NOT WIDGET_TYPE) + MESSAGE(FATAL_ERROR "WIDGET_TYPE must be set in your config.cmake.\neg.: set(WIDGET_TYPE application/vnd.agl.service)") + endif() if(NOT WIDGET_ENTRY_POINT) set(WIDGET_ENTRY_POINT lib) @@ -214,6 +214,21 @@ macro(wgt_package_build) add_dependencies(widget populate) set(ADDITIONAL_MAKE_CLEAN_FILES, "${PROJECT_NAME}.wgt") + if(NOT RSYNC_TARGET) + message ("${Yellow}.. Warning: RSYNC_TARGET not defined 'make widget-target-install' not instanciated${ColourReset}") + add_custom_target(widget-target-install + COMMENT "${Red}*** Fatal: RSYNC_TARGET RSYNC_PREFIX environment variables required with 'make widget-target-install'${ColourReset}" + COMMAND exit -1 + ) + else() + configure_file(${WGT_TEMPLATE_DIR}/install-wgt-on-target.in ${CMAKE_CURRENT_BINARY_DIR}/target/install-wgt-on-${RSYNC_TARGET}.sh) + add_custom_target(widget-target-install + DEPENDS widget + COMMAND chmod +x ${CMAKE_CURRENT_BINARY_DIR}/target/install-wgt-on-${RSYNC_TARGET}.sh + COMMAND ${CMAKE_CURRENT_BINARY_DIR}/target/install-wgt-on-${RSYNC_TARGET}.sh + ) + endif() + if(PACKAGE_MESSAGE) add_custom_command(TARGET widget POST_BUILD @@ -364,11 +379,13 @@ else() set(BINDINGS_INSTALL_DIR ${CMAKE_CURRENT_BINARY_DIR}/${PROJECT_NAME} CACHE PATH "Where the binding will be installed in your system") endif() +set(PKGOUT_DIR package CACHE PATH "Output directory for packages") + # Define a default package directory -if(PACKAGE_PREFIX) - set(PROJECT_PKG_BUILD_DIR ${PKG_PREFIX}/package CACHE PATH "Application contents to be packaged") +if(PKG_PREFIX) + set(PROJECT_PKG_BUILD_DIR ${PKG_PREFIX}/${PKGOUT_DIR} CACHE PATH "Application contents to be packaged") else() - set(PROJECT_PKG_BUILD_DIR ${CMAKE_CURRENT_BINARY_DIR}/package CACHE PATH "Application contents to be packaged") + set(PROJECT_PKG_BUILD_DIR ${CMAKE_CURRENT_BINARY_DIR}/${PKGOUT_DIR} CACHE PATH "Application contents to be packaged") endif() set (PKG_TEMPLATE_PREFIX ${CMAKE_SOURCE_DIR}/${PROJECT_APP_TEMPLATES_DIR} CACHE PATH "Default Package Templates Directory") diff --git a/cmake/config.cmake.sample b/cmake/config.cmake.sample index 43a7547..9e41872 100644 --- a/cmake/config.cmake.sample +++ b/cmake/config.cmake.sample @@ -131,7 +131,7 @@ set(WIDGET_ENTRY_POINT EntryPoint_Path_Not_Set) # Optional force package prefix generation, like widget # ----------------------------------------------------- -# set(PACKAGE_PREFIX DestinationPath) +# set(PKG_PREFIX DestinationPath) # Optional Application Framework security token # and port use for remote debugging. diff --git a/gdb/gdb-on-target.in b/gdb/gdb-on-target.in index 360c860..0478e90 100644 --- a/gdb/gdb-on-target.in +++ b/gdb/gdb-on-target.in @@ -5,9 +5,25 @@ # Reference: https://blog.flameeyes.eu/2010/02/remote-debugging-with-gdb-part-2-gdb/ # Start gdbserver on target and connect through SSH link -target remote | ssh @RSYNC_TARGET@ gdbserver - afb-daemon --port=@AFB_REMPORT@ --workdir=@RSYNC_PREFIX@/@PROJECT_NAME@ --roothttp=./htdocs --ldpath=./lib --verbose --token=@AFB_TOKEN@ +target remote | ssh -o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null @RSYNC_TARGET@ gdbserver - afb-daemon --port=@AFB_REMPORT@ --workdir=@RSYNC_PREFIX@/@PROJECT_NAME@ --roothttp=./htdocs --ldpath=./lib --verbose --token=@AFB_TOKEN@ + +# Disable auto load of libraries to improved perf +set auto-solib-add off + +# Define path for project libraries +set solib-search-path $ENV{PROJECT_DIR}/build/@PKGOUT_DIR@/lib + +# Path substitution for source file names +set substitute-path @CMAKE_CURRENT_SOURCE_DIR@ $ENV{PROJECT_DIR} # Replace run by continue (gdb use 'run' when gdbserver wants 'continue') define run continue +end + +# Manually load project libraries when loaded by afb-daemon +break execute_command +commands +sharedlibrary $ENV{PROJECT_DIR}/build/@PKGOUT_DIR@ +continue end
\ No newline at end of file diff --git a/ssh/start-on-target.in b/ssh/start-on-target.in index a21c6d1..9e3a60d 100644 --- a/ssh/start-on-target.in +++ b/ssh/start-on-target.in @@ -1,5 +1,5 @@ #!/bin/sh -# +# # File: start-on-target.sh # Author: Fulup Ar Foll @ IoT.bzh # Object: Forward signal (SIGTERM) to remote process @@ -13,7 +13,7 @@ export RSYNC_PREFIX=@RSYNC_PREFIX@/@PROJECT_NAME@ export AFB_REMPORT=@AFB_REMPORT@ export AFB_TOKEN=@AFB_TOKEN@ -exec ssh -o "StrictHostKeyChecking no" -tt $RSYNC_TARGET << EOF +exec ssh -o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null -tt $RSYNC_TARGET << EOF afb-daemon --workdir=$RSYNC_PREFIX --port=$AFB_REMPORT --roothttp=./htdocs --ldpath=./lib --verbose --token=$AFB_TOKEN & PID_DAEMON=\$! diff --git a/wgt/install-wgt-on-target.in b/wgt/install-wgt-on-target.in new file mode 100644 index 0000000..39a69d5 --- /dev/null +++ b/wgt/install-wgt-on-target.in @@ -0,0 +1,19 @@ +#!/bin/sh +# +# File: install-wgt-on-target.sh +# Author: Sebastien Douheret @ IoT.bzh +# Object: install widget on target +# Created on 24-May-2017, 09:23:37 +# Usage: + +# Do not change manually use 'make remote-target-populate' +export RSYNC_TARGET=@RSYNC_TARGET@ +export WGT_FILE_L=@CMAKE_CURRENT_BINARY_DIR@/@PROJECT_NAME@.wgt +export WGT_FILE_T=/tmp/@PROJECT_NAME@.wgt + +scp $WGT_FILE_L $RSYNC_TARGET:$WGT_FILE_T \ + && ssh -o "StrictHostKeyChecking no" -tt $RSYNC_TARGET -- \ + afm-util install $WGT_FILE_T + +# && rm -f $WGT_FILE_T + diff --git a/xds/xds-config.env.sample b/xds/xds-config.env.sample new file mode 100644 index 0000000..a4c51b1 --- /dev/null +++ b/xds/xds-config.env.sample @@ -0,0 +1,10 @@ +XDS_PROJECT_ID=W2EAQBA-HQI75XA_unicens2-binding +XDS_SDK_ID=poky-agl_aarch64_3.99.1+snapshot +XDS_SERVER_URL=localhost:8000 + +DOCKER_TARGET=docker-sdk + +RSYNC_TARGET=root@192.168.168.11 +RSYNC_PREFIX=./opt +PROJECT_DIR=/home/seb/tmp/unicens2-binding + |