mmcbootpart=1
mmcrootdev=0
mmcrootpart=2
-mmcusrpart=5
+mmcinformpart=9
dummy=0x24000000
-fotaname=fota
+rebootparamfile=reboot-param.bin
+# use the ram address of ramdisk before loading ramdisk image
+rebootparam_addr=0x3a62b000
+# 0x72677075 is ascii code for representing string "upgr"
+upgrade_val=72677075
+# 0x6d726f6e is ascii code for representing string "norm"
+normal_val=6d726f6e
ramdisksize=800000
# Device that included the image.
bootdev=mmc
-if test -e $bootdev $mmcbootdev:$mmcusrpart $fotaname; then;
-ramdiskpart=8
-bootmode=fota
+if test -e $bootdev $mmcbootdev:$mmcinformpart $rebootparamfile; then;
+ ext4load $bootdev $mmcbootdev:$mmcinformpart $rebootparam_addr $rebootparamfile;
+ if itest.l *${rebootparam_addr} == ${upgrade_val}; then;
+ ramdiskpart=8
+ bootmode=upgrade
+ elif itest.l *${rebootparam_addr} == ${normal_val}; then;
+ ramdiskpart=7
+ bootmode=ramdisk
+ else
+ echo "This reboot parameter is not supported...";
+ ramdiskpart=7
+ bootmode=ramdisk
+ fi
else
-ramdiskpart=7
-bootmode=ramdisk
+ ramdiskpart=7
+ bootmode=ramdisk
fi
# boot from ram0 if there is sbin