Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 11 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,23 @@ 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)
#### [4.0.1](https://github.com/rdkcentral/sysint/compare/4.0.0...4.0.1)

- Revert "RDKEMW-10017 : NetworkManager based connectivity check (#355)" [`#361`](https://github.com/rdkcentral/sysint/pull/361)
- Update update_previous_reboot_info.sh [`#360`](https://github.com/rdkcentral/sysint/pull/360)
- Update warehouse-reset.sh for NM cleanup [`#359`](https://github.com/rdkcentral/sysint/pull/359)
- Merge tag '4.0.0' into develop [`3133a34`](https://github.com/rdkcentral/sysint/commit/3133a3491ac1fdf7a7b2a7a2eefbdc7387124b4a)

### [4.0.0](https://github.com/rdkcentral/sysint/compare/3.0.8...4.0.0)

> 3 November 2025

- 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)
- 4.0.0 release changelog updates [`15cd4a1`](https://github.com/rdkcentral/sysint/commit/15cd4a1aab1d7a76563742de849c64895fe2ce67)
- 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)
Expand Down
8 changes: 7 additions & 1 deletion lib/rdk/NM_Dispatcher.sh
Original file line number Diff line number Diff line change
Expand Up @@ -107,9 +107,15 @@ 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
Expand Down
79 changes: 79 additions & 0 deletions lib/rdk/connectivitycheck.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,79 @@
#!/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");

Check failure on line 8 in lib/rdk/connectivitycheck.sh

View workflow job for this annotation

GitHub Actions / call-fossid-workflow / Fossid Annotate PR

FossID License Issue Detected

Source code with 'Apache-2.0' license found in local file 'lib/rdk/connectivitycheck.sh' (Match: tink-crypto/tink/1.0.0, 11 lines, url: https://github.com/tink-crypto/tink/archive/v1.0.0.tar.gz, file: kokoro/macos_external/presubmit.sh)
# 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
Comment on lines +42 to +44

Copilot AI Nov 10, 2025

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This file existence check and touch pattern is repeated three times (lines 42-44, 58-60, 69-71). Consider extracting this into a helper function to reduce duplication and improve maintainability.

Copilot uses AI. Check for mistakes.
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

Copilot AI Nov 10, 2025

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The -eq operator requires numeric operands, but if curl fails or returns an error, $HTTP_CODE may be empty or non-numeric, causing a test error. Add a check to ensure HTTP_CODE is numeric before comparison, or use a default value: if [ \"${HTTP_CODE:-0}\" -eq 204 ]; then

Suggested change
if [ "$HTTP_CODE" -eq 204 ]; then
if [ "${HTTP_CODE:-0}" -eq 204 ]; then

Copilot uses AI. Check for mistakes.
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
4 changes: 2 additions & 2 deletions lib/rdk/update_previous_reboot_info.sh
Original file line number Diff line number Diff line change
Expand Up @@ -96,8 +96,8 @@ setPreviousRebootInfo()

if [ -z "$existing_reboot_info" ]; then
echo "$(/bin/timestamp): $0: Updating previous reboot info to Parodus" >> "$PARODUS_LOG"
echo "$(/bin/timestamp): $0: PreviousRebootInfo:$timestamp,$custom,$source,$reason" >> "$PARODUS_LOG"
rebootLog "Reboot Information Updated to parodus log:$timestamp,$custom,$source,$reason"
echo "$(/bin/timestamp): $0: PreviousRebootInfo:$timestamp,$reason,$custom,$source" >> "$PARODUS_LOG"
rebootLog "Reboot Information Updated to parodus log:$timestamp,$reason,$custom,$source"
else
rebootLog "${FUNCNAME[0]}: Reboot info already present in $PARODUS_LOG as $existing_reboot_info, skipping update"
fi
Expand Down
2 changes: 2 additions & 0 deletions lib/rdk/warehouse-reset.sh
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,8 @@ if [ -e /opt/.gstreamer ]; then rm -rf /opt/.gstreamer; fi
if [ -d /opt/persistent/dvr ]; then rm -rf /opt/persistent/dvr; fi
if [ -d /opt/etc ];then rm -rf /opt/etc;fi
if [ -d /opt/certs ];then rm -rf /opt/certs; fi
if [ -d /opt/NetworkManager ];then rm -rf /opt/NetworkManager ; fi
if [ -d /opt/secure/NetworkManager ];then rm -rf /opt/secure/NetworkManager ; fi
Comment on lines +106 to +107

Copilot AI Nov 10, 2025

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Lines 106-107 remove entire NetworkManager directories, which makes line 95's removal of /opt/NetworkManager/system-connections/* redundant. Since the parent directory is being removed, the earlier cleanup of the subdirectory is unnecessary. Consider removing line 95 or documenting why both are needed.

Copilot uses AI. Check for mistakes.

if [ -f /opt/secure/Apparmor_blocklist ];then rm -rf /opt/secure/Apparmor_blocklist ; fi

Expand Down
4 changes: 2 additions & 2 deletions systemd_units/coredump-secure-upload.service
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,8 @@
[Unit]
Description=COREDUMP UPLOAD

After=network-online.target tr69hostif.service
Requires=network-online.target
After=network-up.target tr69hostif.service
Requires=network-up.target

[Service]
ExecStart=/lib/rdk/uploadDumps.sh "" 1 secure
Expand Down
4 changes: 2 additions & 2 deletions systemd_units/coredump-upload.service
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,8 @@
[Unit]
Description=COREDUMP UPLOAD

After=network-online.target
Requires=network-online.target
After=network-up.target
Requires=network-up.target

[Service]
ExecStart=/lib/rdk/uploadDumps.sh "" 1
Expand Down
4 changes: 2 additions & 2 deletions systemd_units/minidump-secure-upload.service
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,8 @@
[Unit]
Description=MINIDUMP UPLOAD

After=network-online.target tr69hostif.service
Requires=network-online.target
After=network-up.target tr69hostif.service
Requires=network-up.target

[Service]
ExecStart=/lib/rdk/uploadDumps.sh "" 0 secure
Expand Down
4 changes: 2 additions & 2 deletions systemd_units/minidump-upload.service
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,8 @@
[Unit]
Description=MINIDUMP UPLOAD

After=network-online.target
Requires=network-online.target
After=network-up.target
Requires=network-up.target

[Service]
ExecStart=/lib/rdk/uploadDumps.sh "" 0
Expand Down
8 changes: 0 additions & 8 deletions systemd_units/notify-network-ready.service

This file was deleted.

Loading