summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMateusz Moscicki <m.moscicki2@partner.samsung.com>2022-06-10 15:41:29 +0200
committerMateusz Moscicki <m.moscicki2@partner.samsung.com>2022-06-10 15:41:29 +0200
commit3690631eb03767ce221ca0b60cd78ae43967f832 (patch)
tree56d4fbb26fb2612a6746ba5006b52a0e043ee2e2
parentcac3e4c2ac5581a4317adf1ca7e829bb308679d3 (diff)
parentc8cd987776603aa66e52823830eba423619f2544 (diff)
downloadlibtota-accepted/tizen_6.5_unified.tar.gz
libtota-accepted/tizen_6.5_unified.tar.bz2
libtota-accepted/tizen_6.5_unified.zip
Change-Id: I2d49b26fcb37fee5a6dd434fa59ab113cab3138e
-rwxr-xr-xss_engine/SS_PatchDelta.c10
-rwxr-xr-xss_engine/SS_UPI.c11
-rwxr-xr-xss_engine/ua_types.h11
3 files changed, 13 insertions, 19 deletions
diff --git a/ss_engine/SS_PatchDelta.c b/ss_engine/SS_PatchDelta.c
index 9f2d94c..dd292ee 100755
--- a/ss_engine/SS_PatchDelta.c
+++ b/ss_engine/SS_PatchDelta.c
@@ -940,15 +940,7 @@ int SS_UpdateDeltaIMG(ua_dataSS_t * ua_dataSS, int (*write_to_blkdev) (char *, i
}
//Considering EMMC partition by default
- if (ua_dataSS->update_cfg->update_type == DELTA_IMG) {
- blk_cnt = ((ua_dataSS->update_cfg->target_img_size - 1) / SECTOR_SIZE) + 1;
- result = write_to_blkdev((char *)ua_dataSS->parti_info->ua_blk_name, blk_start, blk_cnt, (char *)msi.buffer);
- if (result != S_SS_SUCCESS) {
- LOGE("write of patched data to %s failed\n", ua_dataSS->parti_info->ua_blk_name); // All returns should go to CLEAN UP.
- SS_SetUpgradeState(E_SS_IMGFLASHWRITEFAIL);
- goto Cleanup;
- }
- } else if (ua_dataSS->update_cfg->update_type == EXTRA && ua_dataSS->update_data->ua_temp_path) {
+ if (ua_dataSS->update_cfg->update_type == EXTRA && ua_dataSS->update_data->ua_temp_path) {
fd = open(ua_dataSS->update_data->ua_temp_path, O_WRONLY | O_CREAT | O_TRUNC, S_IRWXU);
if (fd < 0) {
strerror_r(errno, buf, sizeof(buf));
diff --git a/ss_engine/SS_UPI.c b/ss_engine/SS_UPI.c
index 4c6b19c..a7a4cac 100755
--- a/ss_engine/SS_UPI.c
+++ b/ss_engine/SS_UPI.c
@@ -2228,7 +2228,7 @@ int SS_IMGVerfiyPartition(ua_dataSS_t * ua_dataSS, const char *src_blk_name, boo
}
/*
- * If ab_update is set it means it is a DELTA_IMG_AB update, where the patch
+ * If ab_update is set it means it is a DELTA_IMAGE update, where the patch
* is applied to data directly read from a partition in the previous slot
*/
SS_CalculateFileSha(src_blk_name, ua_dataSS->update_cfg->soure_img_size, calculated_sha1);
@@ -2311,10 +2311,9 @@ int SS_IMGUpdatemain(ua_dataSS_t * ua_dataSS, int update_type) //SS_FSUpdatePar
if (ua_dataSS->ui_progress)
ua_dataSS->ui_progress(ua_dataSS, 40);
- if (update_type == FULL_IMG && ua_dataSS->update_data->ua_temp_path)
+ if (update_type == FULL_IMAGE && ua_dataSS->update_data->ua_temp_path)
ulResult = SS_MoveFile(SS_PATCHFILE_SOURCE, ua_dataSS->update_data->ua_temp_path);
- else if ((ua_dataSS->update_cfg->update_type == DELTA_IMG && ua_dataSS->write_data_to_blkdev)
- || ua_dataSS->update_cfg->update_type == EXTRA || ua_dataSS->update_cfg->update_type == DELTA_IMG_AB) {
+ else if (ua_dataSS->update_cfg->update_type == EXTRA || ua_dataSS->update_cfg->update_type == DELTA_IMAGE) {
FILE *fp = NULL;
char buf[14] = { 0, }; //to store zImage-delta magic keyword
@@ -2332,12 +2331,10 @@ int SS_IMGUpdatemain(ua_dataSS_t * ua_dataSS, int update_type) //SS_FSUpdatePar
LOGL(LOG_SSENGINE, "short read of \"%s\" (%ld bytes of %ld)\n", SS_PATCHFILE_SOURCE, (long)bytes_read, (long)13);
fclose(fp);
- if (update_type == DELTA_IMG_AB)
+ if (update_type == DELTA_IMAGE)
ulResult = SS_UpdateDeltaIMGAB(ua_dataSS);
else if (strncmp(buf, SS_KERNEL_MAGIC, sizeof(buf) / sizeof(char)) == 0)
ulResult = SS_UpdateDeltaKernel(ua_dataSS, ua_dataSS->write_data_to_blkdev);
- else
- ulResult = SS_UpdateDeltaIMG(ua_dataSS, ua_dataSS->write_data_to_blkdev);
} else {
LOGE("Update type is INVALID - Exit \n");
ulResult = E_SS_FAILURE;
diff --git a/ss_engine/ua_types.h b/ss_engine/ua_types.h
index 859f49d..cb53ca7 100755
--- a/ss_engine/ua_types.h
+++ b/ss_engine/ua_types.h
@@ -34,14 +34,18 @@
#define UI_OP_UPDATE 3
typedef enum {
- FULL_IMG,
- DELTA_IMG,
- DELTA_IMG_AB,
+ FULL_IMAGE,
+ DELTA_IMAGE,
DELTA_FS,
EXTRA
} UA_DATA_FORMAT;
typedef enum {
+ BEFORE_BOOT_FOTA,
+ AT_BOOT_FOTA
+} UPDATE_WHEN;
+
+typedef enum {
UA_MODE_SCOUT_UPDATE,
UA_MODE_SCOUT,
UA_MODE_VERIFYTARGET,
@@ -62,6 +66,7 @@ typedef struct _ua_update_data_t {
typedef struct _ua_update_cfg_t {
unsigned int update_type;
+ unsigned int update_when;
int skip_verify;
int skip_update;
int soure_img_size; //TOTA