-
Notifications
You must be signed in to change notification settings - Fork 3
Feature: <Ethernet> Ethernet config rework (#12) #39
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: develop
Are you sure you want to change the base?
Changes from all commits
141afec
027912b
51517b6
750cbc9
8d94610
a544628
1317335
01acbb0
4c555fc
00a58e8
d8d0e6a
ceb33d4
93052de
1514a84
9dc31ab
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,23 @@ | ||
| From 29933d25342902578ccea1e6aa82fa0462798219 Mon Sep 17 00:00:00 2001 | ||
| From: Mathew McBride <[email protected]> | ||
| Date: Tue, 17 Feb 2026 12:08:25 +1100 | ||
| Subject: [PATCH] (meta-rdk-bsp-arm only) CcspCrSsp: remove 'mkdir | ||
| /rdklogs/logs' | ||
|
|
||
| This will fail under a read-only rootfs environment | ||
| --- | ||
| systemd_units/CcspCrSsp.service | 1 - | ||
| 1 file changed, 1 deletion(-) | ||
|
|
||
| diff --git a/systemd_units/CcspCrSsp.service b/systemd_units/CcspCrSsp.service | ||
| index a73813c..99383c6 100644 | ||
| --- a/systemd_units/CcspCrSsp.service | ||
| +++ b/systemd_units/CcspCrSsp.service | ||
| @@ -27,7 +27,6 @@ WorkingDirectory=/usr/ccsp | ||
| Environment="Subsys=eRT." | ||
| Environment="LOG4C_RCPATH=/etc" | ||
| EnvironmentFile=/etc/device.properties | ||
| -ExecStartPre=-/bin/sh -c 'mkdir -p /rdklogs/logs/' | ||
| ExecStartPre=/bin/sh -c '(/usr/ccsp/ccspSysConfigEarly.sh)' | ||
| ExecStart=/bin/sh -c '/usr/bin/CcspCrSsp -subsys $Subsys' | ||
| ExecStopPost=/bin/sh -c 'echo 0 >> /tmp/CcspCrSsp_Restarted' | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,26 @@ | ||
| From ef84fe084564e149c15855c67ecb267498353f44 Mon Sep 17 00:00:00 2001 | ||
| From: Mathew McBride <[email protected]> | ||
| Date: Tue, 3 Feb 2026 00:28:01 +0000 | ||
| Subject: [PATCH] (meta-rdk-bsp-arm only) systemd: CcspEthAgent: bring up all | ||
| ethX before starting | ||
|
|
||
| This is so WAN Manager will consider them as eligible interfaces in | ||
| it's selection policy. | ||
|
|
||
| Signed-off-by: Mathew McBride <[email protected]> | ||
| --- | ||
| systemd_units/CcspEthAgent.service | 1 + | ||
| 1 file changed, 1 insertion(+) | ||
|
|
||
| diff --git a/systemd_units/CcspEthAgent.service b/systemd_units/CcspEthAgent.service | ||
| index 260ac94..d548aa5 100644 | ||
| --- a/systemd_units/CcspEthAgent.service | ||
| +++ b/systemd_units/CcspEthAgent.service | ||
| @@ -28,6 +28,7 @@ Environment="Subsys=eRT." | ||
| Environment="LOG4C_RCPATH=/etc" | ||
| EnvironmentFile=/etc/device.properties | ||
| ExecStart=/bin/sh -c '/usr/bin/CcspEthAgent -subsys $Subsys' | ||
| +ExecStartPre=/bin/sh -c '/lib/rdk/bring_up_all_eth.sh' | ||
| ExecStopPost=/bin/sh -c 'echo "`date`: Stopping/Restarting CcspEthAgent" >> ${PROCESS_RESTART_LOG}' | ||
| SyslogIdentifier=CcspEthAgent | ||
| Restart=always |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,20 @@ | ||
| [Unit] | ||
| Description=PsmSsp service | ||
|
|
||
| After=CcspCrSsp.service | ||
|
|
||
| [Service] | ||
| Type=forking | ||
| PIDFile=/var/tmp/PsmSsp.pid | ||
| WorkingDirectory=/usr/ccsp | ||
| Environment="Subsys=eRT." | ||
| Environment="LOG4C_RCPATH=/etc" | ||
| EnvironmentFile=/etc/device.properties | ||
| ExecStart=/bin/sh -c '/usr/bin/PsmSsp -subsys $Subsys' | ||
| ExecStartPre="/usr/ccsp/psm/copy_config.sh" | ||
| ExecStopPost=/bin/sh -c 'echo "`date`: Stopping/Restarting PsmSsp" >> ${PROCESS_RESTART_LOG}' | ||
| Restart=always | ||
| SyslogIdentifier=PsmSsp | ||
|
|
||
| [Install] | ||
| WantedBy=multi-user.target |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,107 @@ | ||
| From 45c33e46dacceb6afb083454157e48ba71acdcd5 Mon Sep 17 00:00:00 2001 | ||
| From: mahanteshchitt <[email protected]> | ||
| Date: Mon, 1 Dec 2025 17:57:16 +0530 | ||
| Subject: [PATCH] RDKBACCL-1082:Make wan interface name generic (erouter0) in | ||
| arm system ready image. | ||
|
|
||
| Reason for Change:Getting the Wan interface name from the hal_ethsw. | ||
| Test Procedure:On boot-up erouter0 inetrface should IP. | ||
| Risks:Low | ||
|
|
||
| Signed-off-by: mahanteshchitt <[email protected]> | ||
| --- | ||
| source/TR-181/board_sbapi/cosa_ethernet_apis.c | 14 ++++++++++---- | ||
| source/TR-181/board_sbapi/cosa_ethernet_manager.c | 2 +- | ||
| .../middle_layer_src/cosa_ethernet_internal.c | 5 +++-- | ||
| 3 files changed, 14 insertions(+), 7 deletions(-) | ||
|
|
||
| diff --git a/source/TR-181/board_sbapi/cosa_ethernet_apis.c b/source/TR-181/board_sbapi/cosa_ethernet_apis.c | ||
| index a810f95..5441b4e 100755 | ||
| --- a/source/TR-181/board_sbapi/cosa_ethernet_apis.c | ||
| +++ b/source/TR-181/board_sbapi/cosa_ethernet_apis.c | ||
| @@ -672,6 +672,8 @@ COSA_DML_IF_STATUS getIfStatus(const PUCHAR name, struct ifreq *pIfr) | ||
| #define ETHWAN_DEF_INTF_NAME "eth5" | ||
| #elif defined (_PLATFORM_BANANAPI_R4_) | ||
| #define ETHWAN_DEF_INTF_NAME "lan0" | ||
| +#elif defined (_PLATFORM_GENERICARM_) | ||
| +#define ETHWAN_DEF_INTF_NAME "eth3" | ||
| #else | ||
| #define ETHWAN_DEF_INTF_NAME "eth0" | ||
| #endif | ||
| @@ -3463,9 +3465,9 @@ CosaDmlEthInit( | ||
| } | ||
| } | ||
| #else | ||
| - #if defined(_PLATFORM_RASPBERRYPI_) || defined(_PLATFORM_TURRIS_) || defined(_PLATFORM_BANANAPI_R4_) | ||
| + #if defined(_PLATFORM_RASPBERRYPI_) || defined(_PLATFORM_TURRIS_) || defined(_PLATFORM_BANANAPI_R4_) || defined(_PLATFORM_GENERICARM_) | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. TURRIS should be eliminated is not supported anymore |
||
|
|
||
| - char wanPhyName[20] = {0},out_value[20] = {0}; | ||
| + char wanPhyName[20] = {0},out_value[20] = {0},wan_interface_name[20] ={0}; | ||
|
|
||
| sysevent_get(sysevent_fd, sysevent_token, "wan_ifname", out_value, sizeof(out_value)); | ||
| if (out_value[0] != '\0') | ||
| @@ -3480,12 +3482,16 @@ CosaDmlEthInit( | ||
| } | ||
| #ifdef CORE_NET_LIB | ||
| libnet_status status; | ||
| - status=interface_down(ETHWAN_DEF_INTF_NAME); | ||
| + if (GWP_GetEthWanInterfaceName((unsigned char*)wan_interface_name, sizeof(wan_interface_name)) != RETURN_OK) { | ||
| + CcspTraceError(("Failed to get WAN interface name via GWP_GetEthWanInterfaceName\n")); | ||
| + return -1; | ||
| + } | ||
| + status=interface_down(wan_interface_name); | ||
| if(status != CNL_STATUS_SUCCESS) | ||
| { | ||
| CcspTraceInfo(("Failed to down the interface %s\n",ETHWAN_DEF_INTF_NAME)); | ||
| } | ||
| - status=interface_rename(ETHWAN_DEF_INTF_NAME,wanPhyName); | ||
| + status=interface_rename(wan_interface_name,wanPhyName); | ||
| if(status != CNL_STATUS_SUCCESS) | ||
| { | ||
| CcspTraceInfo(("Failed to rename the interface %s with %s\n",ETHWAN_DEF_INTF_NAME,wanPhyName)); | ||
| diff --git a/source/TR-181/board_sbapi/cosa_ethernet_manager.c b/source/TR-181/board_sbapi/cosa_ethernet_manager.c | ||
| index fe97d7f..5ee855a 100644 | ||
| --- a/source/TR-181/board_sbapi/cosa_ethernet_manager.c | ||
| +++ b/source/TR-181/board_sbapi/cosa_ethernet_manager.c | ||
| @@ -375,7 +375,7 @@ static ethSmState_t Transition_EthWanLinkFound(PETH_SM_PRIVATE_INFO pstInfo) | ||
| #if defined(FEATURE_RDKB_WAN_AGENT) | ||
| if (ANSC_STATUS_SUCCESS != CosaDmlEthCreateEthLink(pstInfo->Name, stGlobalInfo.Path)) | ||
| #elif defined(FEATURE_RDKB_WAN_MANAGER) | ||
| - #if defined(_PLATFORM_RASPBERRYPI_) || defined(_PLATFORM_TURRIS_) || defined(_PLATFORM_BANANAPI_R4_) | ||
| + #if defined(_PLATFORM_RASPBERRYPI_) || defined(_PLATFORM_TURRIS_) || defined(_PLATFORM_BANANAPI_R4_) || defined(_PLATFORM_GENERICARM_) | ||
| CHAR wanPhyName[20] = {0},out_value[20] = {0}; | ||
| if (!syscfg_get(NULL, "wan_physical_ifname", out_value, sizeof(out_value))) | ||
| { | ||
| diff --git a/source/TR-181/middle_layer_src/cosa_ethernet_internal.c b/source/TR-181/middle_layer_src/cosa_ethernet_internal.c | ||
| index e48d018..329bbef 100644 | ||
| --- a/source/TR-181/middle_layer_src/cosa_ethernet_internal.c | ||
| +++ b/source/TR-181/middle_layer_src/cosa_ethernet_internal.c | ||
| @@ -83,7 +83,7 @@ | ||
| #endif | ||
| #endif //#if defined (FEATURE_RDKB_WAN_MANAGER) | ||
|
|
||
| -#if defined (WAN_FAILOVER_SUPPORTED) || defined(RBUS_BUILD_FLAG_ENABLE) || defined (_HUB4_PRODUCT_REQ_) || defined(_PLATFORM_RASPBERRYPI_) || defined(_PLATFORM_BANANAPI_R4_) | ||
| +#if defined (WAN_FAILOVER_SUPPORTED) || defined(RBUS_BUILD_FLAG_ENABLE) || defined (_HUB4_PRODUCT_REQ_) || defined(_PLATFORM_RASPBERRYPI_) || defined(_PLATFORM_BANANAPI_R4_) || defined(_PLATFORM_GENERICARM_) | ||
| #include "cosa_rbus_handler_apis.h" | ||
| #endif | ||
|
|
||
| @@ -370,7 +370,7 @@ CosaEthernetInitialize | ||
|
|
||
| #if defined(FEATURE_RDKB_WAN_MANAGER) | ||
|
|
||
| -#if defined (WAN_FAILOVER_SUPPORTED) || defined(RBUS_BUILD_FLAG_ENABLE) || defined (_HUB4_PRODUCT_REQ_) || defined(_PLATFORM_RASPBERRYPI_) || defined(_PLATFORM_BANANAPI_R4_) | ||
| +#if defined (WAN_FAILOVER_SUPPORTED) || defined(RBUS_BUILD_FLAG_ENABLE) || defined (_HUB4_PRODUCT_REQ_) || defined(_PLATFORM_RASPBERRYPI_) || defined(_PLATFORM_BANANAPI_R4_) || defined(_PLATFORM_GENERICARM_) | ||
| ethAgentRbusInit(); | ||
| #endif | ||
| #if defined (WAN_FAILOVER_SUPPORTED) | ||
| @@ -384,6 +384,7 @@ CosaEthernetInitialize | ||
| GWP_RegisterEthWan_Callback ( &obj ); | ||
| //Initialise global data and initalise hal | ||
| CosaDmlEthInit(NULL, (PANSC_HANDLE)pMyObject); | ||
| + | ||
| #if defined (WAN_FAILOVER_SUPPORTED) | ||
| // The below case might occur, when box crashed/reboot before timeout or conditional signaled | ||
| // Check if EWan failover simulation test file is exist or not. | ||
| -- | ||
| 2.51.2 | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,33 @@ | ||
| #!/bin/sh | ||
| ################################################################################## | ||
| # If not stated otherwise in this file or this component's LICENSE file the | ||
| # following copyright and licenses apply: | ||
| # | ||
| # Copyright 2024 RDK Management | ||
| # | ||
| # Licensed under the Apache License, Version 2.0 (the "License"); | ||
| # you may not use this file except in compliance with the License. | ||
| # You may obtain a copy of the License at | ||
| # | ||
| # http://www.apache.org/licenses/LICENSE-2.0 | ||
| # | ||
| # Unless required by applicable law or agreed to in writing, software | ||
| # distributed under the License is distributed on an "AS IS" BASIS, | ||
| # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
| # See the License for the specific language governing permissions and | ||
| # limitations under the License. | ||
| ################################################################################## | ||
|
|
||
| set -e | ||
|
|
||
| # Bring up all Ethernet interfaces before EthAgent starts | ||
| for x in $(find /sys/class/net -name 'eth*'); do | ||
| # Ignore any interface that is not originating from | ||
| # a "real" device (for example, no veth pairs) | ||
| if [ ! -d "${x}/device" ]; then | ||
| continue | ||
| fi | ||
| eth_intf_name=$(basename "${x}") | ||
| echo "Bringing ${eth_intf_name} up" | ||
| ip link set "${eth_intf_name}" up | ||
| done |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -2,12 +2,23 @@ require ccsp_common_genericarm.inc | |
|
|
||
| FILESEXTRAPATHS:prepend := "${THISDIR}/${PN}:" | ||
|
|
||
| SRC_URI:append = " file://bbhm_def_cfg_ten64.xml" | ||
| SRC_URI:append = " file://bbhm_def_cfg_ten64.xml \ | ||
| file://bbhm_def_cfg_ten64-4.xml \ | ||
| file://bbhm_def_cfg_default.xml \ | ||
| file://copy_config.sh" | ||
|
|
||
| do_install:append() { | ||
| # Config files and scripts | ||
| install -d ${D}/usr/ccsp/config | ||
| install -m 644 ${WORKDIR}/bbhm_def_cfg_ten64.xml ${D}/usr/ccsp/config/bbhm_def_cfg.xml | ||
| install -m 755 ${S}/scripts/bbhm_patch.sh ${D}/usr/ccsp/psm/bbhm_patch.sh | ||
| install -d ${D}/usr/ccsp/machine_configs | ||
| cp ${WORKDIR}/bbhm_def_cfg_ten64.xml ${D}/usr/ccsp/machine_configs/traverse_ten64.xml | ||
| cp ${WORKDIR}/bbhm_def_cfg_ten64-4.xml ${D}/usr/ccsp/machine_configs/traverse_ten64-4.xml | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. add a more generic name for the configuration |
||
| cp ${WORKDIR}/bbhm_def_cfg_default.xml ${D}/usr/ccsp/machine_configs/default.xml | ||
|
|
||
| install -m 755 ${WORKDIR}/copy_config.sh ${D}/usr/ccsp/psm/copy_config.sh | ||
| } | ||
|
|
||
| FILES:${PN}:append = " /usr/ccsp/config \ | ||
| /usr/ccsp/machine_configs \ | ||
| /usr/ccsp/machine_configs/traverse_ten64.xml \ | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Use generic name |
||
| /usr/ccsp/machine_configs/default.xml" | ||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Cr is not used anymore with RBUS