Skip to content
Closed
Show file tree
Hide file tree
Changes from 21 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
23 changes: 23 additions & 0 deletions .github/workflows/native_full_build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@

name: Build Component in Native Environment

on:
pull_request:
branches: [ develop ]
paths: ['**/*.c', '**/*.cpp', '**/*.cc', '**/*.cxx', '**/*.h', '**/*.hpp']

jobs:
build-systemtimemgr-on-pr:
name: Build Remote-debugger component in github rdkcentral
runs-on: ubuntu-latest
container:
image: ghcr.io/rdkcentral/docker-rdk-ci:latest
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please use ghcr.io/rdkcentral/docker-device-mgt-service-test/native-platform:latest instead


steps:
- name: Checkout code
uses: actions/checkout@v3

- name: native build
run: |
chmod +x cov_build.sh
sh -e cov_build.sh
12 changes: 12 additions & 0 deletions configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,18 @@ AC_ARG_ENABLE([gtestapp],
[echo "Gtestapp is disabled"])
AM_CONDITIONAL([WITH_GTEST_SUPPORT], [test x$GTEST_SUPPORT_ENABLED = xtrue])

AC_ARG_ENABLE([iarmbus],
AS_HELP_STRING([--enable-iarmbus], [enable IARMBus support (default is no)]),
[
case "${enableval}" in
yes) USE_IARMBUS=true;;
no) AC_MSG_ERROR([IARMBus support is disabled]);;
*) AC_MSG_ERROR([bad value ${enableval} for --enable-iarmbus]);;
esac
],
[echo "IARMBus support is disabled"])
AM_CONDITIONAL([USE_IARMBUS], [test x$USE_IARMBUS = xtrue])

# Config Source files.
AC_CONFIG_SRCDIR([src/rrdMain.c])
AC_CONFIG_HEADERS([config.h])
Expand Down
73 changes: 73 additions & 0 deletions cov_build.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,73 @@
WORKDIR=`pwd`
# Build and install critical dependency
export ROOT=/usr
export INSTALL_DIR=${ROOT}/local
mkdir -p $INSTALL_DIR

cd $ROOT
#Build rbus
git clone https://github.com/rdkcentral/rbus
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

With use of ghcr.io/rdkcentral/docker-device-mgt-service-test/native-platform:lates, rbus should be already available as part of the container

cmake -Hrbus -Bbuild/rbus -DBUILD_FOR_DESKTOP=ON -DCMAKE_BUILD_TYPE=Debug
make -C build/rbus && make -C build/rbus install
#Build wdmp-c
git clone https://github.com/xmidt-org/wdmp-c.git
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This seems to be a package needed by more than 1 module. Lets move it to https://github.com/rdkcentral/docker-device-mgt-service-test/tree/develop/native-platform

cd wdmp-c
mkdir build
cd build
cmake ..
make
make install
sed -i '/WDMP_ERR_SESSION_IN_PROGRESS/a\ WDMP_ERR_INTERNAL_ERROR,\n WDMP_ERR_DEFAULT_VALUE,' /usr/local/include/wdmp-c/wdmp-c.h
cd $ROOT
#Build rdk-logger
git clone https://github.com/rdkcentral/rdk_logger.git
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Similarly redundant package .

apt install liblog4c-dev
cd $ROOT/rdk_logger
autoreconf -i
./configure
make LOG4C_LIBS="-L/usr/lib/x86_64-linux-gnu"
make install
#Build Webconfig framework
cd ${ROOT}
git clone https://github.com/rdkcentral/WebconfigFramework.git
cd WebconfigFramework
autoreconf -i
export CFLAGS="-I/usr/local/include/rbus -I/usr/local/include/rtmessage"
./configure --prefix=/usr/local
make && make install
#Build libsyswrapper
cd ${ROOT}
git clone https://github.com/rdkcentral/libSyscallWrapper.git
cd ${ROOT}/libSyscallWrapper
autoupdate
autoreconf -i
./configure --prefix=${INSTALL_DIR}
make && make install
#Build rfc
cd ${ROOT}
git clone https://github.com/rdkcentral/rfc.git
cd rfc
autoreconf -i
./configure --enable-rfctool=yes --enable-tr181set=yes
cd rfcapi
cp /usr/local/lib/pkgconfig/libcjson.pc /usr/local/lib/pkgconfig/cjson.pc
make librfcapi_la_CPPFLAGS="-I/usr/include/cjson -I/usr/rfc/rfcMgr/gtest/mocks"
make install
cd /usr/rfc/tr181api
g++ -fPIC -shared -o libtr181api.so tr181api.cpp -I/usr/local/include/wdmp-c
mv ./libtr181api.so /usr/local/lib
mv ./tr181api.h /usr/local/include
#Build trower-base64
cd ${ROOT}
git clone https://github.com/xmidt-org/trower-base64.git
cd ${ROOT}/trower-base64
meson setup build
ninja -C build
ninja -C build install
cd $ROOT
git clone https://github.com/rdkcentral/iarmmgrs.git
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We have changes to decouple from Iarm . Why are we still needing this clone here ?

