rebase#432
Conversation
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
|
I have read the CLA Document and I hereby sign the CLA 12 out of 13 committers have signed the CLA. |
There was a problem hiding this comment.
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.shand refactored its functionality intoNM_Dispatcher.shandNM_preDown.sh - Added support for a binary log upload implementation with fallback to script-based approach in
Start_MaintenanceTasks.sh - Added
com.comcast.viper_ipato warehouse testing exceptions inwh_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.
| 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 |
There was a problem hiding this comment.
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.
| 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 |
| 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 |
There was a problem hiding this comment.
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.
| 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 |
| 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" & |
There was a problem hiding this comment.
Trailing whitespace after the ampersand on this line. This is inconsistent with line 216 which has the same command structure without trailing whitespace.
| 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" & |
| 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" & |
There was a problem hiding this comment.
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.
| 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 |
There was a problem hiding this comment.
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.
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
… crashes (#539) Co-authored-by: mtirum011 <madhubabu_tirumala@comcast.com> Co-authored-by: nhanasi <navihansi@gmail.com>
There was a problem hiding this comment.
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_macis only set whenBLUETOOTH_ENABLEDis true; otherwise this script echoes an empty string. SincegetDeviceDetails.shuses this output directly, Bluetooth-disabled devices will report an empty Bluetooth MAC (overwriting its default). Initializebluetooth_macto a safe default (e.g., 00:00:00:00:00:00) and only override it whengetDeviceBluetoothMacreturns a non-empty value.
| 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 |
| # 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 & |
* 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>
There was a problem hiding this comment.
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_macis only set whenBLUETOOTH_ENABLED=true; otherwise this script echoes an unset/empty value. That can propagate an empty Bluetooth MAC to callers (e.g., device details collection). Initializebluetooth_macto a safe default (like00:00:00:00:00:00) and quote theechooutput.
| [Service] | ||
| Type=exec | ||
| Type=simple | ||
| ExecStart= /bin/sh -c '/lib/rdk/NM_Bootstrap.sh' |
| # 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 & |
| #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 |
| 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 |
| # 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 |
There was a problem hiding this comment.
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' |
| 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 |
| 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 |
| 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 |
| if [ -f /lib/rdk/utils-vendor.sh ]; then | ||
| . $RDK_PATH/utils-vendor.sh |
| 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 |
| # Purpose: This script is used to backup the Logs | ||
| # Scope: RDK devices | ||
| # Usage: This script is triggered by systemd service |
| 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 |
There was a problem hiding this comment.
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
-oinside 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_macis never initialized, so the script prints an empty string. Callers likegetDeviceDetails.shwill then cache an empty Bluetooth MAC rather than a stable default (e.g.00:00:00:00:00:00). AlsoRDK_PATHmay 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 & |
| if [ -f /lib/rdk/utils-vendor.sh ]; then | ||
| . $RDK_PATH/utils-vendor.sh | ||
| fi |
| if [ -f "/tmp/checkpacketloss" ] ; then | ||
| if [ "$version" = "V4" ] ; then | ||
| gwIp=$(cat /tmp/checkpacketloss) | ||
| pingCmd="ping" | ||
| fi |
| 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 |
| 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}' |
| # 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" |
Signed-off-by: Yogeswaran K <yogeswaransky@gmail.com>
There was a problem hiding this comment.
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).
| if [ -f /lib/rdk/utils-vendor.sh ]; then | ||
| . $RDK_PATH/utils-vendor.sh | ||
| fi |
| 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` |
| for f in /opt/secure/NetworkManager/system-connections/*; do | ||
| if grep -q "type=wifi" "$f"; then | ||
| rm -f "$f" | ||
| fi | ||
| done |
| /bin/timestamp | ||
| uptime | ||
| uptime | ||
| run_top_command | ||
| log_disk_usage | ||
| cpu_statistics | ||
|
|
| # 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" |
| rm "$PIPE" | ||
|
|
||
| # Writing passcode to open file descriptor | ||
| echo "$(eval "$PASSCODE")" >&$FD_NUMBER & |
| 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 |
| Environment="LOG_PATH=/opt/logs" | ||
| Environment="RDK_PATH=/lib/rdk" | ||
| ExecStart=/lib/rdk/backup_logs.sh | ||
| ExecStart=/usr/bin/backup_logs | ||
| RemainAfterExit=yes |
| - 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>
No description provided.