Skip to content

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

Open
KTirumalaSrihari wants to merge 197 commits intofeature/RDKEMW-8178from
develop
Open

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

Conversation

@KTirumalaSrihari
Copy link
Copy Markdown
Contributor

No description provided.

rdkcmf-jenkins and others added 30 commits June 24, 2025 15:09
Sysint Release for Develop
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
Copilot AI review requested due to automatic review settings April 17, 2026 10:31
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

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

Comments suppressed due to low confidence (3)

lib/rdk/NM_Bootstrap.sh:36

  • This script is declared as /bin/sh, but uses bash-only regex matching and BASH_REMATCH (e.g. [[ ... =~ ... ]] and ${BASH_REMATCH[1]}). On platforms where /bin/sh is BusyBox ash/dash, this will fail and prevent NM bootstrap from extracting the PSK. Please replace this with POSIX-compatible parsing (e.g. sed/awk) or change the interpreter to bash if that’s guaranteed on target devices.
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
    PSK="${BASH_REMATCH[1]}"

  # Case 2: Unquoted 64-char raw PSK
  elif [[ "$PSK_LINE" =~ psk=([a-fA-F0-9]{64}) ]]; then
    PSK="${BASH_REMATCH[1]}"

lib/rdk/getDeviceDetails.sh:292

  • getBluetoothMac() initializes bluetooth_mac to a default, but then unconditionally overwrites it with the output of readBTAddress-*.sh. If those scripts output an empty string (e.g. Bluetooth disabled), this will return an empty value instead of the intended default. Consider only overwriting when the script returns a non-empty MAC (or have the helper scripts always emit a default).
