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
15 changes: 15 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, 751 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, 827 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, 833 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,21 @@
syscfg commit
fi

#Change devicetype on firmware udgrade
Copy link

Copilot AI Feb 13, 2026

Choose a reason for hiding this comment

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

The comment contains a spelling error: "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)"
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"
Copy link

Copilot AI Feb 13, 2026

Choose a reason for hiding this comment

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

Missing syscfg commit after setting DeviceType to PROD. The pattern in this file (lines 434-436) shows that syscfg set operations should be followed by syscfg commit. Without the commit here, the DeviceType change may not be persisted. Add a syscfg commit after line 272.

Suggested change
syscfg set DeviceType "PROD"
syscfg set DeviceType "PROD"
syscfg commit

Copilot uses AI. Check for mistakes.
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
15 changes: 15 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, 703 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, 703 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, 703 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,21 @@
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)"
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 +211 to +214
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.
else
echo "DeviceType is already PROD, no change needed"
fi
syscfg set devicetype_migrate "1"
syscfg commit
Comment on lines 213 to 219
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 214 to 219
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
15 changes: 15 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,21 @@ 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)"
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 +416 to +419
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.
else
echo "DeviceType is already PROD, no change needed"
fi
syscfg set devicetype_migrate "1"
syscfg commit
Comment on lines 418 to 424
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 419 to 424
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