Skip to content

Rebase feature/RDKEMW-8178 branch inline with develop - #434

Open
KTirumalaSrihari wants to merge 264 commits into
feature/RDKEMW-8178from
develop
Open

Rebase feature/RDKEMW-8178 branch inline with develop#434
KTirumalaSrihari wants to merge 264 commits into
feature/RDKEMW-8178from
develop

Conversation

@KTirumalaSrihari

Copy link
Copy Markdown
Contributor

No description provided.

rdkcmf-jenkins and others added 30 commits September 25, 2025 18:01
RDKTV-38567: PAT_EntOS_A4K-Soft Reboot failed from settings; Stuck on Black screen
Reason for change: Defauting MTLS and remove fallback
Test Procedure: Make sure all communication is MTLS & secure
Risks: Medium
Priority: P1
Deploy fossid_integration_stateless_diffscan_target_repo action
Release tag for sysint repo
RDKE-921: Clean up the mitigation done for dnsmasq restart in Xumo TV Release
RDK-58220 : [RDKE] Migrate Functionality In TR-69Hostif And NTP Scripts To Core Modules
* RDKEMW-7549 : Increase in SYST_WARN_WiFiNotConn marker

Reason for change: Skip printing TELEMETRY_WIFI_NOT_CONNECTED for the
first time. This reduces false alarm in case of
deepsleep resume.
Test Procedure: Flash the image and check the presence of
SYST_WARN_WiFiNotConn marker after deepsleep resume
Risks: Low
Priority: P1
Signed-off-by: Nivetha J <Nivetha_JosephJohnBritto@comcast.com>

* Update networkConnectionRecovery.sh

---------

Signed-off-by: Nivetha J <Nivetha_JosephJohnBritto@comcast.com>
Co-authored-by: Saranya <saranya_elango@comcast.com>
Sysint 3.0.7 release tag
RDKE-900 RDKEMW-4899: Default to MTLS connection on all endpoints

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 63 out of 63 changed files in this pull request and generated no new comments.

Comments suppressed due to low confidence (5)

lib/rdk/readBTAddress-generic.sh:31

  • bluetooth_mac can be unset when Bluetooth is disabled, which makes the script print an empty value. Callers (e.g., device detail collection) typically expect a deterministic MAC string even when Bluetooth is off.
    lib/rdk/startStunnel.sh:158
  • This block references PASSCODE (never set anywhere in the script) and uses eval, plus it creates a named pipe via mktemp -u (TOCTOU race). There’s also no consumer of FD_NUMBER later in the script, so this logic is currently dead code and can fail or introduce risk at runtime.
    lib/rdk/timesyncd-conf-update.sh:140
  • The script updates /etc/systemd/timesyncd.conf but no longer restarts systemd-timesyncd, so the new NTP settings may not take effect until a later restart. Also, appending ConnectionRetrySec=5 on every run can create duplicate entries.
    lib/rdk/alertSystem.sh:107
  • MSG_DATA is interpolated directly into JSON and also into a single-quoted curl -d string. If the alert message contains quotes, backslashes, newlines, or a single quote, the JSON/payload can become invalid (or the shell quoting can break), causing alerts to fail or be malformed.
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

lib/rdk/networkConnectionRecovery.sh:272

  • for i in {1..9} uses brace expansion, which is not POSIX and will not run under many /bin/sh implementations (e.g., BusyBox ash). This can break the packet-loss telemetry loop entirely on targets where /bin/sh isn’t bash.
      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

Copilot AI review requested due to automatic review settings July 20, 2026 08:43

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 63 out of 63 changed files in this pull request and generated 2 comments.

Comments suppressed due to low confidence (7)

lib/rdk/networkConnectionRecovery.sh:274

  • This script is /bin/sh, but the {1..9} brace expansion is a bash feature. On POSIX shells this won’t expand and will break the packet-loss notification loop.
      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

