Skip to content

Commit a005b5a

Browse files
NareshM1702Copilotnm296
authored
RDKB-63406:Devicetype RFC default value is not migrating after software upgrade (#212)
Reason for change:migrating devicetype RFC after firmware upgrade Test Procedure: build and flash the image verify the RFC is changing Risks:Medium Priority: P1 --------- Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> Co-authored-by: nm296 <nareshkumar_m@comcast.com>
1 parent 9e29e2d commit a005b5a

File tree

3 files changed

+60
-0
lines changed

3 files changed

+60
-0
lines changed

source/scripts/init/system/utopia_init.sh

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -262,6 +262,26 @@ if [ "$SYSCFG_LAN_DOMAIN" == "utopia.net" ]; then
262262
syscfg commit
263263
fi
264264

265+
#Change devicetype on firmware upgrade
266+
DEVICETYPE_MIGRATE="$(syscfg get devicetype_migrate)"
267+
if [ -z "$DEVICETYPE_MIGRATE" ]; then
268+
CURRENT_DEVICETYPE="$(syscfg get DeviceType)"
269+
echo_t "[utopia][init] Devicetype is $CURRENT_DEVICETYPE"
270+
# When DeviceType has never been set in syscfg, CURRENT_DEVICETYPE will be empty.
271+
# Explicitly migrate empty/unset or non-PROD DeviceType values to PROD.
272+
if [ -z "$CURRENT_DEVICETYPE" ]; then
273+
echo_t "[utopia][init] DeviceType is unset or empty, migrating to PROD"
274+
syscfg set DeviceType "PROD"
275+
elif [ "$CURRENT_DEVICETYPE" != "PROD" ]; then
276+
echo_t "[utopia][init] setting DeviceType to PROD"
277+
syscfg set DeviceType "PROD"
278+
else
279+
echo_t "[utopia][init] DeviceType is already PROD, no change needed"
280+
fi
281+
syscfg set devicetype_migrate "1"
282+
syscfg commit
283+
fi
284+
265285
if [ -f $SYSCFG_OLDBKUP_FILE ];then
266286
rm -rf $SYSCFG_OLDBKUP_FILE
267287
fi

source/scripts/init/system/utopia_init_hub4.sh

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -204,6 +204,26 @@ if [ "$SYSCFG_LAN_DOMAIN" == "utopia.net" ]; then
204204
syscfg commit
205205
fi
206206

207+
#Change devicetype on firmware upgrade
208+
DEVICETYPE_MIGRATE="$(syscfg get devicetype_migrate)"
209+
if [ -z "$DEVICETYPE_MIGRATE" ]; then
210+
CURRENT_DEVICETYPE="$(syscfg get DeviceType)"
211+
echo_t "[utopia][init] Devicetype is $CURRENT_DEVICETYPE"Expand commentComment on line R269Resolved
212+
# When DeviceType has never been set in syscfg, CURRENT_DEVICETYPE will be empty.
213+
# Explicitly migrate empty/unset or non-PROD DeviceType values to PROD.
214+
if [ -z "$CURRENT_DEVICETYPE" ]; then
215+
echo_t "[utopia][init] DeviceType is unset or empty, migrating to PROD"
216+
syscfg set DeviceType "PROD"
217+
elif [ "$CURRENT_DEVICETYPE" != "PROD" ]; then
218+
echo_t "[utopia][init] setting DeviceType to PROD"
219+
syscfg set DeviceType "PROD"
220+
else
221+
echo_t "[utopia][init] DeviceType is already PROD, no change needed"
222+
fi
223+
syscfg set devicetype_migrate "1"
224+
syscfg commit
225+
fi
226+
207227
#Hard Factory reset from mount-fs.sh
208228
if [ `cat /data/HFRES_UTOPIA` -eq 1 ]; then
209229
syscfg set $FACTORY_RESET_KEY $FACTORY_RESET_RGWIFI

source/scripts/init/system/utopia_init_xb6.sh

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -409,6 +409,26 @@ else
409409
echo "SSH: Forward SSH changed to disabled" >> $Log_file
410410
fi
411411

412+
#Change devicetype on firmware upgrade
413+
DEVICETYPE_MIGRATE="$(syscfg get devicetype_migrate)"
414+
if [ -z "$DEVICETYPE_MIGRATE" ]; then
415+
CURRENT_DEVICETYPE="$(syscfg get DeviceType)"
416+
echo_t "[utopia][init] Devicetype is $CURRENT_DEVICETYPE"Expand commentComment on line R269Resolved
417+
# When DeviceType has never been set in syscfg, CURRENT_DEVICETYPE will be empty.
418+
# Explicitly migrate empty/unset or non-PROD DeviceType values to PROD.
419+
if [ -z "$CURRENT_DEVICETYPE" ]; then
420+
echo_t "[utopia][init] DeviceType is unset or empty, migrating to PROD"
421+
syscfg set DeviceType "PROD"
422+
elif [ "$CURRENT_DEVICETYPE" != "PROD" ]; then
423+
echo_t "[utopia][init] setting DeviceType to PROD"
424+
syscfg set DeviceType "PROD"
425+
else
426+
echo_t "[utopia][init] DeviceType is already PROD, no change needed"
427+
fi
428+
syscfg set devicetype_migrate "1"
429+
syscfg commit
430+
fi
431+
412432
#IGMP PROXY Disbaling on migration
413433
IGMP_MIGRATE="`syscfg get igmp_migrate`"
414434
if [ -z "$IGMP_MIGRATE" ]; then

0 commit comments

Comments
 (0)