Skip to content

Comments

RDKB-63166: Update device.properties file during runtime#233

Open
abhishek-kumaracee2 wants to merge 1 commit intodevelopfrom
feature/RDKB-63166-onestack
Open

RDKB-63166: Update device.properties file during runtime#233
abhishek-kumaracee2 wants to merge 1 commit intodevelopfrom
feature/RDKB-63166-onestack

Conversation

@abhishek-kumaracee2
Copy link
Contributor

Reason for change: for onestack support
Test Procedure: NA
Risks: Low
Priority: Medium
Signed-off-by: abhishek_kumaracee2@comcast.com

Copilot AI review requested due to automatic review settings February 19, 2026 16:05
@abhishek-kumaracee2 abhishek-kumaracee2 requested review from a team as code owners February 19, 2026 16:05
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This pull request adds runtime support for updating the device.properties file for OneStack products. It specifically targets the "comcast-business" partner ID and calls a new function from the onestack_init library to apply partner defaults to the device properties file.

Changes:

  • Added include for <onestack_init.h> header to access OneStack initialization functions
  • Added conditional logic to call addPartnerDefaultsToDevPropFile() for comcast-business partner ID
  • Updated Makefile to link against the -lonestack_init library

Reviewed changes

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

File Description
source/scripts/init/src/apply_system_defaults/apply_system_defaults.c Added include for onestack_init.h and conditional code block to update device.properties file at runtime for comcast-business partner
source/scripts/init/src/apply_system_defaults/Makefile.am Added -lonestack_init library dependency to linker flags for OneStack builds

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

#if defined (_ONESTACK_PRODUCT_REQ_)
if (0 == strcasecmp (PartnerID, "comcast-business"))
{
if ( 1 == addPartnerDefaultsToDevPropFile())
Copy link

Copilot AI Feb 19, 2026

Choose a reason for hiding this comment

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

The error checking pattern if ( 1 == addPartnerDefaultsToDevPropFile()) suggests that return value 1 indicates failure. However, this is inconsistent with the common C convention and the pattern used elsewhere in this codebase where 0 typically indicates success and non-zero (usually -1) indicates failure. For example, see line 3653 which checks if( 0 != ApplyPartnersObjectItemsIntoSysevents( PartnerID ) ) to detect failure.

Please verify that the return value convention for addPartnerDefaultsToDevPropFile() is correctly documented and that this check matches the actual return value semantics of the function. If the function follows standard C conventions (0 for success, non-zero for failure), this check should be if ( 0 != addPartnerDefaultsToDevPropFile()) instead.

Suggested change
if ( 1 == addPartnerDefaultsToDevPropFile())
if ( 0 != addPartnerDefaultsToDevPropFile())

Copilot uses AI. Check for mistakes.
Comment on lines 3660 to 3667
#if defined (_ONESTACK_PRODUCT_REQ_)
if (0 == strcasecmp (PartnerID, "comcast-business"))
{
if ( 1 == addPartnerDefaultsToDevPropFile())
{
APPLY_PRINT("%s - Func addPartnerDefaultsToDevPropFile() Failed \n", __FUNCTION__);
}
}
Copy link

Copilot AI Feb 19, 2026

Choose a reason for hiding this comment

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

The function call to addPartnerDefaultsToDevPropFile() is placed after sysevent_close(global_fd, global_id) on line 3658. If the addPartnerDefaultsToDevPropFile() function needs to interact with sysevent or relies on the sysevent connection being open, this placement would cause the function to fail. Please verify that addPartnerDefaultsToDevPropFile() does not require an active sysevent connection. If it does, this call should be moved before line 3658.

Copilot uses AI. Check for mistakes.
sysevent_close(global_fd, global_id);

#if defined (_ONESTACK_PRODUCT_REQ_)
if (0 == strcasecmp (PartnerID, "comcast-business"))
Copy link
Contributor

@apattu200 apattu200 Feb 19, 2026

Choose a reason for hiding this comment

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

Don't do check here. check inside addPartnerDefaultsToDevPropFile function with variable "devicemode"

Reason for change: for onestack support
Test Procedure: NA
Risks: Low
Priority: Medium
Signed-off-by: abhishek_kumaracee2@comcast.com
@abhishek-kumaracee2 abhishek-kumaracee2 force-pushed the feature/RDKB-63166-onestack branch from 05de44c to e124b3d Compare February 19, 2026 18:40
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.

2 participants