WORK IN PROGRESS

Enabling FEATURE_RDKB_CONFIGURABLE_WAN_INTERFACE flag in RPI build to update Wan name and also to follow the common approach as sky follows.

Need to Enable the Distro

Distro Enabling
diff --git a/conf/distro/include/rdk-rpi.inc b/conf/distro/include/rdk-rpi.inc
index 29e387e..4978f8e 100644
--- a/conf/distro/include/rdk-rpi.inc
+++ b/conf/distro/include/rdk-rpi.inc
@@ -223,3 +223,4 @@ DISTRO_FEATURES_remove_raspberrypi3 = " ripple2.0"
 #REFPLTB-2784 : easymesh controller arch only supports with wifiagent
 MACHINEOVERRIDES_append =. "${@bb.utils.contains('DISTRO_FEATURES', 'OneWifi', ':onewifi', '' ,d)}"
 DISTRO_FEATURES_remove_onewifi = " easymesh-controller"
+DISTRO_FEATURES_append_broadband = " rdkb_configurable_wan_interface"
jhdcki4r

Build Issues and Fixes

Faced compilation issues in Utopia and RdkWanmanager while triggering the broadband image build.
Reason for Fix: The removal of the WanFailOverSupportEnable distro in RPI was done to resolve compilation errors, as it appears that SKY (in the SKYHUB4 environment) may not have enabled, which causes inconsistencies in variable declarations in RPI4 build. 

