Revert "[Feature][ZXW-225] Remove synchronization function from lynq fota backup"
This reverts commit 73e6d19856eedd420d3468a2ca8f37359fc27ab1.
Reason for revert: <INSERT REASONING HERE>
Change-Id: Ie5e2adbe48341e8ab7e983605933ef106850542c
diff --git a/cap/zx297520v3/sources/meta-zxic-custom/recipes-lynq/lynq-fota-backup/files/lynq-fota-backup.cpp b/cap/zx297520v3/sources/meta-zxic-custom/recipes-lynq/lynq-fota-backup/files/lynq-fota-backup.cpp
index 2c4f1e0..84a727b 100755
--- a/cap/zx297520v3/sources/meta-zxic-custom/recipes-lynq/lynq-fota-backup/files/lynq-fota-backup.cpp
+++ b/cap/zx297520v3/sources/meta-zxic-custom/recipes-lynq/lynq-fota-backup/files/lynq-fota-backup.cpp
@@ -48,16 +48,21 @@
return -1;
}
-
- //read fota upgrade flag, 0 :upgrade failed, 1:upgrade success
+
fread(&sync_flag,sizeof(int),1,fp);
-
+
if(sync_flag == FOTA_SYNC_FLAG)
{
- printf("upgrade flag is success ");
- return 0;
+ ret = lynq_sync_system();
+ if(ret != 0)
+ {
+ printf("sync faild\n");
+ fclose(fp);
+ }
+ system("rm -rf /mnt/userdata/.back_up_flag");
+
}
- else if(sync_flag != FOTA_SYNC_FLAG)
+ else if(sync_flag != FOTA_SYNC_FLAG)
{
ret = lynq_fota_get_addr_value(tmp_addr);
if(ret != 0)
@@ -81,8 +86,7 @@
}
}
-
-
+
return 0;
}