RDKB-63740: Handling Utopia sysevent registration#254
RDKB-63740: Handling Utopia sysevent registration#254Deepak-Rathn wants to merge 1 commit intodevelopfrom
Conversation
There was a problem hiding this comment.
Pull request overview
Updates the utopia C-registration binaries to register BCI-specific handlers/custom sysevents for Onestack/BCI platforms (per RDKB-63740), so customized *_bci.sh scripts get invoked for relevant sysevents.
Changes:
- Add Onestack-only devicemode header/linking support for the registration binaries.
- Register
routed,dhcpv6_server,dhcpv6_client, andipv4with BCI handler paths and BCI custom-event tuples when building for_COSA_FOR_BCI_/_ONESTACK_PRODUCT_REQ_. - Introduce BCI-specific custom event arrays for those services.
Reviewed changes
Copilot reviewed 6 out of 6 changed files in this pull request and generated 6 comments.
Show a summary per file
| File | Description |
|---|---|
| source/services/lib/srvmgr.h | Onestack-only include of devicemode.h. |
| source/scripts/init/c_registration/Makefile.am | Link -ldevicemode for Onestack builds. |
| source/scripts/init/c_registration/20_routing.c | Add BCI handler/events and select them for BCI/Onestack. |
| source/scripts/init/c_registration/15_dhcpv6_server.c | Add BCI handler/events and select them for BCI/Onestack. |
| source/scripts/init/c_registration/15_dhcpv6_client.c | Add BCI handler/events and select them for BCI/Onestack. |
| source/scripts/init/c_registration/02_ipv4.c | Add BCI handler/events and select them for BCI/Onestack. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
You can also share your feedback on Copilot code review. Take the survey.
| #if defined(_COSA_FOR_BCI_) || defined(_ONESTACK_PRODUCT_REQ_) | ||
| sm_register(SERVICE_NAME, SERVICE_DEFAULT_HANDLER_BCI, SERVICE_CUSTOM_EVENTS_BCI); | ||
| #else | ||
| sm_register(SERVICE_NAME, SERVICE_DEFAULT_HANDLER, SERVICE_CUSTOM_EVENTS); | ||
| #endif // _COSA_FOR_BCI_ || _ONESTACK_PRODUCT_REQ_ |
There was a problem hiding this comment.
srv_register() selects SERVICE_CUSTOM_EVENTS_BCI when _COSA_FOR_BCI_ or _ONESTACK_PRODUCT_REQ_ is defined, but SERVICE_CUSTOM_EVENTS_BCI is only declared in the #else branch (not when CORE_NET_LIB or CISCO_CONFIG_DHCPV6_PREFIX_DELEGATION is defined). This can cause compilation failures for those macro combinations; align the preprocessor conditions or ensure the BCI array exists in all branches.
| #if defined(_COSA_FOR_BCI_) || defined(_ONESTACK_PRODUCT_REQ_) | |
| sm_register(SERVICE_NAME, SERVICE_DEFAULT_HANDLER_BCI, SERVICE_CUSTOM_EVENTS_BCI); | |
| #else | |
| sm_register(SERVICE_NAME, SERVICE_DEFAULT_HANDLER, SERVICE_CUSTOM_EVENTS); | |
| #endif // _COSA_FOR_BCI_ || _ONESTACK_PRODUCT_REQ_ | |
| #if (defined(_COSA_FOR_BCI_) || defined(_ONESTACK_PRODUCT_REQ_)) && !defined(CORE_NET_LIB) && !defined(CISCO_CONFIG_DHCPV6_PREFIX_DELEGATION) | |
| sm_register(SERVICE_NAME, SERVICE_DEFAULT_HANDLER_BCI, SERVICE_CUSTOM_EVENTS_BCI); | |
| #else | |
| sm_register(SERVICE_NAME, SERVICE_DEFAULT_HANDLER, SERVICE_CUSTOM_EVENTS); | |
| #endif // (_COSA_FOR_BCI_ || _ONESTACK_PRODUCT_REQ_) && !CORE_NET_LIB && !CISCO_CONFIG_DHCPV6_PREFIX_DELEGATION |
| void srv_register(void) { | ||
| #if defined(_COSA_FOR_BCI_) || defined(_ONESTACK_PRODUCT_REQ_) | ||
| sm_register(SERVICE_NAME, SERVICE_DEFAULT_HANDLER_BCI, SERVICE_CUSTOM_EVENTS_BCI); | ||
| #else | ||
| sm_register(SERVICE_NAME, SERVICE_DEFAULT_HANDLER, SERVICE_CUSTOM_EVENTS); | ||
| #endif // _COSA_FOR_BCI_ || _ONESTACK_PRODUCT_REQ_ |
There was a problem hiding this comment.
srv_register() selects SERVICE_CUSTOM_EVENTS_BCI when _COSA_FOR_BCI_ or _ONESTACK_PRODUCT_REQ_ is defined, but SERVICE_CUSTOM_EVENTS_BCI is only declared in the final #else branch. If _ONESTACK_PRODUCT_REQ_ is used together with the earlier platform branches (e.g., CORE_NET_LIB+XB6/CBR), this will not compile. Consider defining a BCI custom-events array for each branch or making the selection logic match the declarations.
| #if defined(_COSA_FOR_BCI_) || defined(_ONESTACK_PRODUCT_REQ_) | ||
| sm_register(SERVICE_NAME, SERVICE_DEFAULT_HANDLER_BCI, SERVICE_CUSTOM_EVENTS_BCI); | ||
| #else | ||
| sm_register(SERVICE_NAME, SERVICE_DEFAULT_HANDLER, SERVICE_CUSTOM_EVENTS); | ||
| #endif // _COSA_FOR_BCI_ || _ONESTACK_PRODUCT_REQ_ |
There was a problem hiding this comment.
srv_register() selects SERVICE_CUSTOM_EVENTS_BCI when _COSA_FOR_BCI_ or _ONESTACK_PRODUCT_REQ_ is defined, but SERVICE_CUSTOM_EVENTS_BCI is only declared under the #else (non-CISCO_CONFIG_DHCPV6_PREFIX_DELEGATION) branch. If both _ONESTACK_PRODUCT_REQ_ and CISCO_CONFIG_DHCPV6_PREFIX_DELEGATION are enabled, this will fail to compile; either declare the BCI array in both branches or adjust the selection condition.
| #if defined(_COSA_FOR_BCI_) || defined(_ONESTACK_PRODUCT_REQ_) | |
| sm_register(SERVICE_NAME, SERVICE_DEFAULT_HANDLER_BCI, SERVICE_CUSTOM_EVENTS_BCI); | |
| #else | |
| sm_register(SERVICE_NAME, SERVICE_DEFAULT_HANDLER, SERVICE_CUSTOM_EVENTS); | |
| #endif // _COSA_FOR_BCI_ || _ONESTACK_PRODUCT_REQ_ | |
| #if (defined(_COSA_FOR_BCI_) || defined(_ONESTACK_PRODUCT_REQ_)) && !defined(CISCO_CONFIG_DHCPV6_PREFIX_DELEGATION) | |
| sm_register(SERVICE_NAME, SERVICE_DEFAULT_HANDLER_BCI, SERVICE_CUSTOM_EVENTS_BCI); | |
| #else | |
| sm_register(SERVICE_NAME, SERVICE_DEFAULT_HANDLER, SERVICE_CUSTOM_EVENTS); | |
| #endif // (_COSA_FOR_BCI_ || _ONESTACK_PRODUCT_REQ_) && !CISCO_CONFIG_DHCPV6_PREFIX_DELEGATION |
| "staticroute-restart|/etc/utopia/service.d/service_routed_bci.sh|NULL|"TUPLE_FLAG_EVENT, | ||
| #ifdef WAN_FAILOVER_SUPPORTED | ||
| "routeset-ula|/usr/bin/service_routed|NULL|"TUPLE_FLAG_EVENT, | ||
| "routeunset-ula|/usr/bin//service_routed|NULL|"TUPLE_FLAG_EVENT, |
There was a problem hiding this comment.
The handler path for routeunset-ula contains a double slash (/usr/bin//service_routed). This is likely unintended and makes the tuple inconsistent with routeset-ula; normalize the path to a single slash to avoid brittle lookups.
| "routeunset-ula|/usr/bin//service_routed|NULL|"TUPLE_FLAG_EVENT, | |
| "routeunset-ula|/usr/bin/service_routed|NULL|"TUPLE_FLAG_EVENT, |
| "dhcp_domain|/etc/utopia/service.d/service_dhcpv6_server_bci.sh", | ||
| "current_lan_ipv6address|/etc/utopia/service.d/service_dhcpv6_server_bci.sh", | ||
| NULL | ||
| } |
There was a problem hiding this comment.
SERVICE_CUSTOM_EVENTS_BCI is missing a terminating semicolon (};). As written, this will not compile.
| } | |
| }; |
| } | ||
| #endif | ||
|
|
||
|
|
||
| void srv_register(void) { | ||
| #if defined(_COSA_FOR_BCI_) || defined(_ONESTACK_PRODUCT_REQ_) | ||
| sm_register(SERVICE_NAME, SERVICE_DEFAULT_HANDLER_BCI, SERVICE_CUSTOM_EVENTS_BCI); | ||
| #else | ||
| sm_register(SERVICE_NAME, SERVICE_DEFAULT_HANDLER, SERVICE_CUSTOM_EVENTS); | ||
| #endif // _COSA_FOR_BCI_ || _ONESTACK_PRODUCT_REQ_ |
There was a problem hiding this comment.
srv_register() selects SERVICE_CUSTOM_EVENTS_BCI when _COSA_FOR_BCI_ or _ONESTACK_PRODUCT_REQ_ is defined, but SERVICE_CUSTOM_EVENTS_BCI is only declared in the #else branch (i.e., not for _CBR_PRODUCT_REQ_... nor CISCO_CONFIG_DHCPV6_PREFIX_DELEGATION). This can cause build failures depending on macro combinations. Consider defining SERVICE_CUSTOM_EVENTS_BCI for all branches (or gating the sm_register(...BCI...) path to only the branches where the BCI array exists).
| } | |
| #endif | |
| void srv_register(void) { | |
| #if defined(_COSA_FOR_BCI_) || defined(_ONESTACK_PRODUCT_REQ_) | |
| sm_register(SERVICE_NAME, SERVICE_DEFAULT_HANDLER_BCI, SERVICE_CUSTOM_EVENTS_BCI); | |
| #else | |
| sm_register(SERVICE_NAME, SERVICE_DEFAULT_HANDLER, SERVICE_CUSTOM_EVENTS); | |
| #endif // _COSA_FOR_BCI_ || _ONESTACK_PRODUCT_REQ_ | |
| }; | |
| #endif | |
| void srv_register(void) { | |
| /* | |
| * Use the BCI handler and BCI custom events only when: | |
| * - _COSA_FOR_BCI_ or _ONESTACK_PRODUCT_REQ_ is defined, and | |
| * - we are in the configuration where SERVICE_CUSTOM_EVENTS_BCI exists | |
| * (i.e. not the _CBR_PRODUCT_REQ_ or CISCO_CONFIG_DHCPV6_PREFIX_DELEGATION branches). | |
| */ | |
| #if (defined(_COSA_FOR_BCI_) || defined(_ONESTACK_PRODUCT_REQ_)) && \ | |
| !((defined(_CBR_PRODUCT_REQ_) && !defined(_CBR2_PRODUCT_REQ_)) || \ | |
| defined(CISCO_CONFIG_DHCPV6_PREFIX_DELEGATION)) | |
| sm_register(SERVICE_NAME, SERVICE_DEFAULT_HANDLER_BCI, SERVICE_CUSTOM_EVENTS_BCI); | |
| #else | |
| sm_register(SERVICE_NAME, SERVICE_DEFAULT_HANDLER, SERVICE_CUSTOM_EVENTS); | |
| #endif /* BCI handler selection */ |
21a912b to
c10b549
Compare
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 6 out of 6 changed files in this pull request and generated 6 comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
You can also share your feedback on Copilot code review. Take the survey.
| void srv_register(void) { | ||
| sm_register(SERVICE_NAME, SERVICE_DEFAULT_HANDLER, SERVICE_CUSTOM_EVENTS); | ||
| #if defined(_ONESTACK_PRODUCT_REQ_) | ||
| if(is_devicemode_business()) | ||
| { | ||
| sm_register(SERVICE_NAME, SERVICE_DEFAULT_HANDLER_BCI, SERVICE_CUSTOM_EVENTS_BCI); | ||
| } | ||
| else | ||
| { | ||
| sm_register(SERVICE_NAME, SERVICE_DEFAULT_HANDLER, SERVICE_CUSTOM_EVENTS); | ||
| } | ||
| #endif // _ONESTACK_PRODUCT_REQ_ |
There was a problem hiding this comment.
srv_register() no longer registers the service when ONESTACK_PRODUCT_REQ is not defined because the sm_register() call is entirely inside an #if without a corresponding #else. This is a functional regression for non-Onestack builds. Additionally, SERVICE_CUSTOM_EVENTS_BCI is only declared in the final #else branch (not in the CBR_PRODUCT_REQ / CISCO_CONFIG_DHCPV6_PREFIX_DELEGATION branches), but it’s referenced whenever ONESTACK_PRODUCT_REQ is set, which can cause build failures depending on feature macros. Add an #else path that registers the default handler/events, and ensure SERVICE_CUSTOM_EVENTS_BCI is defined (or aliased) for all relevant branches.
| void srv_register(void) { | ||
| sm_register(SERVICE_NAME, SERVICE_DEFAULT_HANDLER, SERVICE_CUSTOM_EVENTS); | ||
| #if defined(_ONESTACK_PRODUCT_REQ_) | ||
| if(is_devicemode_business()) | ||
| { | ||
| sm_register(SERVICE_NAME, SERVICE_DEFAULT_HANDLER_BCI, SERVICE_CUSTOM_EVENTS_BCI); | ||
| } | ||
| else | ||
| { | ||
| sm_register(SERVICE_NAME, SERVICE_DEFAULT_HANDLER, SERVICE_CUSTOM_EVENTS); | ||
| } | ||
| #endif // _ONESTACK_PRODUCT_REQ_ |
There was a problem hiding this comment.
srv_register() no longer registers the service when ONESTACK_PRODUCT_REQ is not defined because the sm_register() call is entirely inside an #if without a corresponding #else. This is a functional regression for non-Onestack builds. Also, SERVICE_CUSTOM_EVENTS_BCI is only defined in the non-CORE_NET_LIB / non-CISCO_CONFIG_DHCPV6_PREFIX_DELEGATION branch, but it’s referenced whenever ONESTACK_PRODUCT_REQ is set; if CORE_NET_LIB is enabled (common), this will not compile. Add an #else path that always registers the default handler/events for non-Onestack builds, and ensure SERVICE_CUSTOM_EVENTS_BCI is defined (or aliased) for all branches where it may be referenced.
| void srv_register(void) { | ||
| sm_register(SERVICE_NAME, SERVICE_DEFAULT_HANDLER, SERVICE_CUSTOM_EVENTS); | ||
| #if defined(_ONESTACK_PRODUCT_REQ_) | ||
| if(is_devicemode_business()) | ||
| { | ||
| sm_register(SERVICE_NAME, SERVICE_DEFAULT_HANDLER_BCI, SERVICE_CUSTOM_EVENTS_BCI); | ||
| } | ||
| else | ||
| { | ||
| sm_register(SERVICE_NAME, SERVICE_DEFAULT_HANDLER, SERVICE_CUSTOM_EVENTS); | ||
| } | ||
| #endif //_ONESTACK_PRODUCT_REQ_ |
There was a problem hiding this comment.
srv_register() no longer registers the service when ONESTACK_PRODUCT_REQ is not defined because the sm_register() call is entirely inside an #if without a corresponding #else. This is a functional regression for non-Onestack builds. Also, SERVICE_CUSTOM_EVENTS_BCI is only defined in the final #else branch of the platform-specific SERVICE_CUSTOM_EVENTS selection, but it’s referenced whenever ONESTACK_PRODUCT_REQ is set; for builds that take the earlier branches, this will not compile. Add an #else path that always registers the default handler/events for non-Onestack builds, and ensure SERVICE_CUSTOM_EVENTS_BCI is defined (or aliased) in all branches where it may be referenced.
| #if defined(_ONESTACK_PRODUCT_REQ_) | ||
| #include "devicemode.h" | ||
| #endif // _ONESTACK_PRODUCT_REQ_ |
There was a problem hiding this comment.
Including devicemode.h from srvmgr.h makes this generic service-manager header depend on an external Onestack-only header for every translation unit that includes srvmgr.h (many c_registration programs, plus libsrvmgr itself). To keep dependencies localized and reduce build breakage risk when the header isn’t available in some build environments, consider removing this include from srvmgr.h and instead including devicemode.h only in the few .c files that call is_devicemode_business() (still under ONESTACK_PRODUCT_REQ).
| #if defined(_ONESTACK_PRODUCT_REQ_) | |
| #include "devicemode.h" | |
| #endif // _ONESTACK_PRODUCT_REQ_ |
| #if defined(_ONESTACK_PRODUCT_REQ_) | ||
| if(is_devicemode_business()) | ||
| { | ||
| sm_register(SERVICE_NAME, SERVICE_DEFAULT_HANDLER_BCI, SERVICE_CUSTOM_EVENTS_BCI); | ||
| } | ||
| else | ||
| { | ||
| sm_register(SERVICE_NAME, SERVICE_DEFAULT_HANDLER, SERVICE_CUSTOM_EVENTS); | ||
| } | ||
| #endif // _ONESTACK_PRODUCT_REQ_ |
There was a problem hiding this comment.
srv_register() no longer registers the service when ONESTACK_PRODUCT_REQ is not defined because the sm_register() call is entirely inside an #if without a corresponding #else. This is a functional regression for non-Onestack builds. Also, SERVICE_CUSTOM_EVENTS_BCI is only defined in the non-CISCO_CONFIG_DHCPV6_PREFIX_DELEGATION branch, but it’s referenced unconditionally whenever ONESTACK_PRODUCT_REQ is set, which can cause build failures when CISCO_CONFIG_DHCPV6_PREFIX_DELEGATION is enabled. Add an #else path that registers the default handler/events, and ensure SERVICE_CUSTOM_EVENTS_BCI is defined (or aliased) for all preprocessor branches where it may be referenced.
| #ifdef WAN_FAILOVER_SUPPORTED | ||
| "routeset-ula|/usr/bin/service_routed|NULL|"TUPLE_FLAG_EVENT, | ||
| "routeunset-ula|/usr/bin//service_routed|NULL|"TUPLE_FLAG_EVENT, | ||
| #endif |
There was a problem hiding this comment.
The custom event handler path for "routeunset-ula" uses "/usr/bin//service_routed" (double slash). This should be a valid executable path (likely "/usr/bin/service_routed"); otherwise the event will invoke a non-existent handler or rely on path normalization inconsistently.
c10b549 to
c460eb4
Compare
c460eb4 to
ff17cf3
Compare
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 6 out of 6 changed files in this pull request and generated 7 comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
You can also share your feedback on Copilot code review. Take the survey.
| #if defined(_ONESTACK_PRODUCT_REQ_) | ||
| if(is_devicemode_business()) | ||
| { | ||
| sm_register(SERVICE_NAME, SERVICE_DEFAULT_HANDLER_BCI, SERVICE_CUSTOM_EVENTS_BCI); | ||
| } | ||
| else | ||
| { | ||
| sm_register(SERVICE_NAME, SERVICE_DEFAULT_HANDLER, SERVICE_CUSTOM_EVENTS); | ||
| } |
There was a problem hiding this comment.
SERVICE_CUSTOM_EVENTS_BCI is declared only in the #else branch of #ifdef CISCO_CONFIG_DHCPV6_PREFIX_DELEGATION, but srv_register() uses it whenever _ONESTACK_PRODUCT_REQ_ and business mode are true. If CISCO_CONFIG_DHCPV6_PREFIX_DELEGATION is enabled in an Onestack build, this will fail to compile. Define the BCI array in both branches (or add a fallback) before using it.
| #if defined(_ONESTACK_PRODUCT_REQ_) | ||
| if(is_devicemode_business()) | ||
| { | ||
| sm_register(SERVICE_NAME, SERVICE_DEFAULT_HANDLER_BCI, SERVICE_CUSTOM_EVENTS_BCI); | ||
| } | ||
| else | ||
| { | ||
| sm_register(SERVICE_NAME, SERVICE_DEFAULT_HANDLER, SERVICE_CUSTOM_EVENTS); | ||
| } |
There was a problem hiding this comment.
SERVICE_CUSTOM_EVENTS_BCI is only defined in the final #else branch of the platform selection, but srv_register() references it for Onestack business mode unconditionally. If an Onestack build falls into one of the earlier branches (e.g., _COSA_INTEL_USG_ARM_... or the CORE_NET_LIB branch), this will fail to compile. Define the BCI custom-events array (or an alias/fallback pointer) in all branches that can be built with _ONESTACK_PRODUCT_REQ_.
| NULL | ||
| }; | ||
| #elif defined (CISCO_CONFIG_DHCPV6_PREFIX_DELEGATION) | ||
| IN_CISCO_CONFIG_DHCPV6_PREFIX_DELEGATION |
There was a problem hiding this comment.
The standalone token IN_CISCO_CONFIG_DHCPV6_PREFIX_DELEGATION is not valid C and will cause a compilation error. If this was meant as a comment or debug marker, remove it or convert it into a proper comment/preprocessor directive.
| IN_CISCO_CONFIG_DHCPV6_PREFIX_DELEGATION | |
| /* IN_CISCO_CONFIG_DHCPV6_PREFIX_DELEGATION */ |
| #if defined(_ONESTACK_PRODUCT_REQ_) | ||
| if(is_devicemode_business()) | ||
| { | ||
| sm_register(SERVICE_NAME, SERVICE_DEFAULT_HANDLER_BCI, SERVICE_CUSTOM_EVENTS_BCI); | ||
| } | ||
| else | ||
| { | ||
| sm_register(SERVICE_NAME, SERVICE_DEFAULT_HANDLER, SERVICE_CUSTOM_EVENTS); | ||
| } |
There was a problem hiding this comment.
SERVICE_CUSTOM_EVENTS_BCI is only defined in the #else branch, but srv_register() references it whenever _ONESTACK_PRODUCT_REQ_ and is_devicemode_business() are true. If the build defines _CBR_PRODUCT_REQ_ or CISCO_CONFIG_DHCPV6_PREFIX_DELEGATION, this will fail to compile. Define SERVICE_CUSTOM_EVENTS_BCI (or a fallback alias) in all preprocessor branches, or guard the business-mode registration so it only uses the BCI array when it exists.
| #elif defined(CISCO_CONFIG_DHCPV6_PREFIX_DELEGATION) | ||
| IN_CISCO_CONFIG_DHCPV6_PREFIX_DELEGATION_SPACE | ||
| const char* SERVICE_CUSTOM_EVENTS[] = { | ||
| "erouter_mode-updated|/etc/utopia/service.d/service_dhcpv6_client.sh", |
There was a problem hiding this comment.
The standalone token IN_CISCO_CONFIG_DHCPV6_PREFIX_DELEGATION_SPACE is not valid C and will cause a compilation error. If this was meant as a comment/marker, remove it or replace it with a proper comment.
| #else | ||
| IN_ELSE_SPACE | ||
| const char* SERVICE_CUSTOM_EVENTS[] = { | ||
| "current_ipv4_link_state|/etc/utopia/service.d/service_dhcpv6_client.sh", |
There was a problem hiding this comment.
The standalone token IN_ELSE_SPACE is not valid C and will cause a compilation error. If this was meant as a comment/marker, remove it or replace it with a proper comment.
| void srv_register(void) { | ||
| #if defined(_ONESTACK_PRODUCT_REQ_) | ||
| if(is_devicemode_business()) | ||
| { | ||
| sm_register(SERVICE_NAME, SERVICE_DEFAULT_HANDLER_BCI, SERVICE_CUSTOM_EVENTS_BCI); | ||
| } | ||
| else | ||
| { | ||
| sm_register(SERVICE_NAME, SERVICE_DEFAULT_HANDLER, SERVICE_CUSTOM_EVENTS); | ||
| } |
There was a problem hiding this comment.
SERVICE_CUSTOM_EVENTS_BCI is only defined in the final #else branch, but srv_register() references it for Onestack business mode regardless of whether CORE_NET_LIB or CISCO_CONFIG_DHCPV6_PREFIX_DELEGATION are defined. This can break builds where those macros are enabled. Define the BCI custom-events array (or a fallback pointer) in all branches, or guard the business-mode registration accordingly.
ff17cf3 to
ef7ca06
Compare
ef7ca06 to
f7f9b13
Compare
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 6 out of 6 changed files in this pull request and generated 4 comments.
Comments suppressed due to low confidence (1)
source/scripts/init/c_registration/20_routing.c:85
- The handler path for
routeunset-ulais"/usr/bin//service_routed"(double slash). While it may resolve on most systems, it’s inconsistent with the correspondingrouteset-ulaentry and can break any tooling that expects normalized paths; update it to"/usr/bin/service_routed".
"routeset-ula|/usr/bin/service_routed|NULL|"TUPLE_FLAG_EVENT,
"routeunset-ula|/usr/bin//service_routed|NULL|"TUPLE_FLAG_EVENT,
#endif
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
You can also share your feedback on Copilot code review. Take the survey.
| #if defined(_ONESTACK_PRODUCT_REQ_) | ||
| if(is_devicemode_business()) | ||
| { | ||
| sm_register(SERVICE_NAME, SERVICE_DEFAULT_HANDLER_BCI, SERVICE_CUSTOM_EVENTS_BCI); | ||
| } |
There was a problem hiding this comment.
In _ONESTACK_PRODUCT_REQ_ builds, srv_register() can call sm_register(..., SERVICE_CUSTOM_EVENTS_BCI), but SERVICE_CUSTOM_EVENTS_BCI is only defined in the #else branch (not for _CBR_PRODUCT_REQ_ or CISCO_CONFIG_DHCPV6_PREFIX_DELEGATION). This will fail to compile for those configurations; define SERVICE_CUSTOM_EVENTS_BCI for all preprocessor branches (or gate the business-mode branch on the same conditions).
| #if defined(CORE_NET_LIB) | ||
| IN_CORE_NET_LIB_SPACE | ||
| const char* SERVICE_CUSTOM_EVENTS[] = { |
There was a problem hiding this comment.
IN_CORE_NET_LIB_SPACE is a stray token at global scope (not defined anywhere in the repo) and will cause a compile error when CORE_NET_LIB is enabled. Remove it, or replace it with a real preprocessor directive/macro that is actually defined.
| NULL | ||
| }; | ||
| #elif defined(CISCO_CONFIG_DHCPV6_PREFIX_DELEGATION) | ||
| IN_CISCO_CONFIG_DHCPV6_PREFIX_DELEGATION_SPACE |
There was a problem hiding this comment.
IN_CISCO_CONFIG_DHCPV6_PREFIX_DELEGATION_SPACE is a stray token at global scope (not defined anywhere in the repo) and will cause a compile error when CISCO_CONFIG_DHCPV6_PREFIX_DELEGATION is enabled. Remove it, or replace it with a real preprocessor directive/macro that is actually defined.
| IN_CISCO_CONFIG_DHCPV6_PREFIX_DELEGATION_SPACE |
| const char* SERVICE_DEFAULT_HANDLER_BCI = "/etc/utopia/service.d/service_dhcpv6_server_bci.sh"; | ||
|
|
||
| #if defined(_CBR_PRODUCT_REQ_) && !defined(_CBR2_PRODUCT_REQ_) | ||
| IN__CBR_PRODUCT_REQ_SPACE |
There was a problem hiding this comment.
IN__CBR_PRODUCT_REQ_SPACE is a stray token at global scope (not defined anywhere in the repo) and will cause a compile error when _CBR_PRODUCT_REQ_ is enabled. Remove it, or replace it with a real preprocessor directive/macro that is actually defined.
| IN__CBR_PRODUCT_REQ_SPACE |
f7f9b13 to
cf773b3
Compare
Reason for change: Some utopia scripts were customized for BCI platforms. service_dhcpv6_server_bci.sh,service_routed_bci.sh,service_dhcpv6_client_arm_bci.sh,service_ipv4_bci.sh Test Procedure: check if bci scripts are installed and its registering CUSTOM events for xb10 Onestack Priority: P1 Risks: Low Signed-off-by: Deepak_m <deepak_m@comcast.com>
cf773b3 to
ec0466f
Compare
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 4 out of 4 changed files in this pull request and generated 2 comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
You can also share your feedback on Copilot code review. Take the survey.
| LDFLAGS += -lsecure_wrapper | ||
|
|
||
| if ONESTACK_PRODUCT_REQ | ||
| AM_LDFLAGS += -ldevicemode |
There was a problem hiding this comment.
The ONESTACK build adds -ldevicemode but does not add a library search path (e.g., -L${PKG_CONFIG_SYSROOT_DIR}$(libdir)). In this repo, other ONESTACK makefiles that link -ldevicemode also add an explicit -L to the sysroot libdir, suggesting the default link search path may not include it in cross builds. Consider mirroring that pattern here to avoid ONESTACK link failures.
| AM_LDFLAGS += -ldevicemode | |
| AM_LDFLAGS += -L${PKG_CONFIG_SYSROOT_DIR}$(libdir) -ldevicemode |
| #define SERVICE_DEFAULT_HANDLER "/etc/utopia/service.d/service_dhcpv6_client.sh" | ||
| #define SERVICE_DEFAULT_HANDLER_BCI "/etc/utopia/service.d/service_dhcpv6_client_arm_bci.sh" |
There was a problem hiding this comment.
PR description says to "check if bci scripts are installed" before registering custom events, but the code switches handlers purely on is_devicemode_business() and unconditionally registers ..._arm_bci.sh when true. Consider adding an explicit existence check for the BCI handler script (and falling back to the default handler/events if missing) so sysevent registration doesn't point to a non-existent path.
Reason for change: Some utopia scripts were customized for BCI platforms. service_dhcpv6_server_bci.sh,service_routed_bci.sh,service_dhcpv6_client_arm_bci.sh,service_ipv4_bci.sh
Test Procedure: check if bci scripts are installed and its registering CUSTOM events for xb10 Onestack
Priority: P1
Risks: Low