diff options
author | Mateusz Moscicki <m.moscicki2@partner.samsung.com> | 2022-06-09 17:31:17 +0200 |
---|---|---|
committer | Mateusz Moscicki <m.moscicki2@partner.samsung.com> | 2022-06-09 19:33:13 +0200 |
commit | c8cd987776603aa66e52823830eba423619f2544 (patch) | |
tree | 56d4fbb26fb2612a6746ba5006b52a0e043ee2e2 | |
parent | b25d02d618797b5fb2fbe61a188d6a28dc720bf8 (diff) | |
download | libtota-c8cd987776603aa66e52823830eba423619f2544.tar.gz libtota-c8cd987776603aa66e52823830eba423619f2544.tar.bz2 libtota-c8cd987776603aa66e52823830eba423619f2544.zip |
Rename update types and remove LZMA DELTA supporttizen_7.0_m2_releasesubmit/tizen/20220630.054823submit/tizen/20220627.093426accepted/tizen/unified/20220630.212020accepted/tizen/unified/20220628.133548accepted/tizen/7.0/unified/hotfix/20221116.105741accepted/tizen/7.0/unified/20221110.063519tizen_7.0_hotfixtizen_7.0accepted/tizen_unifiedaccepted/tizen_7.0_unified_hotfixaccepted/tizen_7.0_unified
Change-Id: Icf0c5c6c93c6328f303daacaeec49f7c8a5f40af
-rwxr-xr-x | ss_engine/SS_PatchDelta.c | 10 | ||||
-rwxr-xr-x | ss_engine/SS_UPI.c | 11 | ||||
-rwxr-xr-x | ss_engine/ua_types.h | 11 |
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 |