lib/rdk/readBTAddress-generic.sh:31

  • If BLUETOOTH_ENABLED is not true, this script prints an empty line. getDeviceDetails.sh expects a MAC string; returning empty can propagate incorrect data. Prefer emitting a stable default when Bluetooth is disabled/unavailable.
    lib/rdk/startStunnel.sh:116
  • checkHost is written twice (first $JUMP_FQDN, then $DEV_SAN/$PROD_SAN). Multiple checkHost entries are ambiguous and can cause stunnel to validate against the wrong hostname depending on how duplicates are handled. Emit exactly one checkHost based on device type (and fall back to $JUMP_FQDN only when type is unknown).
    lib/rdk/startStunnel.sh:162
  • Using mktemp -u to pick a FIFO path is vulnerable to TOCTOU races (another process can create that path between name generation and mkfifo). Also, errors from mkfifo aren’t handled as fatal (the script continues). Consider using mktemp without -u and failing fast if FIFO creation/open fails.
    lib/rdk/startStunnel.sh:173
  • PASSCODE is evaluated via eval and written to an arbitrary FD in the background. If PASSCODE can be influenced (directly or indirectly), this enables command injection. Prefer treating the passcode as data (no eval) and validating it is set before writing.
    lib/rdk/timesyncd-conf-update.sh:140
  • After updating /etc/systemd/timesyncd.conf, the script no longer restarts systemd-timesyncd. systemd-timesyncd won’t pick up config changes until restart, so the new NTP servers may never be applied during the current boot.
    lib/rdk/alertSystem.sh:107
  • MSG_DATA and other fields are interpolated into JSON without escaping. If the alert message contains quotes, backslashes, or newlines, the payload becomes invalid JSON (and can potentially be used for JSON injection into downstream systems).
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 +25 to +31
powerState=$(/usr/bin/QueryPowerState)