cd $WORKDIR
autoreconf -i
autoupdate
./configure --prefix=${INSTALL_DIR}
make remotedebugger_CFLAGS="-I/usr/include/cjson -I/usr/local/include/wdmp-c -I/usr/local/include/rbus -I/usr/WebconfigFramework/include -I/usr/iarmmgrs/rdmmgr/include -I/usr/iarmmgrs/hal/include -I/usr/local/include/trower-base64" remotedebugger_LDFLAGS="-L/usr/local/lib -lsafec -lrdkloggers -lcjson -lrfcapi -lrbus -lmsgpackc -lsecure_wrapper -lwebconfig_framework -ltr181api -L/usr/local/lib/x86_64-linux-gnu -ltrower-base64 -L/usr/lib/x86_64-linux-gnu"
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The dependent modules are built and installed. We may not need to refer to include files from the source checkout locations

20 changes: 13 additions & 7 deletions src/rrdIarm.c
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ IARM_Result_t RRD_subscribe()
int ret = 0;

RDK_LOG(RDK_LOG_DEBUG, LOG_REMDEBUG, "[%s:%d]: ...Entering... \n", __FUNCTION__, __LINE__);

#if defined(USE_IARMBUS)
ret = IARM_Bus_Init(IARM_BUS_RDK_REMOTE_DEBUGGER_NAME);
if (ret != IARM_RESULT_SUCCESS)
{
Expand All @@ -56,8 +56,9 @@ IARM_Result_t RRD_subscribe()
return ret;
#endif
}
#endif
RDK_LOG(RDK_LOG_DEBUG, LOG_REMDEBUG, "[%s:%d]: SUCCESS: IARM_Bus_Init done! \n", __FUNCTION__, __LINE__);

#if defined(USE_IARMBUS)
ret = IARM_Bus_Connect();
if (ret != IARM_RESULT_SUCCESS)
{
Expand All @@ -68,9 +69,10 @@ IARM_Result_t RRD_subscribe()
return ret;
#endif
}
#endif
RDK_LOG(RDK_LOG_DEBUG, LOG_REMDEBUG, "[%s:%d]: SUCCESS: IARM_Bus_Connect done! \n", __FUNCTION__, __LINE__);


#if defined(USE_IARMBUS)
ret = IARM_Bus_RegisterEventHandler(IARM_BUS_RDK_REMOTE_DEBUGGER_NAME, IARM_BUS_RDK_REMOTE_DEBUGGER_ISSUETYPE, _remoteDebuggerEventHandler);
if (ret != IARM_RESULT_SUCCESS)
{
Expand All @@ -91,6 +93,7 @@ IARM_Result_t RRD_subscribe()
return ret;
#endif
}

RDK_LOG(RDK_LOG_DEBUG, LOG_REMDEBUG, "[%s:%d]: SUCCESS: IARM_Bus_RegisterEventHandler for RRD done! \n", __FUNCTION__, __LINE__);

// IARM Reg for RDM Event Handler
Expand All @@ -116,7 +119,7 @@ IARM_Result_t RRD_subscribe()
return ret;
#endif
}

#endif
webconfigFrameworkInit();

RDK_LOG(RDK_LOG_DEBUG, LOG_REMDEBUG, "[%s:%d]: SUCCESS: IARM_Bus_RegisterEventHandler for RDMMGR done! \n", __FUNCTION__, __LINE__);
Expand Down Expand Up @@ -546,7 +549,7 @@ IARM_Result_t RRD_unsubscribe()
rbusError_t rc = RBUS_ERROR_BUS_ERROR;

RDK_LOG(RDK_LOG_DEBUG, LOG_REMDEBUG, "[%s:%d]: ...Entering... \n", __FUNCTION__, __LINE__);

#if defined(USE_IARMBUS)
ret = IARM_Bus_Disconnect();
if (ret != IARM_RESULT_SUCCESS)
{
Expand All @@ -557,8 +560,9 @@ IARM_Result_t RRD_unsubscribe()
return ret;
#endif
}
#endif
RDK_LOG(RDK_LOG_DEBUG, LOG_REMDEBUG, "[%s:%d]: SUCCESS: IARM_Bus_Disconnect done!\n", __FUNCTION__, __LINE__);

#if defined(USE_IARMBUS)
ret = IARM_Bus_Term();
if (ret != IARM_RESULT_SUCCESS)
{
Expand All @@ -569,8 +573,9 @@ IARM_Result_t RRD_unsubscribe()
return ret;
#endif
}
#endif
RDK_LOG(RDK_LOG_DEBUG, LOG_REMDEBUG, "[%s:%d]: SUCCESS: IARM_Bus_Term done!\n", __FUNCTION__, __LINE__);

#if defined(USE_IARMBUS)
ret = IARM_Bus_UnRegisterEventHandler(IARM_BUS_RDK_REMOTE_DEBUGGER_NAME, IARM_BUS_RDK_REMOTE_DEBUGGER_ISSUETYPE);
if (ret != IARM_RESULT_SUCCESS)
{
Expand Down Expand Up @@ -607,6 +612,7 @@ IARM_Result_t RRD_unsubscribe()
return ret;
#endif
}
#endif
RDK_LOG(RDK_LOG_DEBUG, LOG_REMDEBUG, "[%s:%d]: SUCCESS: IARM_Bus_UnRegisterEventHandler for RDMMGR done! \n", __FUNCTION__, __LINE__);


Expand Down