Skip to content

rebase#432

Open
nhanasi wants to merge 126 commits into
feature/RDKEVD-5412from
develop
Open

rebase#432
nhanasi wants to merge 126 commits into
feature/RDKEVD-5412from
develop

Conversation

@nhanasi

@nhanasi nhanasi commented Jan 27, 2026

Copy link
Copy Markdown
Contributor

No description provided.

Garpathi, Uday Krishna and others added 16 commits October 15, 2025 15:07
Sysint 4.2.1 release with network updates
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
RDK-59247: cleaning up network scripts.
…ts To C Implementation (#410)

* Update Start_MaintenanceTasks.sh

* Update lib/rdk/Start_MaintenanceTasks.sh

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>

* Update lib/rdk/Start_MaintenanceTasks.sh

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>

* Update Start_MaintenanceTasks.sh

* Update Start_MaintenanceTasks.sh

* Apply suggestion from @Copilot

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>

* Update Start_MaintenanceTasks.sh

* Update Start_MaintenanceTasks.sh

* Update Start_MaintenanceTasks.sh

* Update Start_MaintenanceTasks.sh

* Update Start_MaintenanceTasks.sh

---------

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Saranya2421 <saranya.suvi@gmail.com>
Sysint 4.2.2 release for logupload migration to C
@nhanasi nhanasi requested a review from a team as a code owner January 27, 2026 22:12
Copilot AI review requested due to automatic review settings January 27, 2026 22:12
@github-actions

github-actions Bot commented Jan 27, 2026

Copy link
Copy Markdown


Thank you for your submission, we really appreciate it. Like many open-source projects, we ask that you all sign our Contributor License Agreement before we can accept your contribution. You can sign the CLA by just posting a Pull Request Comment same as the below format.


I have read the CLA Document and I hereby sign the CLA


12 out of 13 committers have signed the CLA.
AravindanNC
sborushevsky
Abhinavpv28
nhanasi
gururaajar
shibu-kv
sindhu-krishnan
NareshM1702
Saranya2421
KTirumalaSrihari
dharshini555
aminaseyyad
udaykrishnag
You can retrigger this bot by commenting recheck in this Pull Request. Posted by the CLA Assistant Lite bot.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

This PR consolidates multiple changes from a rebase operation, including network script refactoring, log upload binary migration, and configuration updates.

Changes:

  • Deleted updateGlobalIPInfo.sh and refactored its functionality into NM_Dispatcher.sh and NM_preDown.sh
  • Added support for a binary log upload implementation with fallback to script-based approach in Start_MaintenanceTasks.sh
  • Added com.comcast.viper_ipa to warehouse testing exceptions in wh_api_5.conf

Reviewed changes

Copilot reviewed 5 out of 5 changed files in this pull request and generated 5 comments.

Show a summary per file
File Description
lib/rdk/wh_api_5.conf Added viper_ipa app to warehouse testing exception list
lib/rdk/updateGlobalIPInfo.sh Deleted file - functionality moved to NM dispatcher scripts
lib/rdk/Start_MaintenanceTasks.sh Integrated binary-based log upload with fallback to shell script
lib/rdk/NM_preDown.sh Refactored IP deletion logic from updateGlobalIPInfo.sh
lib/rdk/NM_Dispatcher.sh Refactored IP addition logic from updateGlobalIPInfo.sh
CHANGELOG.md Updated changelog for version 4.2.2 with merged PRs

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread lib/rdk/NM_Dispatcher.sh
Comment on lines +60 to +68
if [ "x$mode" == "xipv6" ]; then
if [[ $addr == fc* || $addr == fd* ]]; then
return 1
fi
elif [ "x$mode" == "xipv4" ]; then
autoIPTrunc=$(echo $addr | cut -d "." -f1-2)
if [ "$autoIPTrunc" == "169.254" ]; then
return 1
fi

Copilot AI Jan 27, 2026

Copy link

Choose a reason for hiding this comment

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

The check_valid_IPaddress function has inconsistent implementations between NM_preDown.sh and NM_Dispatcher.sh. In NM_preDown.sh, it uses POSIX-compliant single equals (=) and a case statement for IPv6 pattern matching. In NM_Dispatcher.sh, it uses bash-specific double equals (==) and double bracket conditionals. These functions should be identical to maintain consistency and predictable behavior across both scripts.

Suggested change
if [ "x$mode" == "xipv6" ]; then
if [[ $addr == fc* || $addr == fd* ]]; then
return 1
fi
elif [ "x$mode" == "xipv4" ]; then
autoIPTrunc=$(echo $addr | cut -d "." -f1-2)
if [ "$autoIPTrunc" == "169.254" ]; then
return 1
fi
if [ "x$mode" = "xipv6" ]; then
case "$addr" in
fc*|fd*)
return 1
;;
esac
elif [ "x$mode" = "xipv4" ]; then
autoIPTrunc=$(echo "$addr" | cut -d "." -f1-2)
if [ "$autoIPTrunc" = "169.254" ]; then
return 1
fi

