Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 17 additions & 0 deletions source/scripts/init/system/utopia_init.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/bin/sh

Check failure on line 1 in source/scripts/init/system/utopia_init.sh

View workflow job for this annotation

GitHub Actions / call-fossid-workflow / Fossid Annotate PR

FossID License Issue Detected

Source code with 'BSD-3-Clause' license found in local file 'source/scripts/init/system/utopia_init.sh' (Match: rdkb/components/opensource/ccsp/Utopia/rdkb/components/opensource/ccsp/Utopia/1908, 753 lines, url: https://code.rdkcentral.com/r/plugins/gitiles/rdkb/components/opensource/ccsp/Utopia/+archive/rdk-dev-1908.tar.gz, file: source/scripts/init/system/utopia_init.sh)

Check failure on line 1 in source/scripts/init/system/utopia_init.sh

View workflow job for this annotation

GitHub Actions / call-fossid-workflow / Fossid Annotate PR

FossID License Issue Detected

Source code with 'BSD-Intel' license found in local file 'source/scripts/init/system/utopia_init.sh' (Match: rdkb/components/opensource/ccsp/Utopia/rdkb/components/opensource/ccsp/Utopia/20200713-rdk-dev, 829 lines, url: https://code.rdkcentral.com/r/plugins/gitiles/rdkb/components/opensource/ccsp/Utopia/+archive/nightly/20200713-rdk-dev.tar.gz, file: source/scripts/init/system/utopia_init.sh)

Check failure on line 1 in source/scripts/init/system/utopia_init.sh

View workflow job for this annotation

GitHub Actions / call-fossid-workflow / Fossid Annotate PR

FossID License Issue Detected

Source code with 'BSD-Intel' license found in local file 'source/scripts/init/system/utopia_init.sh' (Match: rdkb/components/opensource/ccsp/Utopia/rdkb/components/opensource/ccsp/Utopia/2101, 835 lines, url: https://code.rdkcentral.com/r/plugins/gitiles/rdkb/components/opensource/ccsp/Utopia/+archive/rdk-dev-2101.tar.gz, file: source/scripts/init/system/utopia_init.sh)
##########################################################################
# If not stated otherwise in this file or this component's Licenses.txt
# file the following copyright and licenses apply:
Expand Down Expand Up @@ -262,6 +262,23 @@
syscfg commit
fi

#Change devicetype on firmware udgrade
DEVICETYPE_MIGRATE="$(syscfg get devicetype_migrate)"
echo "$DEVICETYPE_MIGRATE"
if [ -z "$DEVICETYPE_MIGRATE" ]; then
CURRENT_DEVICETYPE="$(syscfg get DeviceType)"
echo "[utopia] Devicetype is $CURRENT_DEVICETYPE"
if [ "$CURRENT_DEVICETYPE" != "PROD" ]; then
echo "setting DeviceType to PROD"
syscfg set DeviceType "PROD"
syscfg commit
else
echo "DeviceType is already PROD, no change needed"
fi
syscfg set devicetype_migrate "1"
syscfg commit
fi

if [ -f $SYSCFG_OLDBKUP_FILE ];then
rm -rf $SYSCFG_OLDBKUP_FILE
fi
Expand Down
17 changes: 17 additions & 0 deletions source/scripts/init/system/utopia_init_hub4.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/bin/sh

Check failure on line 1 in source/scripts/init/system/utopia_init_hub4.sh

View workflow job for this annotation

GitHub Actions / call-fossid-workflow / Fossid Annotate PR

FossID License Issue Detected

Source code with 'BSD-Intel' license found in local file 'source/scripts/init/system/utopia_init_hub4.sh' (Match: rdkb/components/opensource/ccsp/Utopia/rdkb/components/opensource/ccsp/Utopia/1, 705 lines, url: https://code.rdkcentral.com/r/plugins/gitiles/rdkb/components/opensource/ccsp/Utopia/+archive/RDKB-RELEASE-TEST-DUNFELL-1.tar.gz, file: source/scripts/init/system/utopia_init_hub4.sh)

Check failure on line 1 in source/scripts/init/system/utopia_init_hub4.sh

View workflow job for this annotation

GitHub Actions / call-fossid-workflow / Fossid Annotate PR

FossID License Issue Detected

Source code with 'BSD-Intel' license found in local file 'source/scripts/init/system/utopia_init_hub4.sh' (Match: rdkb/components/opensource/ccsp/Utopia/rdkb/components/opensource/ccsp/Utopia/20200713-rdk-dev, 705 lines, url: https://code.rdkcentral.com/r/plugins/gitiles/rdkb/components/opensource/ccsp/Utopia/+archive/nightly/20200713-rdk-dev.tar.gz, file: source/scripts/init/system/utopia_init_hub4.sh)

Check failure on line 1 in source/scripts/init/system/utopia_init_hub4.sh

View workflow job for this annotation

GitHub Actions / call-fossid-workflow / Fossid Annotate PR

FossID License Issue Detected

Source code with 'BSD-Intel' license found in local file 'source/scripts/init/system/utopia_init_hub4.sh' (Match: rdkb/components/opensource/ccsp/Utopia/rdkb/components/opensource/ccsp/Utopia/2, 705 lines, url: https://code.rdkcentral.com/r/plugins/gitiles/rdkb/components/opensource/ccsp/Utopia/+archive/RDKB-RELEASE-TEST-DUNFELL-2.tar.gz, file: source/scripts/init/system/utopia_init_hub4.sh)
##########################################################################
# If not stated otherwise in this file or this component's Licenses.txt
# file the following copyright and licenses apply:
Expand Down Expand Up @@ -204,6 +204,23 @@
syscfg commit
fi

#Change devicetype on firmware udgrade
Copy link

Copilot AI Feb 9, 2026

Choose a reason for hiding this comment

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

Fix typos in the new migration header comment (e.g., "udgrade" -> "upgrade" and consider "device type" for readability).

Suggested change
#Change devicetype on firmware udgrade
# Change device type on firmware upgrade

Copilot uses AI. Check for mistakes.
Copy link

Copilot AI Feb 12, 2026

Choose a reason for hiding this comment

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

Typo in comment: "udgrade" should be "upgrade".

Suggested change
#Change devicetype on firmware udgrade
#Change devicetype on firmware upgrade

Copilot uses AI. Check for mistakes.
DEVICETYPE_MIGRATE="$(syscfg get devicetype_migrate)"
echo "$DEVICETYPE_MIGRATE"
Copy link

Copilot AI Feb 12, 2026

Choose a reason for hiding this comment

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

echo "$DEVICETYPE_MIGRATE" looks like leftover debug output and will print an empty line (or "1") to the console/log on every boot. Consider removing it or replacing it with a prefixed message that only logs when a migration is performed.

Suggested change
echo "$DEVICETYPE_MIGRATE"

Copilot uses AI. Check for mistakes.
if [ -z "$DEVICETYPE_MIGRATE" ]; then
CURRENT_DEVICETYPE="$(syscfg get DeviceType)"
echo "[utopia] Devicetype is $CURRENT_DEVICETYPE"
if [ "$CURRENT_DEVICETYPE" != "PROD" ]; then
echo "setting DeviceType to PROD"
syscfg set DeviceType "PROD"
Comment on lines +212 to +215
Copy link

Copilot AI Feb 12, 2026

Choose a reason for hiding this comment

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

Logging tag/format is inconsistent with the rest of this script (nearby messages use "[utopia][init]"), but this block uses "[utopia]" and unprefixed echos. Please align the log prefix/format so migration logs are searchable and consistent.

Copilot uses AI. Check for mistakes.
syscfg commit
else
echo "DeviceType is already PROD, no change needed"
fi
syscfg set devicetype_migrate "1"
syscfg commit
Comment on lines +214 to +221
Copy link

Copilot AI Feb 9, 2026

Choose a reason for hiding this comment

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

syscfg commit is called twice in this migration path (once after setting DeviceType and again after setting devicetype_migrate). Consider setting both keys first and committing once to reduce persistent storage writes during boot.

Copilot uses AI. Check for mistakes.
Comment on lines +215 to +221
Copy link

Copilot AI Feb 12, 2026

Choose a reason for hiding this comment

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

devicetype_migrate is set unconditionally after the DeviceType update attempt. If syscfg set/commit for DeviceType fails, the migrate flag will still be written and the script won’t retry on the next boot. Consider setting both keys and doing a single syscfg commit, and only marking devicetype_migrate=1 after confirming the DeviceType change (and commit) succeeded.

Suggested change
syscfg set DeviceType "PROD"
syscfg commit
else
echo "DeviceType is already PROD, no change needed"
fi
syscfg set devicetype_migrate "1"
syscfg commit
if syscfg set DeviceType "PROD" && syscfg set devicetype_migrate "1" && syscfg commit; then
echo "DeviceType updated to PROD and devicetype_migrate set"
else
echo "Failed to update DeviceType to PROD; devicetype_migrate not set" >&2
fi
else
echo "DeviceType is already PROD, no change needed"
if syscfg set devicetype_migrate "1" && syscfg commit; then
echo "devicetype_migrate set for existing PROD DeviceType"
else
echo "Failed to set devicetype_migrate for existing PROD DeviceType" >&2
fi
fi

Copilot uses AI. Check for mistakes.
fi

#Hard Factory reset from mount-fs.sh
if [ `cat /data/HFRES_UTOPIA` -eq 1 ]; then
syscfg set $FACTORY_RESET_KEY $FACTORY_RESET_RGWIFI
Expand Down
17 changes: 17 additions & 0 deletions source/scripts/init/system/utopia_init_xb6.sh
Original file line number Diff line number Diff line change
Expand Up @@ -409,6 +409,23 @@ else
echo "SSH: Forward SSH changed to disabled" >> $Log_file
fi

#Change devicetype on firmware udgrade
Copy link

Copilot AI Feb 9, 2026

Choose a reason for hiding this comment

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

Fix typos in the new migration header comment (e.g., "udgrade" -> "upgrade" and consider "device type" for readability).

Suggested change
#Change devicetype on firmware udgrade
# Change device type on firmware upgrade

Copilot uses AI. Check for mistakes.
Copy link

Copilot AI Feb 12, 2026

Choose a reason for hiding this comment

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

Typo in comment: "udgrade" should be "upgrade".

Suggested change
#Change devicetype on firmware udgrade
#Change devicetype on firmware upgrade

Copilot uses AI. Check for mistakes.
DEVICETYPE_MIGRATE="$(syscfg get devicetype_migrate)"
echo "$DEVICETYPE_MIGRATE"
Copy link

Copilot AI Feb 12, 2026

Choose a reason for hiding this comment

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

echo "$DEVICETYPE_MIGRATE" looks like leftover debug output and will print an empty line (or "1") to the console/log on every boot. Consider removing it or replacing it with a prefixed message that only logs when a migration is performed.

Suggested change
echo "$DEVICETYPE_MIGRATE"

Copilot uses AI. Check for mistakes.
if [ -z "$DEVICETYPE_MIGRATE" ]; then
CURRENT_DEVICETYPE="$(syscfg get DeviceType)"
echo "[Utopia] Devicetype is $CURRENT_DEVICETYPE"
if [ "$CURRENT_DEVICETYPE" != "PROD" ]; then
echo "setting DeviceType to PROD"
syscfg set DeviceType "PROD"
Comment on lines +417 to +420
Copy link

Copilot AI Feb 12, 2026

Choose a reason for hiding this comment

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

Logging tag is inconsistent with the rest of this script (nearby messages use "[utopia][init]"), but this block uses "[Utopia]" and unprefixed echos. Please align the log prefix/format so migration logs are searchable and consistent.

Copilot uses AI. Check for mistakes.
syscfg commit
else
echo "DeviceType is already PROD, no change needed"
fi
syscfg set devicetype_migrate "1"
syscfg commit
Comment on lines +419 to +426
Copy link

Copilot AI Feb 9, 2026

Choose a reason for hiding this comment

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

syscfg commit is called twice in this migration path (once after setting DeviceType and again after setting devicetype_migrate). To reduce flash/NVRAM writes, set both keys first and commit once at the end of the block.

Copilot uses AI. Check for mistakes.
Comment on lines +420 to +426
Copy link

Copilot AI Feb 12, 2026

Choose a reason for hiding this comment

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

devicetype_migrate is set unconditionally after the DeviceType update attempt. If syscfg set/commit for DeviceType fails for any reason, the migrate flag will still be written and the script won’t retry on the next boot. Consider setting both keys and doing a single syscfg commit, and only marking devicetype_migrate=1 after confirming the DeviceType change (and commit) succeeded.

Suggested change
syscfg set DeviceType "PROD"
syscfg commit
else
echo "DeviceType is already PROD, no change needed"
fi
syscfg set devicetype_migrate "1"
syscfg commit
if syscfg set DeviceType "PROD" && syscfg set devicetype_migrate "1" && syscfg commit; then
echo "DeviceType successfully migrated to PROD and devicetype_migrate marked"
else
echo "Failed to migrate DeviceType to PROD; devicetype_migrate not marked (will retry on next boot)"
fi
else
echo "DeviceType is already PROD, no change needed"
if syscfg set devicetype_migrate "1" && syscfg commit; then
echo "devicetype_migrate successfully marked with existing PROD DeviceType"
else
echo "Failed to mark devicetype_migrate with existing PROD DeviceType (will retry on next boot)"
fi
fi

Copilot uses AI. Check for mistakes.
fi

#IGMP PROXY Disbaling on migration
IGMP_MIGRATE="`syscfg get igmp_migrate`"
if [ -z "$IGMP_MIGRATE" ]; then
Expand Down
Loading