if [ "$powerState" != "DEEPSLEEP" ]; then
boardTemp=`/bin/cat /sys/class/thermal/thermal_zone0/temp | sed 's/./&./2'`c
else
boardTemp="Device in Deepsleep"
fi
Comment thread lib/rdk/NM_Bootstrap.sh
Comment on lines +124 to 133
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 "$KEY_MGMT" wifi-sec.psk "$PSK"
nmcli conn reload
fi
fi
tukken-comcast and others added 4 commits July 24, 2026 13:34
…nly/IPv6-only networks (#581)

* DELIA-70624: updated to reset counters only if gateway is available for ipv6.

Signed-off-by: Balaji Punnuru <Balaji_Punnuru@comcast.com>

* DELIA-70624: Added debug in the script

Signed-off-by: Balaji Punnuru <Balaji_Punnuru@comcast.com>

* DELIA-70624: networkConnectionRecovery: presence-aware packet-loss recovery trigger

Recovery now fires only when no routed IP stack has acceptable
connectivity and at least one routed stack is at/above the reassociate
tolerance. This fixes the IPv4-only / IPv6-only case where a stack with
no default route left packetsLost at 0 and suppressed recovery.

Also folded in reliability/logging fixes:
- clear stale gwIp on the V6 test-hook path
- guard packet-loss comparisons against unparseable ping output
- emit SYST_WARN_GW100PERC_PACKETLOSS to the logs file on every run
- ping the IPv4 default-route interface explicitly (ping -I)
- log total ipv4/ipv6 packet loss when above threshold
- simplify the trigger to anyGood/anyBad classification

* DELIA-70624: networkConnectionRecovery: add log() helper and per-call packet-loss fix

- Introduce a log() helper that prepends the timestamp and appends to
  $logsFile, and convert the timestamped echo call sites to use it.
- Rename packetsLostipv4/packetsLostipv6 globals to
  ipv4PacketLoss/ipv6PacketLoss for clarity.
- Reset the per-call packetLoss to "" at the top of checkPacketLoss and
  guard the packet-loss telemetry block with [ -n "$packetLoss" ], so a
  routeless or unparseable ping no longer reuses the other family's value
  or triggers integer-comparison errors.
- Fix a "[" spacing bug in checkWifiDrvErrors.

Telemetry markers and t2CountNotify calls are unchanged.

* DELIA-70624: networkConnectionRecovery: log route/loss snapshot on state change

Emit a "network state changed" line with the per-stack route-present flags
and packet-loss values only when the snapshot differs from the previous run
(persisted in /tmp/.ncr_laststate), so field logs capture every transition
without printing on every run. Debugging aid for customer-site triage.

* DELIA-70624: remove debug logging and make script POSIX/busybox-sh safe

- Drop the temporary DEBUG_NCR field-debug logging; retain the
  "network state changed" transition log (now unprefixed).
- checkWifiDrvErrors(): $dir already holds the full debugfs path, so remove
  the duplicated /sys/kernel/debug/ieee80211/ prefix from the log messages,
  and capture the cat exit status so the failure log reports the real status
  instead of the enclosing test's result.
- Replace bashisms with POSIX/busybox-ash equivalents: source -> .,
  [[ =~ ]] -> case, [[ ]] -> [ ], and {1..9} -> explicit list (the brace
  form never expands under busybox ash, which had left the
  WIFIV_WARN_PL_20..90PERC packet-loss markers non-functional on target).
- Minor whitespace cleanup in checkDnsFile().

* DELIA-70624: restore 100% packet-loss triage marker and fix marker case

Reinstate the field-triage log marker for 100% packet loss that was lost
when checkPacketLoss() moved to a tolerance-based recovery decision. The
new log-only marker "100% Packet loss is observed on all routed IP stacks"
fires when every routed IP stack shows exactly 100% loss. It is independent
of WifiReassociateTolerance and does not alter the recovery/return path, so
recovery behaviour is unchanged. Unlike the legacy dual-stack
"...for both ipv4 and ipv6" print, it is also emitted correctly on
IPv4-only and IPv6-only networks. Triage associates the old and new strings
to the same 100%-packet-loss marker for trend continuity across images.

Also capitalise the "Packet loss more than 10% observed" marker (was
lowercase "packet loss ...") since triage marker matching is case-sensitive.

---------

Signed-off-by: Balaji Punnuru <Balaji_Punnuru@comcast.com>
Co-authored-by: Balaji Punnuru <Balaji_Punnuru@comcast.com>
Sysint release for 8.4 hotfix
Copilot AI review requested due to automatic review settings July 27, 2026 14:10

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.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

* RDK-61784:Model specific sshkeys for RDKE active platforms

Reason for change:Switch keys only in prod builds
Test Procedure: Build and verify.
Risks: None
Priority: P1

* Update Start_MaintenanceTasks.sh

* Revert "Rebase "

---------

Co-authored-by: NareshM1702 <risingphoenix785@gmail.com>
Copilot AI review requested due to automatic review settings July 29, 2026 13:27

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.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

…nly/IPv6-only networks (#570)

* DELIA-70624: Updated Script to reset counters only if gateway is enabled.

Signed-off-by: Balaji Punnuru <Balaji_Punnuru@comcast.com>

* DELIA-70624: networkConnectionRecovery: presence-aware packet-loss recovery trigger

Recovery now fires only when no routed IP stack has acceptable
connectivity and at least one routed stack is at/above the reassociate
tolerance. This fixes the IPv4-only / IPv6-only case where a stack with
no default route left packetsLost at 0 and suppressed recovery.

Also folded in reliability/logging fixes:
- clear stale gwIp on the V6 test-hook path
- guard packet-loss comparisons against unparseable ping output
- emit SYST_WARN_GW100PERC_PACKETLOSS to the logs file on every run
- ping the IPv4 default-route interface explicitly (ping -I)
- log total ipv4/ipv6 packet loss when above threshold
- simplify the trigger to anyGood/anyBad classification

* DELIA-70624: networkConnectionRecovery: add log() helper and per-call packet-loss fix

- Introduce a log() helper that prepends the timestamp and appends to
  $logsFile, and convert the timestamped echo call sites to use it.
- Rename packetsLostipv4/packetsLostipv6 globals to
  ipv4PacketLoss/ipv6PacketLoss for clarity.
- Reset the per-call packetLoss to "" at the top of checkPacketLoss and
  guard the packet-loss telemetry block with [ -n "$packetLoss" ], so a
  routeless or unparseable ping no longer reuses the other family's value
  or triggers integer-comparison errors.
- Fix a "[" spacing bug in checkWifiDrvErrors.

Telemetry markers and t2CountNotify calls are unchanged.

* DELIA-70624: networkConnectionRecovery: log route/loss snapshot on state change

Emit a "network state changed" line with the per-stack route-present flags
and packet-loss values only when the snapshot differs from the previous run
(persisted in /tmp/.ncr_laststate), so field logs capture every transition
without printing on every run. Debugging aid for customer-site triage.

* DELIA-70624: remove debug logging and make script POSIX/busybox-sh safe

- Drop the temporary DEBUG_NCR field-debug logging; retain the
  "network state changed" transition log (now unprefixed).
- checkWifiDrvErrors(): $dir already holds the full debugfs path, so remove
  the duplicated /sys/kernel/debug/ieee80211/ prefix from the log messages,
  and capture the cat exit status so the failure log reports the real status
  instead of the enclosing test's result.
- Replace bashisms with POSIX/busybox-ash equivalents: source -> .,
  [[ =~ ]] -> case, [[ ]] -> [ ], and {1..9} -> explicit list (the brace
  form never expands under busybox ash, which had left the
  WIFIV_WARN_PL_20..90PERC packet-loss markers non-functional on target).
- Minor whitespace cleanup in checkDnsFile().

* DELIA-70624: restore 100% packet-loss triage marker and fix marker case

Reinstate the field-triage log marker for 100% packet loss that was lost
when checkPacketLoss() moved to a tolerance-based recovery decision. The
new log-only marker "100% Packet loss is observed on all routed IP stacks"
fires when every routed IP stack shows exactly 100% loss. It is independent
of WifiReassociateTolerance and does not alter the recovery/return path, so
recovery behaviour is unchanged. Unlike the legacy dual-stack
"...for both ipv4 and ipv6" print, it is also emitted correctly on
IPv4-only and IPv6-only networks. Triage associates the old and new strings
to the same 100%-packet-loss marker for trend continuity across images.

Also capitalise the "Packet loss more than 10% observed" marker (was
lowercase "packet loss ...") since triage marker matching is case-sensitive.

---------

Signed-off-by: Balaji Punnuru <Balaji_Punnuru@comcast.com>
Co-authored-by: Balaji Punnuru <Balaji_Punnuru@comcast.com>
Copilot AI review requested due to automatic review settings July 29, 2026 14:32

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.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

…rty files in /etc (#582)

Co-authored-by: mtirum011 <madhubabu_tirumala@comcast.com>
Co-authored-by: nhanasi <navihansi@gmail.com>
Copilot AI review requested due to automatic review settings July 29, 2026 16:24

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.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

Copilot AI review requested due to automatic review settings July 30, 2026 16:06

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.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

Signed-off-by: Yogeswaran K <yogeswaransky@gmail.com>
Copilot AI review requested due to automatic review settings August 3, 2026 04:53

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 65 out of 65 changed files in this pull request and generated 1 comment.

Suppressed comments (4)

lib/rdk/getDeviceDetails.sh:50

  • The file existence check looks in /lib/rdk/utils-vendor.sh but the script then sources $RDK_PATH/utils-vendor.sh. If RDK_PATH is not /lib/rdk, this will incorrectly try to source a non-existent path even though the check passed.
if [ -f /lib/rdk/utils-vendor.sh ]; then
    . $RDK_PATH/utils-vendor.sh
fi

lib/rdk/timesyncd-conf-update.sh:66

  • get_bs_val uses grep -E with $key unescaped. Because $key contains dots (e.g., Device.Time.NTPServer1), . is treated as “any character” and can match the wrong keys in bootstrap.ini.
    lib/rdk/alertSystem.sh:23
  • This header says the script “is used to backup the Logs”, but this file implements an alert/telemetry POST. The purpose/scope/usage comment block should match the actual behavior to avoid operational confusion.
# Purpose: This script is used to backup the Logs
# Scope: RDK devices
# Usage: This script is triggered by systemd service 
##############################################################################

lib/rdk/alertSystem.sh:113

  • CURL_INPUT embeds the JSON payload using single quotes (-d '$strjson'). If the payload contains a single quote, this will break shell quoting and can alter the curl command. Use double quotes around the expanded JSON instead.
if [ -f $EnableOCSPStapling ] || [ -f $EnableOCSP ]; then
    CURL_INPUT=" -w '%{http_code}\n' -H \"Accept: application/json\" -H \"Content-type: application/json\" -X POST -d '$strjson' -o \"$HTTP_FILENAME\" \"$UPLOAD_END_POINT\" --cert-status --connect-timeout 30 -m 30 "
else
    CURL_INPUT=" -w '%{http_code}\n' -H \"Accept: application/json\" -H \"Content-type: application/json\" -X POST -d '$strjson' -o \"$HTTP_FILENAME\" \"$UPLOAD_END_POINT\" --connect-timeout 30 -m 30 "
fi

Comment thread lib/rdk/start_ssh.sh
Comment on lines +77 to 89
if [ "BUILD_TYPE" != "dev" ]; then
DEVICETYPE=$(tr181 -d Device.DeviceInfo.X_RDKCENTRAL-COM_RFC.Identity.DeviceType 2>&1 > /dev/null)
if [ "$DEVICETYPE" = "TEST" ]; then
USE_DEVKEYS="-f authorized_keys_dev"
echo " dropbear using dev authorization keys"
else
USE_DEVKEYS=""
echo " dropbear using prod authorization keys"
fi
else
USE_DEVKEYS=""
echo " dropbear using prod authorization keys"
echo " Build type is dev , use dev authorization keys by default"
fi
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.