Copilot uses AI. Check for mistakes.
Comment thread lib/rdk/Start_MaintenanceTasks.sh Outdated
Comment on lines +188 to +193
sh $LOGUPLOAD_SCRIPT "$tftp_server" 1 1 "$uploadOnReboot" "$upload_protocol" "$upload_httplink" "$TriggerType" 2>/dev/null
result=$?
fi
else
logUploadLog "logupload binary not found at $LOG_UPLOAD_BIN_PATH...executing script"
sh $LOGUPLOAD_SCRIPT "$tftp_server" 1 1 "$uploadOnReboot" "$upload_protocol" "$upload_httplink" "$TriggerType" 2>&1

Copilot AI Jan 27, 2026

Copy link

Choose a reason for hiding this comment

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

Inconsistent parameter passed to binary vs script. The binary is called with "ondemand" as the 7th argument (line 181), but when falling back to the script (line 188), it's called with "$TriggerType" which is the numeric value 5. This parameter mismatch could cause different behavior between the binary and script paths.

Suggested change
sh $LOGUPLOAD_SCRIPT "$tftp_server" 1 1 "$uploadOnReboot" "$upload_protocol" "$upload_httplink" "$TriggerType" 2>/dev/null
result=$?
fi
else
logUploadLog "logupload binary not found at $LOG_UPLOAD_BIN_PATH...executing script"
sh $LOGUPLOAD_SCRIPT "$tftp_server" 1 1 "$uploadOnReboot" "$upload_protocol" "$upload_httplink" "$TriggerType" 2>&1
sh $LOGUPLOAD_SCRIPT "$tftp_server" 1 1 "$uploadOnReboot" "$upload_protocol" "$upload_httplink" "ondemand" 2>/dev/null
result=$?
fi
else
logUploadLog "logupload binary not found at $LOG_UPLOAD_BIN_PATH...executing script"
sh $LOGUPLOAD_SCRIPT "$tftp_server" 1 1 "$uploadOnReboot" "$upload_protocol" "$upload_httplink" "ondemand" 2>&1

Copilot uses AI. Check for mistakes.
Comment thread lib/rdk/Start_MaintenanceTasks.sh Outdated
return 0
else
logUploadLog "Binary execution failed with result=$result; falling back to script"
nice -n 19 sh $LOGUPLOAD_SCRIPT "$tftp_server" 1 1 "$uploadOnReboot" "$upload_protocol" "$upload_httplink" &

Copilot AI Jan 27, 2026

Copy link

Choose a reason for hiding this comment

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

Trailing whitespace after the ampersand on this line. This is inconsistent with line 216 which has the same command structure without trailing whitespace.

Suggested change
nice -n 19 sh $LOGUPLOAD_SCRIPT "$tftp_server" 1 1 "$uploadOnReboot" "$upload_protocol" "$upload_httplink" &
nice -n 19 sh $LOGUPLOAD_SCRIPT "$tftp_server" 1 1 "$uploadOnReboot" "$upload_protocol" "$upload_httplink" &