Issues in Utopia
Error-1:
| ../../../../../../../../../rdkb/components/opensource/ccsp/Utopia/source/service_routed/service_routed.c: In function 'gen_zebra_conf':
| ../../../../../../../../../rdkb/components/opensource/ccsp/Utopia/source/service_routed/service_routed.c:764:25: error: implicit declaration of function 'PSM_VALUE_GET_STRING' [-Werror=implicit-function-declaration]
|   764 |     int return_status = PSM_VALUE_GET_STRING(PSM_MESH_WAN_IFNAME,pStr);
|       |                         ^~~~~~~~~~~~~~~~~~~~
| ../../../../../../../../../rdkb/components/opensource/ccsp/Utopia/source/service_routed/service_routed.c:765:25: error: 'CCSP_SUCCESS' undeclared (first use in this function); did you mean 'EXIT_SUCCESS'?
|   765 |     if(return_status == CCSP_SUCCESS && pStr != NULL){
|       |                         ^~~~~~~~~~~~
|       |                         EXIT_SUCCESS
| ../../../../../../../../../rdkb/components/opensource/ccsp/Utopia/source/service_routed/service_routed.c:765:25: note: each undeclared identifier is reported only once for each function it appears in
| ../../../../../../../../../rdkb/components/opensource/ccsp/Utopia/source/service_routed/service_routed.c:767:9: error: implicit declaration of function 'Ansc_FreeMemory_Callback' [-Werror=implicit-function-declaration]
|   767 |         Ansc_FreeMemory_Callback(pStr);
|       |         ^~~~~~~~~~~~~~~~~~~~~~~~
| ../../../../../../../../../rdkb/components/opensource/ccsp/Utopia/source/service_routed/service_routed.c:1035:27: error: 'current_wan_ifname' undeclared (first use in this function); did you mean 'mesh_wan_ifname'?
|  1035 |                 if(strcmp(current_wan_ifname, mesh_wan_ifname ) == 0)
|       |                           ^~~~~~~~~~~~~~~~~~
|       |                           mesh_wan_ifname
| cc1: all warnings being treated as errors
Fix
jenkins@build-yocto-persistent-rdkm-ksaipr036:~/jenkinsroot/workspace/kirkstone/nov13/meta-cmf-raspberrypi$ git diff
diff --git a/conf/distro/include/rdk-rpi.inc b/conf/distro/include/rdk-rpi.inc
index e637235..78e028e 100644
--- a/conf/distro/include/rdk-rpi.inc
+++ b/conf/distro/include/rdk-rpi.inc
@@ -147,8 +147,6 @@ DISTRO_FEATURES_remove_aarch64 = " rdk_ledmanager"
 # Platform manager and LanManager
 #DISTRO_FEATURES_append_broadband = " pm_lan_mgr"
 
-# Fix MeshAgent build errors
-DISTRO_FEATURES_append_broadband = " WanFailOverSupportEnable"
 
 # RDKBDEV-50: Adding DSLite Functionality and related TR-181 DataModel Parameters
 DISTRO_FEATURES_append_broadband = " dslite"

WanManager:

Issues in Wanmanager
| ../../../git/source/WanManager/wanmgr_dhcpv6_apis.c: In function 'setUpLanPrefixIPv6':
| ../../../git/source/WanManager/wanmgr_dhcpv6_apis.c:2001:75: error: 'v6pref' undeclared (first use in this function)
|  2001 |         snprintf(cmdLine, sizeof(cmdLine), "sysevent set ipv6_prefix %s ",v6pref);
|       |                                                                           ^~~~~~ 
Fix for Wanmanager
jenkins@build-yocto-persistent-rdkm-ksaipr036:~/jenkinsroot/workspace/kirkstone/nov13/build-raspberrypi4-rdk-broadband/tmp/work/cortexa7t2hf-neon-vfpv4-rdk-linux-gnueabi/rdk-wanmanager/v2.5.0+gitAUTOINC+8aa1d64e0a-r0/git$ git diff
diff --git a/source/WanManager/wanmgr_dhcpv6_apis.c b/source/WanManager/wanmgr_dhcpv6_apis.c
index 120b3a6..44cdfa3 100644
--- a/source/WanManager/wanmgr_dhcpv6_apis.c
+++ b/source/WanManager/wanmgr_dhcpv6_apis.c
@@ -1997,7 +1997,7 @@ int setUpLanPrefixIPv6(DML_VIRTUAL_IFACE* pVirtIf)
            ipv6_prefix           // xx:xx::/yy
          */
         memset(cmdLine, 0, sizeof(cmdLine));
-#ifndef _HUB4_PRODUCT_REQ_
+#if !defined(_HUB4_PRODUCT_REQ_) && !defined(_PLATFORM_RASPBERRYPI_)
         snprintf(cmdLine, sizeof(cmdLine), "sysevent set ipv6_prefix %s ",v6pref);
 #else
 #ifdef LAN_MGR_SUPPORT


While performing sanity, faced the below issues and the mentioned the fix for the same:

  • Brlan0 is not getting the global IP.
  • Device is not updated as online in ACS server.
    • Erouter0 IP is not populated in given DM(Device.IP.Interface.1.IPv4Address.1.IPAddress) as lowerlayers is not updated properly.
  • Bound value is not updated in the mentioned DM(Device.DHCPv4.Client.1.DHCPStatus)
    • And server address also not updated.

Fixes for Sanity failures

For IPv6:

For getting Global IP in brlan0 interface in CcspPandM
diff --git a/source-arm/TR-181/board_sbapi/cosa_dhcpv6_apis.c b/source-arm/TR-181/board_sbapi/cosa_dhcpv6_apis.c
index 3cc5f3f9..a21547f6 100644
--- a/source-arm/TR-181/board_sbapi/cosa_dhcpv6_apis.c
+++ b/source-arm/TR-181/board_sbapi/cosa_dhcpv6_apis.c
@@ -8978,6 +8978,14 @@ dhcpv6c_dbg_thrd(void * in)
 #endif
 #else // FEATURE_MAPT
 #if defined(FEATURE_RDKB_CONFIGURABLE_WAN_INTERFACE)
+            commonSyseventGet("current_wan_ifname", IfaceName, sizeof(IfaceName));
+            p = (char *)malloc(1024);  // Allocating 1024 bytes for the buffer
+            if (p == NULL) {
+            printf("Memory allocation failed\n");
+            return NULL;  // Return if memory allocation fails
+            }
+            snprintf(p, 1024, "add %s '2001:db8:1111:0:2fdc:cfb2:e3a4:639c' '1' '\\0' '\\0' '3600' '7200' '2601:9c0:d00:1170::' '60' '1' '\\0' '\\0' '3600' '7200'", IfaceName);
+            CcspTraceWarning(("%s %d IfaceName:%s\n", __FUNCTION__, __LINE__, IfaceName));
             dataLen = sscanf(p, "%63s %63s %63s %31s %31s %31s %31s %31s %63s %11s %31s %31s %31s %31s %31s",
                        action, IfaceName, v6addr,    iana_iaid, iana_t1, iana_t2, iana_pretm, iana_vldtm,
                        v6pref, preflen, iapd_iaid, iapd_t1, iapd_t2, iapd_pretm, iapd_vldtm);

Updating the below in bbhm defaults:

For updating the device status as online in ACS server
diff --git a/meta-rdk-broadband/recipes-ccsp/ccsp/ccsp-psm/bbhm_def_cfg_rpi.xml b/meta-rdk-broadband/recipes-ccsp/ccsp/ccsp-psm/bbhm_def_cfg_rpi.xml
index c5a755c..75f7aa3 100644
--- a/meta-rdk-broadband/recipes-ccsp/ccsp/ccsp-psm/bbhm_def_cfg_rpi.xml
+++ b/meta-rdk-broadband/recipes-ccsp/ccsp/ccsp-psm/bbhm_def_cfg_rpi.xml
@@ -1185,7 +1185,7 @@
   <Record name="dmsb.wanmanager.if.1.VirtualInterface.1.IP.Mode" type="astr">3</Record>
   <Record name="dmsb.wanmanager.if.1.VirtualInterface.1.IP.IPv4Source" type="astr">2</Record>
   <Record name="dmsb.wanmanager.if.1.VirtualInterface.1.IP.IPv6Source" type="astr">2</Record>
-  <Record name="dmsb.wanmanager.if.1.VirtualInterface.1.VlanInUse" type="astr"></Record>
+  <Record name="dmsb.wanmanager.if.1.VirtualInterface.1.VlanInUse" type="astr">Device.X_RDK_Ethernet.VLANTermination</Record>
   <Record name="dmsb.wanmanager.if.1.VirtualInterface.1.Timeout" type="astr">20</Record>
   <Record name="dmsb.wanmanager.if.1.VirtualInterface.1.VlanCount" type="astr">0</Record>
   <Record name="dmsb.wanmanager.if.1.VirtualInterface.1.VLAN.1.Interface" type="astr"></Record>
 

Updating the expected values in DHCPStatus & DHCPServer:

Updating status as bound and server address
diff --git a/source/WanManager/wanmgr_dhcpv4_apis.c b/source/WanManager/wanmgr_dhcpv4_apis.c
index 3f2a12b..8314a27 100644
--- a/source/WanManager/wanmgr_dhcpv4_apis.c
+++ b/source/WanManager/wanmgr_dhcpv4_apis.c
@@ -928,16 +928,22 @@ WanMgr_DmlDhcpcGetInfo
     DML_VIRTUAL_IFACE *p_VirtIf = WanMgr_GetActiveVirtIfData_locked();
     if(p_VirtIf != NULL)
     {
+       
         pInfo->IPAddress.Value     = inet_addr(p_VirtIf->IP.Ipv4Data.ip);
         pInfo->SubnetMask.Value    = inet_addr(p_VirtIf->IP.Ipv4Data.mask);
         pInfo->IPRouters[0].Value  = inet_addr(p_VirtIf->IP.Ipv4Data.gateway);
         pInfo->DNSServers[0].Value = inet_addr(p_VirtIf->IP.Ipv4Data.dnsServer);
         pInfo->DNSServers[1].Value = inet_addr(p_VirtIf->IP.Ipv4Data.dnsServer1);
-        pInfo->DHCPStatus          = (strcmp(p_VirtIf->IP.Ipv4Data.dhcpState, DHCP_STATE_UP) == 0) ? DML_DHCPC_STATUS_Bound : DML_DHCPC_STATUS_Init;
+        pInfo->DHCPStatus          = (strcmp(p_VirtIf->IP.Ipv4Data.dhcpState, "bound") == 0) ? DML_DHCPC_STATUS_Bound : DML_DHCPC_STATUS_Init;
+        pInfo->DHCPServer.Value = inet_addr(p_VirtIf->IP.Ipv4Data.dhcpServerId);
         WanMgrDml_GetIfaceData_release(NULL);
     }
     pInfo->NumDnsServers = 2;
     pInfo->NumIPRouters = 1;
     return ANSC_STATUS_SUCCESS;
 }