-
Notifications
You must be signed in to change notification settings - Fork 5
Rebase feature/RDKEMW-8178 branch inline with develop #434
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: feature/RDKEMW-8178
Are you sure you want to change the base?
Conversation
Sysint Release for Develop
…ution Update rebootNow.sh
Update CODEOWNERS
…elop Deploy cla action
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
Rebase with develop
Release tag for sysint repo
Rebase with develop
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
Signed-off-by: Pothiraj Paulraj <pothiraj.paulraj@sky.uk>
|
I have read the CLA Document and I hereby sign the CLA 15 out of 17 committers have signed the CLA. |
There was a problem hiding this comment.
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 rebases the feature/RDKEMW-8178 branch inline with the develop branch, consolidating multiple features and fixes from versions 3.0.5 through 4.2.2. The changes focus on network management improvements, system monitoring enhancements, log upload modernization, and various cleanup activities.
Changes:
- Removes obsolete scheduled reboot, timesyncd restart, and reboot counter services along with their associated scripts
- Updates systemd service files to use network-online.target instead of network-up.target for better network dependency management
- Refactors network management scripts by consolidating updateGlobalIPInfo.sh functionality into NM_Dispatcher.sh and NM_preDown.sh
- Adds swap memory monitoring to system health collection
- Implements logupload binary with script fallback mechanism
- Updates MTLS log upload to default configuration and removes conditional xPKI checks
- Adds NetworkManager migration support and configuration management
Reviewed changes
Copilot reviewed 40 out of 40 changed files in this pull request and generated 10 comments.
Show a summary per file
| File | Description |
|---|---|
| systemd_units/*.service (deleted) | Removes obsolete reboot scheduler, timesyncd restart, and reboot counter services |
| lib/rdk/rebootSTB.sh (deleted) | Removes scheduled reboot script (functionality moved elsewhere) |
| lib/rdk/updateGlobalIPInfo.sh (deleted) | Functionality refactored into NM_Dispatcher.sh and NM_preDown.sh |
| lib/rdk/connectivitycheck.sh (deleted) | Removes standalone connectivity check (replaced by NetworkManager-based approach) |
| systemd_units/*-upload.service | Updates network dependency from network-up.target to network-online.target |
| lib/rdk/uploadSTBLogs.sh | Defaults to MTLS and removes conditional xPKI logic |
| lib/rdk/NM_Bootstrap.sh | Adds WiFi migration support and NetworkManager configuration handling |
| lib/rdk/NM_Dispatcher.sh | Refactors global IP info handling and removes redundant connectivity checks |
| lib/rdk/system_info_collector.sh | Adds swap memory metrics collection and logging |
| lib/rdk/Start_MaintenanceTasks.sh | Implements logupload binary execution with fallback to script |
| lib/rdk/rebootNow.sh | Changes reboot to background execution with improved failure handling |
| .github/workflows/*.yml | Updates workflow configurations for CLA and FOSSID scanning |
| CHANGELOG.md | Documents all changes from versions 3.0.5 through 4.2.2 |
Comments suppressed due to low confidence (1)
lib/rdk/NM_Bootstrap.sh:36
- The script uses bash-specific regex matching syntax (=~) and BASH_REMATCH array, but the shebang is #!/bin/sh, not #!/bin/bash. This will fail on systems where /bin/sh is not bash. Either change the shebang to #!/bin/bash or rewrite the regex matching using POSIX-compliant methods such as grep or sed.
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.
| if [ "x$cmd" == "xdelete" ] && [ "x$flags" == "xglobal" ]; then | ||
| if ! check_valid_IPaddress "$mode" "$addr"; then | ||
| return | ||
| fi | ||
|
|
||
| if [[ "$ifc" == "$ESTB_INTERFACE" || "$ifc" == "$DEFAULT_ESTB_INTERFACE" || "$ifc" == "$ESTB_INTERFACE:0" ]]; then | ||
| NMdispatcherLog "Updating Box/ESTB IP" | ||
| rm -f /tmp/.$mode$ESTB_INTERFACE | ||
| refresh_devicedetails "estb_ip" | ||
| elif [[ "$ifc" == "$MOCA_INTERFACE" || "$ifc" == "$MOCA_INTERFACE:0" ]]; then | ||
| NMdispatcherLog "Updating MoCA IP" | ||
| rm -f /tmp/.$mode$MOCA_INTERFACE | ||
| refresh_devicedetails "moca_ip" | ||
| elif [[ "$ifc" == "$WIFI_INTERFACE" || "$ifc" == "$WIFI_INTERFACE:0" ]]; then |
Copilot
AI
Jan 28, 2026
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Inconsistent comparison operator usage. Lines 82, 87, 91, 95 use "==" for string comparison, which is bash-specific. Since the script uses "#!/bin/sh" shebang (line 1), it should use POSIX-compliant "=" for string comparisons. Note that lines 57, 63, and 65 already use "=" correctly.
| if [ "x$cmd" == "xdelete" ] && [ "x$flags" == "xglobal" ]; then | |
| if ! check_valid_IPaddress "$mode" "$addr"; then | |
| return | |
| fi | |
| if [[ "$ifc" == "$ESTB_INTERFACE" || "$ifc" == "$DEFAULT_ESTB_INTERFACE" || "$ifc" == "$ESTB_INTERFACE:0" ]]; then | |
| NMdispatcherLog "Updating Box/ESTB IP" | |
| rm -f /tmp/.$mode$ESTB_INTERFACE | |
| refresh_devicedetails "estb_ip" | |
| elif [[ "$ifc" == "$MOCA_INTERFACE" || "$ifc" == "$MOCA_INTERFACE:0" ]]; then | |
| NMdispatcherLog "Updating MoCA IP" | |
| rm -f /tmp/.$mode$MOCA_INTERFACE | |
| refresh_devicedetails "moca_ip" | |
| elif [[ "$ifc" == "$WIFI_INTERFACE" || "$ifc" == "$WIFI_INTERFACE:0" ]]; then | |
| if [ "x$cmd" = "xdelete" ] && [ "x$flags" = "xglobal" ]; then | |
| if ! check_valid_IPaddress "$mode" "$addr"; then | |
| return | |
| fi | |
| if [ "$ifc" = "$ESTB_INTERFACE" ] || [ "$ifc" = "$DEFAULT_ESTB_INTERFACE" ] || [ "$ifc" = "$ESTB_INTERFACE:0" ]; then | |
| NMdispatcherLog "Updating Box/ESTB IP" | |
| rm -f /tmp/.$mode$ESTB_INTERFACE | |
| refresh_devicedetails "estb_ip" | |
| elif [ "$ifc" = "$MOCA_INTERFACE" ] || [ "$ifc" = "$MOCA_INTERFACE:0" ]; then | |
| NMdispatcherLog "Updating MoCA IP" | |
| rm -f /tmp/.$mode$MOCA_INTERFACE | |
| refresh_devicedetails "moca_ip" | |
| elif [ "$ifc" = "$WIFI_INTERFACE" ] || [ "$ifc" = "$WIFI_INTERFACE:0" ]; then |
| sync | ||
| rebootLog "End of the sync" | ||
|
|
||
| rebootLog "Creating $REBOOTNOW_FLAG as the reboot was triggred by RDK software" |
Copilot
AI
Jan 28, 2026
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Typo in log message: "triggred" should be "triggered".
| rebootLog "Creating $REBOOTNOW_FLAG as the reboot was triggred by RDK software" | |
| rebootLog "Creating $REBOOTNOW_FLAG as the reboot was triggered by RDK software" |
| 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 |
Copilot
AI
Jan 28, 2026
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Inconsistent comparison operator usage in shell scripts. NM_Dispatcher.sh uses "==" (bash-style) on lines 60-61, 64-67, while NM_preDown.sh uses "=" (POSIX-compliant) on lines 57, 63. For maximum portability, it's recommended to use "=" for string comparison in shell scripts, especially since the shebang is "#!/bin/sh" (not bash).
| cp /opt/NetworkManager/system-connections/* /opt/secure/NetworkManager/system-connections/ | ||
| rm -rf /opt/NetworkManager/system-connections/* |
Copilot
AI
Jan 28, 2026
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The cp command will fail if /opt/NetworkManager/system-connections/ is empty (no files to copy). Consider adding a check or using a glob pattern like: if [ -n "$(ls -A /opt/NetworkManager/system-connections/ 2>/dev/null)" ]; then cp /opt/NetworkManager/system-connections/* /opt/secure/NetworkManager/system-connections/; fi
| cp /opt/NetworkManager/system-connections/* /opt/secure/NetworkManager/system-connections/ | |
| rm -rf /opt/NetworkManager/system-connections/* | |
| if [ -n "$(ls -A /opt/NetworkManager/system-connections 2>/dev/null)" ]; then | |
| cp /opt/NetworkManager/system-connections/* /opt/secure/NetworkManager/system-connections/ | |
| rm -rf /opt/NetworkManager/system-connections/* | |
| 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 |
Copilot
AI
Jan 28, 2026
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Inconsistent error output redirection. Line 193 uses "2>&1" (redirect stderr to stdout), while line 188 uses "2>/dev/null" (discard stderr). For consistency and to help with debugging, consider using the same redirection pattern for both the binary fallback case and the direct script execution case.
| fi | ||
|
|
||
|
|
||
| if [ "$BOOT_TYPE" == "BOOT_MIGRATION" ]; then |
Copilot
AI
Jan 28, 2026
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The comparison operators "==" used on lines 46 and 82 are bash-specific. Since the shebang is #!/bin/sh, use the POSIX-compliant "=" operator instead. Change to: if [ "$BOOT_TYPE" = "BOOT_MIGRATION" ]; then
| if [ "$BOOT_TYPE" == "BOOT_MIGRATION" ]; then | |
| if [ "$BOOT_TYPE" = "BOOT_MIGRATION" ]; then |
| fi | ||
| fi | ||
|
|
||
| if [ -z $SSID ]; then |
Copilot
AI
Jan 28, 2026
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The variable $SSID should be quoted in the test condition to handle cases where SSID is unset or contains spaces. Without quotes, if SSID is unset, this will result in a syntax error. Change to: if [ -z "$SSID" ]; then
| if [ -d /opt/secure/NetworkManager/system-connections ]; then | ||
| rm -rf /opt/secure/NetworkManager/system-connections/* | ||
| fi | ||
| if [ -z $PSK ]; then |
Copilot
AI
Jan 28, 2026
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The variable $PSK should be quoted in the test condition to handle cases where PSK is unset or contains spaces. Without quotes, if PSK is unset, this will result in a syntax error. Change to: if [ -z "$PSK" ]; then
| if [ -z $PSK ]; then | |
| if [ -z "$PSK" ]; then |
| # NTP URL from the property file | ||
| get_ntp_hosts | ||
| sleep 5 | ||
| echo "Attempt $attempts - Failed to retrieve NTP server URL, attempting again..." |
Copilot
AI
Jan 28, 2026
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The echo statement outputs to stdout instead of being redirected to the log file. This should be: echo "Attempt $attempts - Failed to retrieve NTP server URL, attempting again..." >> $LOG_FILE or use ntpLog function for consistent logging.
| echo "Attempt $attempts - Failed to retrieve NTP server URL, attempting again..." | |
| ntpLog "Attempt $attempts - Failed to retrieve NTP server URL, attempting again..." |
| ############################################################################## | ||
|
|
||
| WIFI_WPA_SUPPLICANT_CONF="/opt/secure/wifi/wpa_supplicant.conf" | ||
| BOOT_TYPE=$(grep "BOOT_TYPE" /tmp/bootType | cut -d '=' -f 2) |
Copilot
AI
Jan 28, 2026
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The grep command reading BOOT_TYPE from /tmp/bootType should handle the case where the file doesn't exist. If /tmp/bootType doesn't exist, this will cause an error message. Consider adding a check: if [ -f /tmp/bootType ]; then BOOT_TYPE=$(grep "BOOT_TYPE" /tmp/bootType | cut -d '=' -f 2); fi
| BOOT_TYPE=$(grep "BOOT_TYPE" /tmp/bootType | cut -d '=' -f 2) | |
| if [ -f /tmp/bootType ]; then | |
| BOOT_TYPE=$(grep "BOOT_TYPE" /tmp/bootType | cut -d '=' -f 2) | |
| else | |
| BOOT_TYPE="" | |
| fi |
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
No description provided.