Copilot uses AI. Check for mistakes.
Comment thread lib/rdk/Start_MaintenanceTasks.sh Outdated
Comment on lines +200 to +216
nice -n 19 "$LOG_UPLOAD_BIN_PATH" "$tftp_server" 1 1 "$uploadOnReboot" "$upload_protocol" "$upload_httplink" >> /opt/logs/dcmscript.log &
bg_pid=$!
wait $bg_pid
result=$?
if [ "$result" -eq 0 ]; then
logUploadLog "Binary execution succeeded"
return 0
else
logUploadLog "Binary execution failed with result=$result; falling back to script"
nice -n 19 sh $LOGUPLOAD_SCRIPT "$tftp_server" 1 1 "$uploadOnReboot" "$upload_protocol" "$upload_httplink" &
bg_pid=$!
wait $bg_pid
result=$?
fi
else
logUploadLog "logupload binary not found at $LOG_UPLOAD_BIN_PATH...executing script"
nice -n 19 sh $LOGUPLOAD_SCRIPT "$tftp_server" 1 1 "$uploadOnReboot" "$upload_protocol" "$upload_httplink" &

Copilot AI Jan 27, 2026

Copy link

Choose a reason for hiding this comment

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

The binary call on line 200 is missing the trigger type parameter (7th argument) that the script receives on line 216. When the binary succeeds, no trigger type is passed, but when it fails and falls back to the script, no trigger type is passed either. However, in the on-demand path (line 181), the binary receives "ondemand" as the 7th argument. This inconsistency between regular and on-demand execution paths could lead to different behavior.

Copilot uses AI. Check for mistakes.
Comment thread lib/rdk/NM_Dispatcher.sh
Comment on lines +90 to +98
echo "$addr" > /tmp/.$mode$ESTB_INTERFACE
refresh_devicedetails "estb_ip"
elif [[ "$ifc" == "$MOCA_INTERFACE" || "$ifc" == "$MOCA_INTERFACE:0" ]]; then
NMdispatcherLog "Updating MoCA IP"
echo "$addr" > /tmp/.$mode$MOCA_INTERFACE
refresh_devicedetails "moca_ip"
elif [[ "$ifc" == "$WIFI_INTERFACE" || "$ifc" == "$WIFI_INTERFACE:0" ]]; then
NMdispatcherLog "Updating Wi-Fi IP"
echo "$addr" > /tmp/.$mode$WIFI_INTERFACE

Copilot AI Jan 27, 2026

Copy link

Choose a reason for hiding this comment

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

The echo "$addr" > /tmp/.$mode$ESTB_INTERFACE (and similar for MOCA_INTERFACE and WIFI_INTERFACE) writes to a predictable path in /tmp as root without any protection against symlink attacks. A local attacker who can create a symlink at /tmp/.$mode$ESTB_INTERFACE (or the other variants) can cause this script to truncate or overwrite an arbitrary file (e.g., /etc/shadow), leading to privilege escalation or data corruption. Use a safer pattern for temporary files (e.g., a dedicated directory with restricted permissions or APIs that open files with O_NOFOLLOW/proper checks) so that writes cannot be redirected via attacker-controlled symlinks.

Copilot uses AI. Check for mistakes.
… crashes (#539)

Co-authored-by: mtirum011 <madhubabu_tirumala@comcast.com>
Co-authored-by: nhanasi <navihansi@gmail.com>

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 33 out of 33 changed files in this pull request and generated 2 comments.

Comments suppressed due to low confidence (1)

lib/rdk/readBTAddress-generic.sh:31

  • bluetooth_mac is only set when BLUETOOTH_ENABLED is true; otherwise this script echoes an empty string. Since getDeviceDetails.sh uses this output directly, Bluetooth-disabled devices will report an empty Bluetooth MAC (overwriting its default). Initialize bluetooth_mac to a safe default (e.g., 00:00:00:00:00:00) and only override it when getDeviceBluetoothMac returns a non-empty value.

Comment thread lib/rdk/NM_Bootstrap.sh
Comment on lines +82 to +89
echo "`/bin/timestamp` :$0: Listing the connection profiles in device: " >> /opt/logs/NMMonitor.log
ls -lh /opt/secure/NetworkManager/system-connections >> /opt/logs/NMMonitor.log
echo "`/bin/timestamp` :$0: Deleting existing wifi profiles if any..." >> /opt/logs/NMMonitor.log
for f in /opt/secure/NetworkManager/system-connections/*; do
if grep -q "type=wifi" "$f"; then
rm -f "$f"
fi
done
Comment thread lib/rdk/startStunnel.sh
Comment on lines +158 to +173
# Create a named pipe
PIPE=$(mktemp -u)
if ! mkfifo "$PIPE" 2>/dev/null; then
echo_t "STUNNEL: ERROR - Failed to create named pipe"
fi

# Open the pipe using the available FD, with error handling
if ! eval "exec $FD_NUMBER<>$PIPE" 2>/dev/null; then
echo_t "STUNNEL: ERROR - Failed to open pipe with file descriptor"
fi

# Removing the pipe after opening
rm "$PIPE"

# Writing passcode to open file descriptor
echo "$(eval "$PASSCODE")" >&$FD_NUMBER &
jincysam87 and others added 2 commits May 7, 2026 11:57
* Update NM_Bootstrap.sh

* Update NM_Bootstrap.sh

* Update NM_Bootstrap.sh

* Potential fix for pull request finding

Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>

* Update NM_Bootstrap.sh

* Update NM_Bootstrap.sh

* Update NM_Bootstrap.sh

* Update NM_Bootstrap.sh

* Update NM_Bootstrap.sh

* Update NM_Bootstrap.sh

---------

Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
… present (#538)

Reason for change: gstreamer-cleanup is happening on every reboot when /opt/cdl_flashed_file_name is missing. Fixing the issues as well as re-locating gstreamer-cleanup.service file to meta-rdk-video instead of sysint folder
Test Procedure: Boot the TV and check for gstreamer-cleanup metrics in rdk_milestones.log
Risks: low

Signed-off-by: Renuka Varry <rvarry049@cable.comcast.com>
Co-authored-by: Renuka Varry <rvarry049@cable.comcast.com>
Co-authored-by: nhanasi <navihansi@gmail.com>
Copilot AI review requested due to automatic review settings May 7, 2026 18:34

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 33 out of 33 changed files in this pull request and generated 6 comments.

Comments suppressed due to low confidence (1)

lib/rdk/readBTAddress-generic.sh:32

  • bluetooth_mac is only set when BLUETOOTH_ENABLED=true; otherwise this script echoes an unset/empty value. That can propagate an empty Bluetooth MAC to callers (e.g., device details collection). Initialize bluetooth_mac to a safe default (like 00:00:00:00:00:00) and quote the echo output.

[Service]
Type=exec
Type=simple
ExecStart= /bin/sh -c '/lib/rdk/NM_Bootstrap.sh'
Comment thread lib/rdk/startStunnel.sh
Comment on lines +158 to +173
# Create a named pipe
PIPE=$(mktemp -u)
if ! mkfifo "$PIPE" 2>/dev/null; then
echo_t "STUNNEL: ERROR - Failed to create named pipe"
fi

# Open the pipe using the available FD, with error handling
if ! eval "exec $FD_NUMBER<>$PIPE" 2>/dev/null; then
echo_t "STUNNEL: ERROR - Failed to open pipe with file descriptor"
fi

# Removing the pipe after opening
rm "$PIPE"

# Writing passcode to open file descriptor
echo "$(eval "$PASSCODE")" >&$FD_NUMBER &
Comment on lines +295 to +308
#Reset tmp parameters to default values only after both V4 and V6 are measured (on V6 call).
#Resetting on V4 check alone would be premature because packetsLostipv6 is still 0 (script init)
#at that point, causing FirstPacketLossTime to be incorrectly cleared before V6 is measured.
#Reset if either V4 or V6 is below the reassociate tolerance, indicating recovery on at least one path.
if [ "$version" = "V6" ] && { [ "$packetsLostipv4" -lt "$WifiReassociateTolerance" ] || [ "$packetsLostipv6" -lt "$WifiReassociateTolerance" ]; }; then
echo "$(/bin/timestamp) [DEBUG_NCR] checkPacketLoss: BELOW TOLERANCE returning 0 - resetting FirstPacketLossTime/PacketLossLogTimeStamp/IsWifiReassociated. wifiDriverErrors=$wifiDriverErrors" >> "$logsFile"
FirstPacketLossTime=0
PacketLossLogTimeStamp=0
EthernetLogTimeStamp=0
IsWifiReassociated=0
[ "$wifiDriverErrors" -eq 0 ] && IsWifiReset=0 #Make IsWifiReset=0 only when there is no wifidriverissue
else
echo "$(/bin/timestamp) [DEBUG_NCR] checkPacketLoss: BELOW TOLERANCE returning 0 - skipping reset (version=$version, waiting for V6 measurement). wifiDriverErrors=$wifiDriverErrors" >> "$logsFile"
fi
Comment thread lib/rdk/NM_Bootstrap.sh
Comment on lines 114 to +122
if [ -d /opt/secure/NetworkManager/system-connections ]; then
rm -rf /opt/secure/NetworkManager/system-connections/*
echo "`/bin/timestamp` :$0: Listing the connection profiles in device: " >> /opt/logs/NMMonitor.log
ls -lh /opt/secure/NetworkManager/system-connections >> /opt/logs/NMMonitor.log
echo "`/bin/timestamp` :$0: Deleting existing wifi profiles if any..." >> /opt/logs/NMMonitor.log
for f in /opt/secure/NetworkManager/system-connections/*; do
if grep -q "type=wifi" "$f"; then
rm -f "$f"
fi
done
Comment thread lib/rdk/alertSystem.sh
Comment on lines +20 to +22
# Purpose: This script is used to backup the Logs
# Scope: RDK devices
# Usage: This script is triggered by systemd service
echo "Logging for Yocto platforms..."
/bin/timestamp
uptime
uptime
Copilot AI review requested due to automatic review settings May 14, 2026 16:57

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 33 out of 33 changed files in this pull request and generated 8 comments.

Comments suppressed due to low confidence (1)

lib/rdk/readBTAddress-generic.sh:32

  • If BLUETOOTH_ENABLED is not "true", bluetooth_mac is never set, but the script still echoes it. This results in an empty value being returned to getDeviceDetails.sh (overriding its default MAC) instead of a sensible default. Ensure the script always echoes a valid MAC (e.g., 00:00:00:00:00:00) or only overrides when getDeviceBluetoothMac returns a non-empty value; also consider guarding the utils.sh source with an existence check to avoid hard failures.

[Service]
Type=exec
Type=simple
ExecStart= /bin/sh -c '/lib/rdk/NM_Bootstrap.sh'
Comment on lines 29 to 34
Type=notify
NotifyAccess=all
Environment="LOG_PATH=/opt/logs"
Environment="RDK_PATH=/lib/rdk"
ExecStart=/lib/rdk/backup_logs.sh
ExecStart=/usr/bin/backup_logs
RemainAfterExit=yes
Comment thread lib/rdk/startStunnel.sh
Comment on lines +112 to 128
echo "cert = $CERT_PATH" >> $STUNNEL_CONF_FILE
echo "CAfile = $CA_FILE" >> $STUNNEL_CONF_FILE
echo "verifyChain = yes" >> $STUNNEL_CONF_FILE
SERVERTYPE=`tr181 -g Device.DeviceInfo.X_RDKCENTRAL-COM_RFC.Identity.DeviceType 2>&1`
if [ ! -z "$SERVERTYPE" ]; then
if [ "$SERVERTYPE" == "TEST" ]; then
echo "checkHost = $JUMP_FQDN" >> $STUNNEL_CONF_FILE

DEVICETYPE=`tr181 -g Device.DeviceInfo.X_RDKCENTRAL-COM_RFC.Identity.DeviceType 2>&1`
echo_t "STUNNEL: Device type is $DEVICETYPE"
if [ ! -z "$DEVICETYPE" ]; then
if [ "$DEVICETYPE" == "TEST" ] || [ "$DEVICETYPE" == "test" ]; then
echo_t "STUNNEL: Device type is TEST"
t2CountNotify "SHORTS_DEVICE_TYPE_TEST"
echo "checkHost = $JUMP_FQDN" >> $STUNNEL_CONF_FILE
echo "checkHost = $DEV_SAN" >> $STUNNEL_CONF_FILE
else
echo_t "STUNNEL: Device type is PROD"
t2CountNotify "SHORTS_DEVICE_TYPE_PROD"
echo "checkHost = $JUMP_FQDN" >> $STUNNEL_CONF_FILE
echo "checkHost = $PROD_SAN" >> $STUNNEL_CONF_FILE
fi
Comment thread lib/rdk/startStunnel.sh
Comment on lines +135 to +175
get_next_fd() {
local fd=3 # Start checking from FD 3 (since 0, 1, 2 are standard in/out/err)
local max_fd=20 # Maximum FD to check

# Try to redirect to /dev/null and check if the FD is free
while [ $fd -le $max_fd ]; do
if ! { true >&$fd; } 2>/dev/null; then
echo "$fd" # Output the available FD (goes to standard output)
return 0 # Set exit status to success
fi
fd=$((fd + 1))
done

# Log failure if no free FD is found
echo "Error: No available file descriptor found up to FD $max_fd" >&2
return 1 # Set exit status to failure
}

# Get the next available file descriptor and export if it's valid
FD_NUMBER=$(get_next_fd)
if [ $? -eq 0 ]; then
export FD_NUMBER

# Create a named pipe
PIPE=$(mktemp -u)
if ! mkfifo "$PIPE" 2>/dev/null; then
echo_t "STUNNEL: ERROR - Failed to create named pipe"
fi

# Open the pipe using the available FD, with error handling
if ! eval "exec $FD_NUMBER<>$PIPE" 2>/dev/null; then
echo_t "STUNNEL: ERROR - Failed to open pipe with file descriptor"
fi

# Removing the pipe after opening
rm "$PIPE"

# Writing passcode to open file descriptor
echo "$(eval "$PASSCODE")" >&$FD_NUMBER &
else
echo "Error: No available file descriptor to use." >&2
Comment on lines +48 to +49
if [ -f /lib/rdk/utils-vendor.sh ]; then
. $RDK_PATH/utils-vendor.sh
Comment on lines +299 to +308
if [ "$version" = "V6" ] && { [ "$packetsLostipv4" -lt "$WifiReassociateTolerance" ] || [ "$packetsLostipv6" -lt "$WifiReassociateTolerance" ]; }; then
echo "$(/bin/timestamp) [DEBUG_NCR] checkPacketLoss: BELOW TOLERANCE returning 0 - resetting FirstPacketLossTime/PacketLossLogTimeStamp/IsWifiReassociated. wifiDriverErrors=$wifiDriverErrors" >> "$logsFile"
FirstPacketLossTime=0
PacketLossLogTimeStamp=0
EthernetLogTimeStamp=0
IsWifiReassociated=0
[ "$wifiDriverErrors" -eq 0 ] && IsWifiReset=0 #Make IsWifiReset=0 only when there is no wifidriverissue
else
echo "$(/bin/timestamp) [DEBUG_NCR] checkPacketLoss: BELOW TOLERANCE returning 0 - skipping reset (version=$version, waiting for V6 measurement). wifiDriverErrors=$wifiDriverErrors" >> "$logsFile"
fi
Comment thread lib/rdk/alertSystem.sh
Comment on lines +20 to +22
# Purpose: This script is used to backup the Logs
# Scope: RDK devices
# Usage: This script is triggered by systemd service
Comment thread lib/rdk/NM_Bootstrap.sh
Comment on lines 114 to +122
if [ -d /opt/secure/NetworkManager/system-connections ]; then
rm -rf /opt/secure/NetworkManager/system-connections/*
echo "`/bin/timestamp` :$0: Listing the connection profiles in device: " >> /opt/logs/NMMonitor.log
ls -lh /opt/secure/NetworkManager/system-connections >> /opt/logs/NMMonitor.log
echo "`/bin/timestamp` :$0: Deleting existing wifi profiles if any..." >> /opt/logs/NMMonitor.log
for f in /opt/secure/NetworkManager/system-connections/*; do
if grep -q "type=wifi" "$f"; then
rm -f "$f"
fi
done
Copilot AI review requested due to automatic review settings June 29, 2026 06:44

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 36 out of 36 changed files in this pull request and generated 8 comments.

Comments suppressed due to low confidence (2)

lib/rdk/startStunnel.sh:107

  • The cert/CA existence check is unquoted and uses -o inside a single test, which can misbehave if variables are empty or contain whitespace. Prefer quoting and separate tests with ||.
if [ ! -f $CERT_PATH -o ! -f $CA_FILE ]; then
    echo_t "STUNNEL: Required cert/CA file not found. Exiting..."
    t2CountNotify "SHORTS_STUNNEL_CERT_FAILURE"
    exit 1
fi

lib/rdk/readBTAddress-generic.sh:28

  • When Bluetooth is disabled, bluetooth_mac is never initialized, so the script prints an empty string. Callers like getDeviceDetails.sh will then cache an empty Bluetooth MAC rather than a stable default (e.g. 00:00:00:00:00:00). Also RDK_PATH may be unset before sourcing utils.

logUploadLog "Application triggered on demand log upload"
sh $LOGUPLOAD_SCRIPT "$tftp_server" 1 1 "$uploadOnReboot" "$upload_protocol" "$upload_httplink" "$TriggerType" 2>/dev/null
logUploadLog "Executing logupload binary: $LOG_UPLOAD_BIN_PATH"
"$LOG_UPLOAD_BIN_PATH" "$tftp_server" 1 1 "$uploadOnReboot" "$upload_protocol" "$upload_httplink" "ondemand" >> /opt/logs/dcmscript.log
logUploadLog "Log upload triggered from regular execution"
nice -n 19 sh $LOGUPLOAD_SCRIPT "$tftp_server" 1 1 "$uploadOnReboot" "$upload_protocol" "$upload_httplink" &
logUploadLog "Executing logupload binary: $LOG_UPLOAD_BIN_PATH"
nice -n 19 "$LOG_UPLOAD_BIN_PATH" "$tftp_server" 1 1 "$uploadOnReboot" "$upload_protocol" "$upload_httplink" >> /opt/logs/dcmscript.log &
Comment on lines +48 to +50
if [ -f /lib/rdk/utils-vendor.sh ]; then
. $RDK_PATH/utils-vendor.sh
fi
Comment on lines +217 to 221
if [ -f "/tmp/checkpacketloss" ] ; then
if [ "$version" = "V4" ] ; then
gwIp=$(cat /tmp/checkpacketloss)
pingCmd="ping"
fi
Comment on lines +268 to +274
for i in {1..9}; do
if ([ "$packetsLostipv4" -ge $((i*10)) ] && [ "$packetsLostipv4" -lt $((i*10+10)) ]) || ([ "$packetsLostipv6" -ge $((i*10)) ] && [ "$packetsLostipv6" -lt $((i*10+10)) ]); then
echo "$(/bin/timestamp) Current Packet loss is WIFIV_WARN_PL_"$((i*10))"PERC" >> "$logsFile"
t2CountNotify "WIFIV_WARN_PL_"$((i*10))"PERC"
break
fi
done
Comment thread lib/rdk/NM_Bootstrap.sh
Comment on lines +118 to +122
for f in /opt/secure/NetworkManager/system-connections/*; do
if grep -q "type=wifi" "$f"; then
rm -f "$f"
fi
done
ExecStartPre=/bin/sh /lib/rdk/start_ssh.sh
ExecStartPre=/bin/systemctl import-environment USE_DEVKEYS
ExecStart=/bin/sh -c '/usr/sbin/dropbear -b /etc/sshbanner.txt ${DROPBEAR_PARAMS} ${DROPBEAR_EXTRA_ARGS} ${IP_ADDRESS_PARAM} ${USE_DEVKEYS}'
ExecStart=/bin/sh -c '/usr/sbin/dropbear -s -b /etc/sshbanner.txt ${DROPBEAR_PARAMS} ${DROPBEAR_EXTRA_ARGS} ${IP_ADDRESS_PARAM} ${USE_DEVKEYS}'
Comment thread lib/rdk/startStunnel.sh
Comment on lines +158 to +170
# Create a named pipe
PIPE=$(mktemp -u)
if ! mkfifo "$PIPE" 2>/dev/null; then
echo_t "STUNNEL: ERROR - Failed to create named pipe"
fi

# Open the pipe using the available FD, with error handling
if ! eval "exec $FD_NUMBER<>$PIPE" 2>/dev/null; then
echo_t "STUNNEL: ERROR - Failed to open pipe with file descriptor"
fi

# Removing the pipe after opening
rm "$PIPE"
Copilot AI review requested due to automatic review settings July 5, 2026 10:57

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 36 out of 36 changed files in this pull request and generated 9 comments.

Comments suppressed due to low confidence (1)

lib/rdk/readBTAddress-generic.sh:31

  • readBTAddress-generic.sh may echo an empty string when BLUETOOTH_ENABLED is false because bluetooth_mac is never initialized. Callers (e.g., getDeviceDetails.sh) typically expect a stable default value (like 00:00:00:00:00:00).

Comment on lines +48 to +50
if [ -f /lib/rdk/utils-vendor.sh ]; then
. $RDK_PATH/utils-vendor.sh
fi
Comment on lines 284 to +288
bluetooth_mac="00:00:00:00:00:00"
if [ "$BLUETOOTH_ENABLED" = "true" ]; then
bluetooth_mac=$(getDeviceBluetoothMac)
if [ -f /lib/rdk/readBTAddress-vendor.sh ]; then
bluetooth_mac=`sh /lib/rdk/readBTAddress-vendor.sh`
else
bluetooth_mac=`sh /lib/rdk/readBTAddress-generic.sh`
Comment thread lib/rdk/NM_Bootstrap.sh
Comment on lines +118 to +122
for f in /opt/secure/NetworkManager/system-connections/*; do
if grep -q "type=wifi" "$f"; then
rm -f "$f"
fi
done
Comment on lines 95 to 99
/bin/timestamp
uptime
uptime
run_top_command
log_disk_usage
cpu_statistics

Comment thread lib/rdk/startStunnel.sh
Comment on lines +158 to +170
# Create a named pipe
PIPE=$(mktemp -u)
if ! mkfifo "$PIPE" 2>/dev/null; then
echo_t "STUNNEL: ERROR - Failed to create named pipe"
fi

# Open the pipe using the available FD, with error handling
if ! eval "exec $FD_NUMBER<>$PIPE" 2>/dev/null; then
echo_t "STUNNEL: ERROR - Failed to open pipe with file descriptor"
fi

# Removing the pipe after opening
rm "$PIPE"
Comment thread lib/rdk/startStunnel.sh
rm "$PIPE"

# Writing passcode to open file descriptor
echo "$(eval "$PASSCODE")" >&$FD_NUMBER &
Comment thread lib/rdk/alertSystem.sh
Comment on lines +101 to +107
if [ "x$PROCESS_NAME" == "xdeepSleepMgrMain" ]; then
# Message data is actual metadata header in case of trigger from deepSleep manager process
# This change is needed since there are data clouds in different deployment which are not flexible to accomodate any deviations in data format
strjson="{\"searchResult\":[{\"Time\":\"$currentTime\"},{\"process_name\":\"$PROCESS_NAME\"},{\"mac\":\"$estb_mac\"},{\"Version\":\"$software_version\"},{\"PartnerId\":\"$partnerId\"},{\"$MSG_DATA\":\"1\"}]}"
else
strjson="{\"searchResult\":[{\"process_name\":\"$PROCESS_NAME\"},{\"mac\":\"$estb_mac\"},{\"Version\":\"$software_version\"},{\"msgTime\":\"$currentTime\"},{\"PartnerId\":\"$partnerId\"},{\"logEntry\":\"$MSG_DATA\"}]}"
fi
Comment on lines 31 to 34
Environment="LOG_PATH=/opt/logs"
Environment="RDK_PATH=/lib/rdk"
ExecStart=/lib/rdk/backup_logs.sh
ExecStart=/usr/bin/backup_logs
RemainAfterExit=yes
Comment thread CHANGELOG.md
Comment on lines +49 to +51
- RDKEMW-15490 : Removing reboot script reference from sysint [`#500`](https://github.com/rdkcentral/sysint/pull/500)
- 5.0.0 release changelog updates [`711601e`](https://github.com/rdkcentral/sysint/commit/711601e303a449f3ea34d5f858f4d7c5d873c9c1)
- Merge tag '4.5.5' into develop [`654be5f`](https://github.com/rdkcentral/sysint/commit/654be5fcc3473060f765481e5cd9dd4f84f65d95)
* RDKEMW-21159: avoid thermal call in deepsleep



* Apply suggestions from code review



---------

Signed-off-by: apatel859 <Amit_Patel5@comcast.com>
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.