Skip to content

WNCXIONE-530: Fixed changes for migration. - #352

Merged
nhanasi merged 1 commit into
support/3.0.5from
feature/WNCXIONE-530-8.3
Oct 29, 2025
Merged

WNCXIONE-530: Fixed changes for migration.#352
nhanasi merged 1 commit into
support/3.0.5from
feature/WNCXIONE-530-8.3

Conversation

@bpunnuru

Copy link
Copy Markdown
Contributor

No description provided.

Signed-off-by: Balaji Punnuru <Balaji_Punnuru@comcast.com>
@bpunnuru
bpunnuru requested a review from a team as a code owner October 29, 2025 16:01
Copilot AI review requested due to automatic review settings October 29, 2025 16:01
@CLAassistant

Copy link
Copy Markdown

CLA assistant check
Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you sign our Contributor License Agreement before we can accept your contribution.


Balaji Punnuru seems not to be a GitHub user. You need a GitHub account to be able to sign the CLA. If you have already a GitHub account, please add the email address used for this commit to your account.
You have signed the CLA already but the status is still pending? Let us recheck it.

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 refactors the NM_Bootstrap.sh script to improve WiFi connection management by detecting RDK profile and handling cases where no SSID is configured. Key changes include:

  • Renaming the WiFi supplicant configuration variable and introducing RDK profile detection
  • Removing a debug log line
  • Adding fallback logic to handle missing SSID by copying previously configured network settings and setting up new WiFi connections using nmcli

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

Comment thread lib/rdk/NM_Bootstrap.sh
rm -rf /opt/NetworkManager/system-connections/*
fi
if [ "$RDK_PROFILE" == "TV" ]; then
echo "`/bin/timestamp` :$0: Migrating Wifi credentials for TVs from NM_Bootsrtap" >> /opt/logs/NMMonitor.log

Copilot AI Oct 29, 2025

Copy link

Choose a reason for hiding this comment

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

Corrected spelling of 'NM_Bootsrtap' to 'NM_Bootstrap'.

Suggested change
echo "`/bin/timestamp` :$0: Migrating Wifi credentials for TVs from NM_Bootsrtap" >> /opt/logs/NMMonitor.log
echo "`/bin/timestamp` :$0: Migrating Wifi credentials for TVs from NM_Bootstrap" >> /opt/logs/NMMonitor.log

Copilot uses AI. Check for mistakes.
Comment thread lib/rdk/NM_Bootstrap.sh
SSID=$(cat $WIFI_WPA_SUPPLICANT_CONF | grep -w ssid= | cut -d '"' -f 2)
PSK_LINE=$(grep psk= "$WIFI_WPA_SUPPLICANT_CONF")

if [ -f $RDKV_SUPP_CONF ]; then

Copilot AI Oct 29, 2025

Copy link

Choose a reason for hiding this comment

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

Variable $RDKV_SUPP_CONF should be quoted to prevent word splitting and glob expansion. Use "$RDKV_SUPP_CONF" instead.

Suggested change
if [ -f $RDKV_SUPP_CONF ]; then
if [ -f "$RDKV_SUPP_CONF" ]; then

Copilot uses AI. Check for mistakes.
Comment thread lib/rdk/NM_Bootstrap.sh
sed -i '/network={/,/}/d' /opt/secure/wifi/wpa_supplicant.conf
fi

if [ -z $SSID ]; then

Copilot AI Oct 29, 2025

Copy link

Choose a reason for hiding this comment

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

Variable $SSID should be quoted to prevent word splitting and handle empty/unset values correctly. Use "$SSID" instead.

Suggested change
if [ -z $SSID ]; then
if [ -z "$SSID" ]; then

Copilot uses AI. Check for mistakes.
Comment thread lib/rdk/NM_Bootstrap.sh
if [ "$RDK_PROFILE" == "TV" ]; then
echo "`/bin/timestamp` :$0: Migrating Wifi credentials for TVs from NM_Bootsrtap" >> /opt/logs/NMMonitor.log
fi
if [ -z $PSK ]; then

Copilot AI Oct 29, 2025

Copy link

Choose a reason for hiding this comment

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

Variable $PSK should be quoted to prevent word splitting and handle empty/unset values correctly. Use "$PSK" instead.

Suggested change
if [ -z $PSK ]; then
if [ -z "$PSK" ]; then

Copilot uses AI. Check for mistakes.
Comment thread lib/rdk/NM_Bootstrap.sh
mkdir -p /opt/secure/NetworkManager/system-connections
fi
if [ -d /opt/NetworkManager/system-connections ]; then
cp /opt/NetworkManager/system-connections/* /opt/secure/NetworkManager/system-connections/

Copilot AI Oct 29, 2025

Copy link

Choose a reason for hiding this comment

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

This command will fail if the source directory is empty because the wildcard won't expand. Add a check for files or use a safer pattern like 'cp -r /opt/NetworkManager/system-connections/. /opt/secure/NetworkManager/system-connections/' with proper error handling.

Suggested change
cp /opt/NetworkManager/system-connections/* /opt/secure/NetworkManager/system-connections/
cp -r /opt/NetworkManager/system-connections/. /opt/secure/NetworkManager/system-connections/ || echo "`/bin/timestamp` :$0: Failed to copy system-connections" >> /opt/logs/NMMonitor.log

Copilot uses AI. Check for mistakes.
@nhanasi
nhanasi merged commit c621c04 into support/3.0.5 Oct 29, 2025
9 of 10 checks passed
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.

4 participants