Skip to content

RDK-61784: Handle device type RFC after xconf sync - #219

Open
NareshM1702 wants to merge 2 commits into
developfrom
topic/RDK-61784
Open

RDK-61784: Handle device type RFC after xconf sync#219
NareshM1702 wants to merge 2 commits into
developfrom
topic/RDK-61784

Conversation

@NareshM1702

Copy link
Copy Markdown
Contributor

No description provided.

@NareshM1702
NareshM1702 requested a review from a team as a code owner July 23, 2026 10:21
Copilot AI review requested due to automatic review settings July 23, 2026 10:21

Copilot AI left a comment

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.

Pull request overview

This PR updates RFC Manager’s Xconf response processing to react to changes in the DeviceType TR-181 parameter after an Xconf sync, with the intent of aligning dropbear’s runtime state with the new device type.

Changes:

  • Add handling in processXconfResponseConfigDataPart() to detect DeviceType updates (PROD builds) and conditionally restart dropbear.service based on whether dropbear is running with -f.
  • Introduce a new TR-181 key constant for DeviceType in rfc_mgr_key.h.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.

File Description
rfcMgr/rfc_xconf_handler.cpp Adds DeviceType-change handling to check dropbear runtime flags and restart the service when needed.
rfcMgr/rfc_mgr_key.h Adds a new macro for the DeviceType TR-181 key string.
Comments suppressed due to low confidence (2)

rfcMgr/rfc_xconf_handler.cpp:2591

  • DeviceType values are normalized/stored as lowercase (e.g., getDeviceTypeRFC() maps to "test"/"prod" and gtests write "test"/"prod"), but this new logic compares against uppercase "TEST"/"PROD". That makes the dropbear restart path never trigger when Xconf/TR181 uses lowercase values.
                            if (newValue == "TEST" && !dropbearHasF)
                            {
                                RDK_LOG(RDK_LOG_INFO, LOG_RFCMGR, "[%s:%d] DeviceType=TEST, restarting dropbear with -f\n", __FUNCTION__, __LINE__);
                                int svcRet = v_secure_system("systemctl restart dropbear.service");
                                if (svcRet != 0)

rfcMgr/rfc_xconf_handler.cpp:2577

  • If v_secure_popen() fails, the code silently proceeds with dropbearHasF=false. This is inconsistent with other v_secure_popen() usages in this file (which log and return) and makes troubleshooting difficult.
                            FILE *checkFp = v_secure_popen("r", "ps w 2>/dev/null | grep '[d]ropbear'");
                            if (checkFp)
                            {
                                char checkBuf[512] = {0};
                                while (fgets(checkBuf, sizeof(checkBuf) - 1, checkFp))

Comment thread rfcMgr/rfc_mgr_key.h
Comment on lines 41 to 43
#define TELEMETRY_CONFIG_URL "Device.DeviceInfo.X_RDKCENTRAL-COM_RFC.Feature.Telemetry.ConfigURL"
#define RFC_DEVICE_TYPE_KEY "Device.DeviceInfo.X_RDKCENTRAL-COM_RFC.Identity.DeviceType"
#define XCONF_SELECTOR_NAME "XconfSelector"
Comment on lines +2566 to +2570
if (_ebuild_type == ePROD) {
if(newKey == RFC_DEVICE_TYPE_KEY)
{
RDK_LOG(RDK_LOG_INFO, LOG_RFCMGR, "[%s:%d] DeviceType changed to '%s', checking dropbear -f state\n", __FUNCTION__, __LINE__, newValue.c_str());

@github-actions

Copy link
Copy Markdown

Code Coverage Summary

                             Total:|80.8%   2342|93.2%   133|    -      0

}
std::string account_key_str = RFC_ACCOUNT_ID_KEY_STR;
if (_ebuild_type == ePROD) {
if(newKey == RFC_DEVICE_TYPE_KEY)

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Check if this validation & restart can be moved somewhere else in CPC.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants