From 8280e09a7dcc4bcceb98993f8178391a4c8d0050 Mon Sep 17 00:00:00 2001 From: Vahagn Khachatryan Date: Mon, 6 Mar 2023 15:50:56 +0000 Subject: [PATCH] roku device - sets platform --- .profile.roku.dev | 6 ++++-- _roku.sh | 34 ++++++++++++++++++++++++++++++++-- 2 files changed, 36 insertions(+), 4 deletions(-) diff --git a/.profile.roku.dev b/.profile.roku.dev index d33e84c..11f03a0 100644 --- a/.profile.roku.dev +++ b/.profile.roku.dev @@ -13,13 +13,15 @@ _roku_device() { if [ "$1" != "" ]; then export ROKU_DEV_TARGET="$1" + export ROKU_DEV_PLATFORM="$(_roku.sh device_platform)" fi - echo $ROKU_DEV_TARGET + echo "device: $ROKU_DEV_TARGET" + echo "platform: $ROKU_DEV_PLATFORM" } roku() { - if [ "$1" = "device" ]; then + if [ "$1" = "device" -a "$2" != "info" ]; then shift _roku_device "$@" else diff --git a/_roku.sh b/_roku.sh index 5623714..e4aa9fe 100755 --- a/_roku.sh +++ b/_roku.sh @@ -30,6 +30,12 @@ __device_cmd() echo "$1; exit" | __netcat } +_roku_device_platform() +{ + [ -z "$ROKU_DEV_TARGET" ] && echo "ROKU_DEV_TARGET must be defined" && return 0 + __device_cmd "echo \$ROKU_PLATFORM" | tail -1 +} + ############################################################################### # @@ -83,6 +89,30 @@ _roku_audcap() sox -t raw -r 48000 -b 16 -c 2 -e signed-integer $1.pcm $1.wav } +############################################################################### +# +# Debug app +# +_roku_debug_attach() +{ + PLATFORM=lockhart + [ -z "$ROKU_DEV_TARGET" ] && echo "ROKU_DEV_TARGET must be defined" && return 0 + __device_cmd "/tmp/tools/gdbserver :5555 --attach \$(pgrep Application)" +} + +_roku_debug() +{ + PLATFORM=lockhart + [ -z "$ROKU_DEV_TARGET" ] && echo "ROKU_DEV_TARGET must be defined" && return 0 + # __device_cmd "/tmp/tools/gdbserver :5555 --attach \$(pgrep Application)" & + # sleep 2 + gdb-multiarch \ + -ex "set non-stop off" \ + -ex "target remote $ROKU_DEBUG_TARGET:5555" \ + -ex "set solib-absolute-prefix $PWD/port/realtek/stark/$ROKU_DEV_TARGET/dist/rootfs" \ + -ex "set sysroot $PWD/port/realtek/stark/$ROKU_DEV_TARGET/dist/rootfs" +} + ############################################################################### # # Work with channels. @@ -153,9 +183,9 @@ dtail() # Misc # -_roku_get() +_roku_wget() { - [ -z "$1" ] && echo "usage: rokuget " && return 0 + [ -z "$1" ] && echo "usage: roku_wget " && return 0 if [ -z "$ROKU_CORP_PASSWORD" ]; then local USER_PASSWORD="--ask-password" else