getBluetoothMac()
{
    bluetooth_mac="00:00:00:00:00:00"
    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`
    fi

    echo "$bluetooth_mac"
}

lib/rdk/readBTAddress-generic.sh:31

  • If BLUETOOTH_ENABLED is not "true", bluetooth_mac is never initialized and the script echoes an empty string. Callers like getDeviceDetails.sh expect a valid MAC (or a default like 00:00:00:00:00:00). Initialize bluetooth_mac to a safe default and quote it when echoing to avoid word-splitting.

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

Comment thread lib/rdk/startStunnel.sh
Comment on lines +153 to +174
# 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
Copy link

Copilot AI Apr 17, 2026

Choose a reason for hiding this comment

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

The new FD/pipe block references PASSCODE but that variable is not defined anywhere in this script. As written, it will write an empty value (or whatever is inherited from the environment) to the FD, and eval "$PASSCODE" is also a command-injection risk. Define/validate where the passcode comes from (e.g. an explicit argument), and avoid eval by writing the literal value safely.

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

Copilot AI Apr 17, 2026

Choose a reason for hiding this comment

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

PIPE=$(mktemp -u) is unsafe (TOCTOU race) and can be exploited if an attacker can create the same path before mkfifo runs. Prefer creating a secure temp path with mktemp (without -u) and then creating the FIFO under that directory or using a securely generated filename that you create atomically.

Suggested change
# 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 &
# Create a named pipe in a securely created temporary directory
PIPE_DIR=$(mktemp -d 2>/dev/null)
if [ -z "$PIPE_DIR" ] || [ ! -d "$PIPE_DIR" ]; then
echo_t "STUNNEL: ERROR - Failed to create temporary directory for named pipe"
else
PIPE="$PIPE_DIR/pipe"
if ! mkfifo "$PIPE" 2>/dev/null; then
echo_t "STUNNEL: ERROR - Failed to create named pipe"
rmdir "$PIPE_DIR" 2>/dev/null
else
# 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 -f "$PIPE"
rmdir "$PIPE_DIR" 2>/dev/null
# Writing passcode to open file descriptor
echo "$(eval "$PASSCODE")" >&$FD_NUMBER &
fi
fi

Copilot uses AI. Check for mistakes.
Comment on lines +217 to 221
if [ -f "/tmp/checkpacketloss" ] ; then
if [ "$version" = "V4" ] ; then
gwIp=$(cat /tmp/checkpacketloss)
pingCmd="ping"
fi
Copy link

Copilot AI Apr 17, 2026

Choose a reason for hiding this comment

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

When /tmp/checkpacketloss exists, the code only sets gwIp/pingCmd for the V4 call. On the subsequent V6 call, gwIp remains empty, so the function will incorrectly treat it as "no route" and can skew packet-loss state/telemetry. Consider either supporting a V6 override file as well, or only using /tmp/checkpacketloss for V4 while still computing V6 gwIp normally.

Copilot uses AI. Check for mistakes.
Comment on lines +62 to +66
key="$1"
# Extract RHS after '=' and trim whitespace
grep -m1 -E "^[[:space:]]*$key=" "$BOOTSTRAP" 2>/dev/null | \
cut -d'=' -f2- | sed 's/^[[:space:]]*//; s/[[:space:]]*$//'
}
Copy link

Copilot AI Apr 17, 2026

Choose a reason for hiding this comment

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

In get_bs_val(), grep is using an extended-regex pattern built from the full TR-181 key (e.g. Device.Time.NTPServer1). Because the key contains '.' characters, -E will treat them as wildcards and may match unintended lines in bootstrap.ini. Use a fixed-string match (grep -F) or escape the key before building the regex.

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

Copilot AI Apr 17, 2026

Choose a reason for hiding this comment

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

MSG_DATA is embedded directly into JSON (both as a key in the deepSleepMgrMain branch and as a string value in the else branch) without any escaping. If MSG_DATA contains quotes, backslashes, or newlines, the JSON becomes invalid; if exec_curl_mtls ultimately evals/executes the curl string, this can also become a command-injection vector. Escape MSG_DATA for JSON (or build the payload with a JSON tool) and avoid passing a shell-constructed curl command through eval-style execution.

Copilot uses AI. Check for mistakes.
naveenkumarhanasi and others added 4 commits April 23, 2026 15:53
Sysint Release 5.0.1
…is missing (#511)

* RDKEMW-10725:gstreamer-cleanup conditions when cdl_flashed_file_name is missing

Reason for change: gstreamer-cleanup is happening on every reboot when /opt/cdl_flashed_file_name is missing
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>

* Apply suggestion from @Copilot

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

* RDKEMW-10725:gstreamer-cleanup conditions when cdl_flashed_file_name is missing

Reason for change: gstreamer-cleanup is happening on every reboot when /opt/cdl_flashed_file_name is missing
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>

* License banner addition

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

* RDKEMW-10725:gstreamer-cleanup conditions when cdl_flashed_file_name is missing

Reason for change: gstreamer-cleanup is happening on every reboot when /opt/cdl_flashed_file_name is missing
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>

---------

Signed-off-by: Renuka Varry <rvarry049@cable.comcast.com>
Co-authored-by: Renuka Varry <rvarry049@cable.comcast.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Copilot AI review requested due to automatic review settings April 27, 2026 19:40
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

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

Comments suppressed due to low confidence (1)

lib/rdk/readBTAddress-generic.sh:31

  • When BLUETOOTH_ENABLED is not "true", bluetooth_mac is never set, so this script echoes an empty value. Callers (e.g., getDeviceDetails.sh) expect a deterministic output; consider setting bluetooth_mac to a default like "00:00:00:00:00:00" (or explicitly echoing that default) when Bluetooth is disabled/unavailable.

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

Comment thread lib/rdk/startStunnel.sh
Comment on lines +154 to 176
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
fi
Copy link

Copilot AI Apr 27, 2026

Choose a reason for hiding this comment

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

This new pipe/FD block appears broken: PASSCODE is never defined anywhere in this script, so the eval will write an empty string (or error) to the FD. Additionally, eval here is a command-injection risk, and mktemp -u is vulnerable to TOCTOU races. If a passcode needs to be passed to a downstream process, define a clear source for it, avoid eval, and use a securely-created FIFO (mktemp + mkfifo) or a different IPC mechanism; otherwise remove this dead/unreliable block.

Copilot uses AI. Check for mistakes.
Comment on lines +264 to +274
#Send telemetry notification for 20%,30%....90% packet loss
if [ "$packetsLostipv4" -gt "$lossThreshold" ] || [ "$packetsLostipv6" -gt "$lossThreshold" ] ; then
echo "$(/bin/timestamp) Packet loss more than $lossThreshold% observed." >> "$logsFile"
[ "$lossThreshold" -eq 10 ] && t2CountNotify "WIFIV_WARN_PL_10PERC"
if [ "$packetsLostipv4" -ne 100 ] && [ "$packetsLostipv6" -ne 100 ]; then
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
Copy link

Copilot AI Apr 27, 2026

Choose a reason for hiding this comment

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

This script is /bin/sh, but the loop for i in {1..9} relies on bash brace expansion, which is not supported by many /bin/sh implementations (dash/busybox ash). That will cause the telemetry threshold loop to run once with the literal string "{1..9}", breaking the packet-loss notification logic. Use a POSIX-compatible loop (e.g., a numeric while loop or seq) instead.

Copilot uses AI. Check for mistakes.
Comment on lines +1 to +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"
Copy link

Copilot AI Apr 27, 2026

Choose a reason for hiding this comment

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

This unit file has no [Install] section and is not referenced by any other unit in this repo, so it won’t be enabled or started by default. If it’s meant to run during boot/network bring-up, add an [Install] stanza (e.g., WantedBy=...) or wire it in via Wants=/After= from an existing target/unit; otherwise it’s likely to be dead configuration.

Copilot uses AI. Check for mistakes.
Comment on lines +48 to +50
if [ -f /lib/rdk/utils-vendor.sh ]; then
. $RDK_PATH/utils-vendor.sh
fi
Copy link

Copilot AI Apr 27, 2026

Choose a reason for hiding this comment

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

The file existence check uses a hard-coded path (/lib/rdk/utils-vendor.sh) but the script sources "$RDK_PATH/utils-vendor.sh". If RDK_PATH is not "/lib/rdk" (or if only one of these locations is populated), this will silently skip vendor utilities or fail to source them. Use the same path for both the -f check and the subsequent source (or check both locations explicitly).

Copilot uses AI. Check for mistakes.
Comment on lines 282 to 289
getBluetoothMac()
{
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`
fi
Copy link

Copilot AI Apr 27, 2026

Choose a reason for hiding this comment

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

getBluetoothMac() initializes bluetooth_mac to a default, but then unconditionally overwrites it with the output of readBTAddress-*.sh. If BLUETOOTH_ENABLED is false, readBTAddress-generic.sh currently echoes an empty string, so this function will return an empty value instead of the intended default MAC. Preserve the default when the helper script returns empty (or update the helper script to always emit the default when Bluetooth is disabled/unavailable).

Copilot uses AI. Check for mistakes.
Comment thread lib/rdk/NM_Bootstrap.sh Outdated
Comment on lines +91 to +94
if [ -z $PSK ]; then
#connect to wifi
nmcli conn add type wifi con-name "$SSID" autoconnect yes ifname wlan0 ssid "$SSID"
nmcli conn reload
Copy link

Copilot AI Apr 27, 2026

Choose a reason for hiding this comment

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

Similarly, [ -z $PSK ] is unquoted and can produce test syntax errors when PSK is empty or contains whitespace. Quote PSK in the -z test to keep the branching reliable.

Copilot uses AI. Check for mistakes.
madhubabutt and others added 2 commits April 28, 2026 10:22
… sysint (#522)

Co-authored-by: mtirum011 <madhubabu_tirumala@comcast.com>
Copilot AI review requested due to automatic review settings May 1, 2026 15:22
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

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

Comments suppressed due to low confidence (2)

lib/rdk/readBTAddress-generic.sh:31

  • bluetooth_mac is only set when BLUETOOTH_ENABLED=true, but the script always echoes the variable. When Bluetooth is disabled this prints an empty string, and callers (e.g., getDeviceDetails.sh assigns the script output) will treat it as the device BT MAC. Consider defaulting to 00:00:00:00:00:00 (or similar) when Bluetooth is disabled / lookup fails, and quote the echo to avoid surprises.
    lib/rdk/NM_Bootstrap.sh:37
  • This script is #!/bin/sh but uses bash-specific features ([[ ... =~ ... ]] regex matching and BASH_REMATCH). On platforms where /bin/sh is not bash (e.g., dash/busybox ash), this will fail and break Wi-Fi bootstrap. Either change the shebang to bash (if guaranteed available) or rewrite the parsing using POSIX tools (grep/sed/awk).
  if [[ "$PSK_LINE" =~ psk=\"(.+)\" ]]; then
    PSK="${BASH_REMATCH[1]}"

  # Case 2: Unquoted 64-char raw PSK
  elif [[ "$PSK_LINE" =~ psk=([a-fA-F0-9]{64}) ]]; then
    PSK="${BASH_REMATCH[1]}"


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

Comment thread lib/rdk/NM_Bootstrap.sh Outdated
Comment on lines +65 to +66
if [ -z $SSID ]; then
echo "`/bin/timestamp` :$0: No SSID found in supplicant conf" >> /opt/logs/NMMonitor.log
Copy link

Copilot AI May 1, 2026

Choose a reason for hiding this comment

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

[ -z $SSID ] (and similarly [ -z $PSK ]) should quote the variable ([ -z "$SSID" ]) to avoid test syntax errors when the variable is empty or contains whitespace. As written, an empty SSID can result in [ -z ] and the script may exit with a shell error.

Copilot uses AI. Check for mistakes.
Comment thread lib/rdk/startStunnel.sh
Comment on lines +159 to +166
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"
Copy link

Copilot AI May 1, 2026

Choose a reason for hiding this comment

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

mktemp -u is inherently race-prone (TOCTOU) and can be exploited to pre-create the chosen path. Since this pipe is used to pass sensitive data (passcode), generate a secure unique path with mktemp (without -u) and then create the FIFO safely (e.g., create temp file, remove it, then mkfifo), or use a fixed, permission-restricted directory.

Copilot uses AI. Check for mistakes.
vrenu2018 and others added 2 commits May 4, 2026 16:04
… present (#528)

* RDKEMW-17800:gst-cleanup conditions when cdl_flashed_file_name is not present

Reason for change: gstreamer-cleanup is happening on every reboot when /opt/cdl_flashed_file_name is missing.
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>

* RDKEMW-17800:gst-cleanup conditions when cdl_flashed_file_name is not present

Reason for change: gstreamer-cleanup is happening on every reboot when /opt/cdl_flashed_file_name is missing.
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>

---------

Signed-off-by: Renuka Varry <rvarry049@cable.comcast.com>
Co-authored-by: Renuka Varry <rvarry049@cable.comcast.com>
* RDKEMW-16774: [Security] Device partition structure seen in logs

* Updating system_info_collector script to log top output

---------

Co-authored-by: Saranya <saranya_elango@comcast.com>
Copilot AI review requested due to automatic review settings May 7, 2026 14:51
… crashes (#539)

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

Copilot AI left a comment

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

Comments suppressed due to low confidence (2)

lib/rdk/readBTAddress-generic.sh:31

  • bluetooth_mac is only set when BLUETOOTH_ENABLED is true; otherwise the script echoes an empty string. Since callers (e.g. getDeviceDetails.sh) expect this helper to always return a value (often defaulting to 00:00:00:00:00:00), please initialize bluetooth_mac to a safe default before the conditional and always echo a quoted value.
    lib/rdk/NM_Bootstrap.sh:37
  • This script is declared with #!/bin/sh but uses bash-only regex matching ([[ ... =~ ... ]]) and BASH_REMATCH. On systems where /bin/sh is not bash, this will fail and prevent WiFi bootstrap from configuring NetworkManager. Either switch the shebang to /bin/bash (and ensure bash is available) or rewrite the PSK extraction to be POSIX-sh compatible (e.g., using sed/awk).
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
    PSK="${BASH_REMATCH[1]}"

  # Case 2: Unquoted 64-char raw PSK
  elif [[ "$PSK_LINE" =~ psk=([a-fA-F0-9]{64}) ]]; then
    PSK="${BASH_REMATCH[1]}"

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
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

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

Comments suppressed due to low confidence (1)

lib/rdk/readBTAddress-generic.sh:31

  • If BLUETOOTH_ENABLED is not true, bluetooth_mac is never set and the script prints an empty line. Since callers (e.g., getDeviceDetails.sh) fall back to this script to obtain the BT MAC, consider printing a deterministic default (like 00:00:00:00:00:00) when Bluetooth is disabled or when getDeviceBluetoothMac returns empty.

Comment thread lib/rdk/startStunnel.sh
Comment on lines +134 to +151
#Function to find available fd at this point in time
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
}
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
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.