diff --git a/CHANGELOG.md b/CHANGELOG.md index a1b102ae..d7bb84af 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,14 +4,26 @@ All notable changes to this project will be documented in this file. Dates are d Generated by [`auto-changelog`](https://github.com/CookPete/auto-changelog). +#### [4.0.0](https://github.com/rdkcentral/sysint/compare/3.0.8...4.0.0) + +- RDKEMW-10017 : NetworkManager based connectivity check [`#355`](https://github.com/rdkcentral/sysint/pull/355) +- Create NetworkManager_ecfs.conf [`#353`](https://github.com/rdkcentral/sysint/pull/353) +- WNCXIONE-530: Synching changes from support/2.2.0 branch. [`#350`](https://github.com/rdkcentral/sysint/pull/350) +- RDKEMW-9343: Update boot_FSR as part of OPS_TRIGGERED reasons [`#343`](https://github.com/rdkcentral/sysint/pull/343) +- RDKEMW-9675 FSR needs to remove NM profile in RDKE also [`#346`](https://github.com/rdkcentral/sysint/pull/346) +- Merge tag '3.0.8' into develop [`417596d`](https://github.com/rdkcentral/sysint/commit/417596d0e8d3f71c8b98c7b36a32c205e16cd760) + #### [3.0.8](https://github.com/rdkcentral/sysint/compare/3.0.7...3.0.8) +> 24 October 2025 + - RDKE-900 RDKEMW-4899: Default to MTLS connection on all endpoints [`#322`](https://github.com/rdkcentral/sysint/pull/322) - Rebase with develop [`#336`](https://github.com/rdkcentral/sysint/pull/336) - Rebase with develop [`#329`](https://github.com/rdkcentral/sysint/pull/329) - Rebase with develop [`#328`](https://github.com/rdkcentral/sysint/pull/328) - Rebase with develop [`#325`](https://github.com/rdkcentral/sysint/pull/325) - Rebase with develop [`#324`](https://github.com/rdkcentral/sysint/pull/324) +- 3.0.8 release changelog updates [`da072c3`](https://github.com/rdkcentral/sysint/commit/da072c3568b1fa37d2ddcb6411e4d471d3dfa646) - Merge tag '3.0.7' into develop [`e3c6a47`](https://github.com/rdkcentral/sysint/commit/e3c6a4787fe5546e11041d61c21036cb15589c10) #### [3.0.7](https://github.com/rdkcentral/sysint/compare/3.0.6...3.0.7) diff --git a/lib/rdk/NM_Bootstrap.sh b/lib/rdk/NM_Bootstrap.sh index 1d930133..e1ead41a 100644 --- a/lib/rdk/NM_Bootstrap.sh +++ b/lib/rdk/NM_Bootstrap.sh @@ -19,11 +19,13 @@ # limitations under the License. ############################################################################## -WIFI_WPA_SUPPLICANT_CONF="/opt/secure/wifi/wpa_supplicant.conf" +RDK_PROFILE=$(grep "RDK_PROFILE" /etc/device.properties | cut -d '=' -f 2) +RDKV_SUPP_CONF="/opt/secure/wifi/wpa_supplicant.conf" -if [ -f $WIFI_WPA_SUPPLICANT_CONF ]; then - SSID=$(cat $WIFI_WPA_SUPPLICANT_CONF | grep -w ssid= | cut -d '"' -f 2) - PSK_LINE=$(grep psk= "$WIFI_WPA_SUPPLICANT_CONF") + +if [ -f $RDKV_SUPP_CONF ]; then + SSID=$(cat $RDKV_SUPP_CONF | grep -w ssid= | cut -d '"' -f 2) + PSK_LINE=$(grep psk= "$RDKV_SUPP_CONF") # Case 1: Quoted passphrase if [[ "$PSK_LINE" =~ psk=\"(.+)\" ]]; then @@ -37,6 +39,35 @@ if [ -f $WIFI_WPA_SUPPLICANT_CONF ]; then else PSK="" fi - echo "`/bin/timestamp` :$0: Removed nmcli SSID connect" >> /opt/logs/NMMonitor.log sed -i '/network={/,/}/d' /opt/secure/wifi/wpa_supplicant.conf fi + +if [ -z $SSID ]; then + echo "`/bin/timestamp` :$0: No SSID found in supplicant conf" >> /opt/logs/NMMonitor.log + echo "`/bin/timestamp` :$0: Trying with previously configured settings" >> /opt/logs/NMMonitor.log + + if [ ! -d /opt/secure/NetworkManager/system-connections ]; then + mkdir -p /opt/secure/NetworkManager/system-connections + fi + if [ -d /opt/NetworkManager/system-connections ]; then + cp /opt/NetworkManager/system-connections/* /opt/secure/NetworkManager/system-connections/ + rm -rf /opt/NetworkManager/system-connections/* + fi + nmcli conn reload +else + if [ -d /opt/NetworkManager/system-connections ]; then + rm -rf /opt/NetworkManager/system-connections/* + fi + if [ "$RDK_PROFILE" == "TV" ]; then + echo "`/bin/timestamp` :$0: Migrating Wifi credentials for TVs from NM_Bootsrtap" >> /opt/logs/NMMonitor.log + fi + if [ -z $PSK ]; then + #connect to wifi + nmcli conn add type wifi con-name "$SSID" autoconnect yes ifname wlan0 ssid "$SSID" + nmcli conn reload + else + #connect to wifi + nmcli conn add type wifi con-name "$SSID" autoconnect yes ifname wlan0 ssid "$SSID" wifi-sec.key-mgmt wpa-psk wifi-sec.psk "$PSK" + nmcli conn reload + fi +fi diff --git a/lib/rdk/NM_Dispatcher.sh b/lib/rdk/NM_Dispatcher.sh index cfaa0726..97b76055 100644 --- a/lib/rdk/NM_Dispatcher.sh +++ b/lib/rdk/NM_Dispatcher.sh @@ -107,15 +107,9 @@ interfaceName=$1 interfaceStatus=$2 if [ "$interfaceStatus" = "up" ]; then - /usr/bin/nm-online -q -t 60 # If Network manager is not online wait for 60 sec. TODO: Revisit this during connectivity check enable time + CON_STATE=$(nmcli -t -f GENERAL.STATE device show "$interfaceName" 2>/dev/null | cut -d: -f2) NMdispatcherLog "Connection state of interface $interfaceName=$CON_STATE" - if [ "$CON_STATE" = "100 (connected)" ] || [ "$CON_STATE" = "120 (connected (site only))" ]; then - NMdispatcherLog "Connection state of $interfaceName is connected." - sh /lib/rdk/connectivitycheck.sh & - else - NMdispatcherLog "Connection state of $interfaceName Up But Not Fully connected." - fi fi if [ "x$interfaceName" != "x" ] && [ "$interfaceName" != "lo" ]; then diff --git a/lib/rdk/connectivitycheck.sh b/lib/rdk/connectivitycheck.sh deleted file mode 100644 index 341b3e99..00000000 --- a/lib/rdk/connectivitycheck.sh +++ /dev/null @@ -1,79 +0,0 @@ -#!/bin/sh -#################################################################################### -# If not stated otherwise in this file or this component's LICENSE file the -# following copyright and licenses apply: -# -# Copyright 2024 Comcast Cable Communications Management, LLC -# -# 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. -#################################################################################### - -. /etc/include.properties -. /etc/device.properties - -if [ -f /lib/rdk/t2Shared_api.sh ]; then - source /lib/rdk/t2Shared_api.sh -fi - -CONNCHECK_LOG_FILE="$LOG_PATH/NMMonitor.log" -CONNCHECK_FILE="/tmp/connectivity_check_done" -CONNCHECK_TIMEOUT=120 # 2 minutes -CONNCHECK_RETRY_INTERVAL=10 # 10 seconds - -connectivityCheckLog() -{ - echo "$(/bin/timestamp) : $0: $*" >> $CONNCHECK_LOG_FILE -} - -if [ -n "$CONNECTIVITY_CHECK_URL" ]; then - URL="$CONNECTIVITY_CHECK_URL" -else - connectivityCheckLog "CONNECTIVITY_CHECK_URL not set. Exiting." - if [ ! -f $CONNCHECK_FILE ]; then - touch $CONNCHECK_FILE - fi - t2CountNotify "SYST_WARN_connectivitycheck_nourl_set" - exit 0 -fi - -# Get start time from /proc/uptime (integer part only) -START=$(cut -d. -f1 /proc/uptime) - -while true; do - NOW=$(cut -d. -f1 /proc/uptime) - ELAPSED=$((NOW - START)) - - if [ "$ELAPSED" -ge "$CONNCHECK_TIMEOUT" ]; then - connectivityCheckLog "Failed to get HTTP 204 within $CONNCHECK_TIMEOUT seconds." - if [ ! -f $CONNCHECK_FILE ]; then - touch $CONNCHECK_FILE - fi - t2CountNotify "SYST_WARN_connectivitycheck_time_expire" - exit 0 - fi - - HTTP_CODE=$(curl -s -o /dev/null -w "%{http_code}" "$URL") - - if [ "$HTTP_CODE" -eq 204 ]; then - connectivityCheckLog "Connected: Received HTTP 204" - if [ ! -f $CONNCHECK_FILE ]; then - touch $CONNCHECK_FILE - fi - t2CountNotify "SYST_INFO_connectivitycheck_success" - exit 0 - else - connectivityCheckLog "connectivitycheck.sh Not connected yet (HTTP $HTTP_CODE). Retrying in $CONNCHECK_RETRY_INTERVAL seconds..." - fi - - sleep $CONNCHECK_RETRY_INTERVAL -done diff --git a/lib/rdk/factory-reset.sh b/lib/rdk/factory-reset.sh index b67895f7..dabdbb1a 100755 --- a/lib/rdk/factory-reset.sh +++ b/lib/rdk/factory-reset.sh @@ -119,6 +119,8 @@ if [ -d /opt/upnp ]; then rm -rf /opt/upnp/*;fi if [ -L /opt/www/htmldiag ]; then rm -f /opt/www/htmldiag;fi if [ -f /opt/user_preferences.conf ];then rm -rf /opt/user_preferences.conf; fi if [ -f /opt/continuewatching.json ];then rm -rf /opt/continuewatching.json ; fi +if [ -d /opt/NetworkManager ];then rm -rf /opt/NetworkManager ; fi +if [ -d /opt/secure/NetworkManager ];then rm -rf /opt/secure/NetworkManager ; fi if [ -f /opt/secure/Apparmor_blocklist ];then rm -rf /opt/secure/Apparmor_blocklist ; fi diff --git a/lib/rdk/rebootNow.sh b/lib/rdk/rebootNow.sh index d32c7649..3b2abec6 100755 --- a/lib/rdk/rebootNow.sh +++ b/lib/rdk/rebootNow.sh @@ -76,7 +76,7 @@ CDLFILE=$(cat /opt/cdl_flashed_file_name) PREV_CDLFILE=$(cat /tmp/currently_running_image_name) # Define Reasons for APP_TRIGGERED, OPS_TRIGGERED and MAINTENANCE_TRIGGERED cases APP_TRIGGERED_REASONS=(Servicemanager systemservice_legacy WarehouseReset WarehouseService HrvInitWHReset HrvColdInitReset HtmlDiagnostics InstallTDK StartTDK TR69Agent SystemServices Bsu_GUI SNMP CVT_CDL Nxserver DRM_Netflix_Initialize hrvinit PaceMFRLibrary) -OPS_TRIGGERED_REASONS=(ScheduledReboot RebootSTB.sh FactoryReset UpgradeReboot_firmwareDwnld.sh UpgradeReboot_restore XFS wait_for_pci0_ready websocketproxyinit NSC_IR_EventReboot host_interface_dma_bus_wait usbhotplug Receiver_MDVRSet Receiver_VidiPath_Enabled Receiver_Toggle_Optimus S04init_ticket Network-Service monitor.sh ecmIpMonitor.sh monitorMfrMgr.sh vlAPI_Caller_Upgrade ImageUpgrade_rmf_osal ImageUpgrade_mfr_api ImageUpgrade_updateNewImage.sh ImageUpgrade_userInitiatedFWDnld.sh ClearSICache tr69hostIfReset hostIf_utils hostifDeviceInfo HAL_SYS_Reboot UpgradeReboot_deviceInitiatedFWDnld.sh UpgradeReboot_rdkvfwupgrader UpgradeReboot_ipdnl.sh PowerMgr_Powerreset PowerMgr_coldFactoryReset DeepSleepMgr PowerMgr_CustomerReset PowerMgr_PersonalityReset Power_Thermmgr PowerMgr_Plat HAL_CDL_notify_mgr_event vldsg_estb_poll_ecm_operational_state BcmIndicateEcmReset SASWatchDog BP3_Provisioning eMMC_FW_UPGRADE BOOTLOADER_UPGRADE cdl_service BCMCommandHandler BRCM_Image_Validate docsis_mode_check.sh tch_nvram.sh Receiver CANARY_Update) +OPS_TRIGGERED_REASONS=(ScheduledReboot RebootSTB.sh FactoryReset UpgradeReboot_firmwareDwnld.sh UpgradeReboot_restore XFS wait_for_pci0_ready websocketproxyinit NSC_IR_EventReboot host_interface_dma_bus_wait usbhotplug Receiver_MDVRSet Receiver_VidiPath_Enabled Receiver_Toggle_Optimus S04init_ticket Network-Service monitor.sh ecmIpMonitor.sh monitorMfrMgr.sh vlAPI_Caller_Upgrade ImageUpgrade_rmf_osal ImageUpgrade_mfr_api ImageUpgrade_updateNewImage.sh ImageUpgrade_userInitiatedFWDnld.sh ClearSICache tr69hostIfReset hostIf_utils hostifDeviceInfo HAL_SYS_Reboot UpgradeReboot_deviceInitiatedFWDnld.sh UpgradeReboot_rdkvfwupgrader UpgradeReboot_ipdnl.sh PowerMgr_Powerreset PowerMgr_coldFactoryReset DeepSleepMgr PowerMgr_CustomerReset PowerMgr_PersonalityReset Power_Thermmgr PowerMgr_Plat HAL_CDL_notify_mgr_event vldsg_estb_poll_ecm_operational_state BcmIndicateEcmReset SASWatchDog BP3_Provisioning eMMC_FW_UPGRADE BOOTLOADER_UPGRADE cdl_service BCMCommandHandler BRCM_Image_Validate docsis_mode_check.sh tch_nvram.sh Receiver CANARY_Update boot_FSR) MAINTENANCE_TRIGGERED_REASONS=(AutoReboot.sh PwrMgr) pid_file="/tmp/.rebootNow.pid" customReason="Unknown" diff --git a/systemd_units/NetworkManager_ecfs.conf b/systemd_units/NetworkManager_ecfs.conf new file mode 100644 index 00000000..dcf4079f --- /dev/null +++ b/systemd_units/NetworkManager_ecfs.conf @@ -0,0 +1,2 @@ +[Unit] +After=securemount.service diff --git a/systemd_units/coredump-secure-upload.service b/systemd_units/coredump-secure-upload.service index 20b9641e..325d5592 100644 --- a/systemd_units/coredump-secure-upload.service +++ b/systemd_units/coredump-secure-upload.service @@ -21,8 +21,8 @@ [Unit] Description=COREDUMP UPLOAD -After=network-up.target tr69hostif.service -Requires=network-up.target +After=network-online.target tr69hostif.service +Requires=network-online.target [Service] ExecStart=/lib/rdk/uploadDumps.sh "" 1 secure diff --git a/systemd_units/coredump-upload.service b/systemd_units/coredump-upload.service index fcddd9e0..eeb4a0ca 100644 --- a/systemd_units/coredump-upload.service +++ b/systemd_units/coredump-upload.service @@ -19,8 +19,8 @@ [Unit] Description=COREDUMP UPLOAD -After=network-up.target -Requires=network-up.target +After=network-online.target +Requires=network-online.target [Service] ExecStart=/lib/rdk/uploadDumps.sh "" 1 diff --git a/systemd_units/minidump-secure-upload.service b/systemd_units/minidump-secure-upload.service index cb875d14..86ff5115 100644 --- a/systemd_units/minidump-secure-upload.service +++ b/systemd_units/minidump-secure-upload.service @@ -20,8 +20,8 @@ [Unit] Description=MINIDUMP UPLOAD -After=network-up.target tr69hostif.service -Requires=network-up.target +After=network-online.target tr69hostif.service +Requires=network-online.target [Service] ExecStart=/lib/rdk/uploadDumps.sh "" 0 secure diff --git a/systemd_units/minidump-upload.service b/systemd_units/minidump-upload.service index 9a2c3516..dcb38dd4 100644 --- a/systemd_units/minidump-upload.service +++ b/systemd_units/minidump-upload.service @@ -20,8 +20,8 @@ [Unit] Description=MINIDUMP UPLOAD -After=network-up.target -Requires=network-up.target +After=network-online.target +Requires=network-online.target [Service] ExecStart=/lib/rdk/uploadDumps.sh "" 0 diff --git a/systemd_units/notify-network-ready.service b/systemd_units/notify-network-ready.service new file mode 100644 index 00000000..8a11c9af --- /dev/null +++ b/systemd_units/notify-network-ready.service @@ -0,0 +1,8 @@ +[Unit] +Description=Log Internet connectivity and Trigger network target +After=dbus.service + +[Service] +Type=oneshot +ExecStartPre=/bin/touch /tmp/connectivity_check_done +ExecStart=/lib/rdk/logMilestone.sh "INTERNET_FULLY_CONNECTED"