-
Notifications
You must be signed in to change notification settings - Fork 41
RDKB-63406:Devicetype RFC default value is not migrating after software upgrade #212
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: develop
Are you sure you want to change the base?
Changes from all commits
4b02e64
e941e3b
4b79d77
b81534d
241b9eb
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| 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
|
||||||||||||||||||||||||||||||||||||||||||
| ########################################################################## | ||||||||||||||||||||||||||||||||||||||||||
| # If not stated otherwise in this file or this component's Licenses.txt | ||||||||||||||||||||||||||||||||||||||||||
| # file the following copyright and licenses apply: | ||||||||||||||||||||||||||||||||||||||||||
|
|
@@ -204,6 +204,23 @@ | |||||||||||||||||||||||||||||||||||||||||
| syscfg commit | ||||||||||||||||||||||||||||||||||||||||||
| fi | ||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||
| #Change devicetype on firmware udgrade | ||||||||||||||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||||||||||||||
| #Change devicetype on firmware udgrade | |
| #Change devicetype on firmware upgrade |
Copilot
AI
Feb 12, 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.
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.
| echo "$DEVICETYPE_MIGRATE" |
Copilot
AI
Feb 12, 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.
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
AI
Feb 9, 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.
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
AI
Feb 12, 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.
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.
| 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 |
| Original file line number | Diff line number | Diff line change | ||||||||||||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -409,6 +409,23 @@ else | |||||||||||||||||||||||||||||||||||||||||
| echo "SSH: Forward SSH changed to disabled" >> $Log_file | ||||||||||||||||||||||||||||||||||||||||||
| fi | ||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||
| #Change devicetype on firmware udgrade | ||||||||||||||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||||||||||||||
| #Change devicetype on firmware udgrade | |
| # Change device type on firmware upgrade |
Copilot
AI
Feb 12, 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 comment: "udgrade" should be "upgrade".
| #Change devicetype on firmware udgrade | |
| #Change devicetype on firmware upgrade |
Copilot
AI
Feb 12, 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.
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.
| echo "$DEVICETYPE_MIGRATE" |
Copilot
AI
Feb 12, 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.
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
AI
Feb 9, 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.
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
AI
Feb 12, 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.
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.
| 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 |
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.
Fix typos in the new migration header comment (e.g., "udgrade" -> "upgrade" and consider "device type" for readability).