Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion conf/distro/include/rdk-bpi.inc
Original file line number Diff line number Diff line change
Expand Up @@ -68,4 +68,5 @@ DISTRO_FEATURES_append = " generic_mlo"
#DISTRO_FEATURES_append_broadband = " cellular_hybrid_support"

#Disable rdm-agent for reference platform
#DISTRO_FEATURES_append = "RDM"
DISTRO_FEATURES_append = " RDM"
DISTRO_FEATURES_append = " rrd"
1 change: 1 addition & 0 deletions meta-rdk-mtk-bpir4/recipes-ccsp/util/utopia.bbappend
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,7 @@ echo "#SelfHeal
#Custom Data Model
\$custom_data_model_enabled=0
\$custom_data_model_file_name=/usr/ccsp/tr069pa/custom_mapper.xml
\$RemoteDebuggerEnabled=true
\$AutoReboot=true" >> ${D}${sysconfdir}/utopia/system_defaults

#Remote management
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ IMAGE_INSTALL_append = " bpi-serialnumber"
IMAGE_INSTALL_append = " bpi-macaddress"


IMAGE_INSTALL_append = " rdk-speedtest-cli"
IMAGE_INSTALL_append = " rdk-speedtest-cli rdm-agent remotedebugger"
#Enable required linux utils for Fwupgrade
IMAGE_INSTALL_append = " gptfdisk e2fsprogs-mke2fs util-linux util-linux-losetup coreutils"

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,90 @@
#!/bin/sh
##########################################################################
# If not stated otherwise in this file or this component's Licenses.txt
# file the following copyright and licenses apply:
#
# Copyright 2018 RDK Management
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
##########################################################################
# Source Default Variables
. /etc/include.properties
source $RDK_PATH/utils.sh

# Check for valid CLI args
if [ "$#" -ne 2 ]; then
echo "Usage: $0 UPLOADDIR ISSUETYPE"
exit 1
fi

# Initialize the variables
RDK_LOGGER_PATH="/rdklogger"
MAC=`getMacAddressOnly`
TIMESTAMP=`date "+%Y-%m-%d-%H-%M-%S%p"`
RRD_LOG_FILE="$LOG_PATH/remote-debugger.log.0"
ISSUETYPE=`echo $2 | tr '[a-z]' '[A-Z]'`
RRD_LOG_PATH="$1"
RRD_LOG_DIR="/tmp/rrd/"
UPLOAD_DEBUG_FILE="${MAC}_${ISSUETYPE}_${TIMESTAMP}_RRD_DEBUG_LOGS.tgz"

# Override upstream URL for RRD uploads
UPSTREAM_RRD_URL="http://10.2.166.120:8080"

source $RDK_LOGGER_PATH/logUpload_default_params.sh

# Logging Format
uploadLog()
{
echo "`/bin/timestamp`: $0: $*" >> $RRD_LOG_FILE
}

getTFTPServer()
{
if [ "$1" != "" ];then
logserver=`grep -i $1 $RDK_LOGGER_PATH/dcmlogservers.txt | cut -f2 -d"|"`
echo $logserver
fi
}

BUILD_TYPE=`getBuildType`
SERVER=`getTFTPServer $BUILD_TYPE`

###################################
# REMOTE DEBUGGER MAIN FUNCTION #
###################################
uploadLog "Executing uploadRRDLogs.sh script to upload Debug info of ISSUETYPE=$ISSUETYPE"
uploadLog "Using upstream RRD URL: $UPSTREAM_RRD_URL"
uploadLog "Checking $RRD_LOG_PATH size and contents"

if [ -d $RRD_LOG_PATH ] && [ "$(ls -A $RRD_LOG_PATH)" ]; then
cd $RRD_LOG_DIR
uploadLog "Creating $UPLOAD_DEBUG_FILE tarfile from Debug Commands output"
tar -zcf $UPLOAD_DEBUG_FILE -C $RRD_LOG_PATH . >> $RRD_LOG_FILE 2>&1

uploadLog "Invoking uploadRDKBLogs.sh script to upload $UPLOAD_DEBUG_FILE file"
# Modified to pass upstream URL as 3rd parameter
$RDK_LOGGER_PATH/uploadRDKBLogs.sh $SERVER "HTTP" "$UPSTREAM_RRD_URL" "false" "" $RRD_LOG_DIR "false"
retval=$?

if [ $retval -ne 200 ];then
uploadLog "RRD $ISSUETYPE Debug Information Report upload Failed!!! (HTTP Code: $retval)"
# Keep files for debugging
uploadLog "Preserving failed upload files in $RRD_LOG_DIR for analysis"
else
uploadLog "RRD $ISSUETYPE Debug Information Report upload Success"
uploadLog "Removing uploaded report $UPLOAD_DEBUG_FILE"
rm -rf $UPLOAD_DEBUG_FILE $RRD_LOG_PATH
fi
else
uploadLog "$RRD_LOG_PATH is Empty, Exiting!!!"
fi
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
FILESEXTRAPATHS:prepend := "${THISDIR}/files:"
SRC_URI += " file://uploadRRDLogs.sh"
do_install_append () {
sed -i "s/ utopia.service//" ${D}${systemd_unitdir}/system/remote-debugger.service
install -m 0755 ${WORKDIR}/uploadRRDLogs.sh ${D}${base_libdir}/rdk/uploadRRDLogs.sh
}
SYSTEMD_AUTO_ENABLE:${PN} = "enable"
Loading
Loading