RDKB-63166: Update device.properties file during runtime#233
RDKB-63166: Update device.properties file during runtime#233abhishek-kumaracee2 wants to merge 1 commit intodevelopfrom
Conversation
There was a problem hiding this comment.
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_initlibrary
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()) |
There was a problem hiding this comment.
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.
| if ( 1 == addPartnerDefaultsToDevPropFile()) | |
| if ( 0 != addPartnerDefaultsToDevPropFile()) |
| #if defined (_ONESTACK_PRODUCT_REQ_) | ||
| if (0 == strcasecmp (PartnerID, "comcast-business")) | ||
| { | ||
| if ( 1 == addPartnerDefaultsToDevPropFile()) | ||
| { | ||
| APPLY_PRINT("%s - Func addPartnerDefaultsToDevPropFile() Failed \n", __FUNCTION__); | ||
| } | ||
| } |
There was a problem hiding this comment.
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.
| sysevent_close(global_fd, global_id); | ||
|
|
||
| #if defined (_ONESTACK_PRODUCT_REQ_) | ||
| if (0 == strcasecmp (PartnerID, "comcast-business")) |
There was a problem hiding this comment.
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
05de44c to
e124b3d
Compare
Reason for change: for onestack support
Test Procedure: NA
Risks: Low
Priority: Medium
Signed-off-by: abhishek_kumaracee2@comcast.com