From 6c07219307507ade44163d770fd4fc42fa76f03f Mon Sep 17 00:00:00 2001 From: Kichan Kwon Date: Fri, 3 Nov 2017 19:05:30 +0900 Subject: [PATCH] Migrate UA data structures to libtota - To prevent error by structure difference - You can see the ua_types.h in the libtota - NOTICE : it must be merged along with the libtota patch - https://review.tizen.org/gerrit/#/c/158841/ Change-Id: I743da85dcaa8450d266bd50cac9749b0146fd3a7 Signed-off-by: Kichan Kwon --- src/ua.c | 1 + src/ua.h | 79 ---------------------------------------------------------------- 2 files changed, 1 insertion(+), 79 deletions(-) diff --git a/src/ua.c b/src/ua.c index 11c747d..2418d96 100755 --- a/src/ua.c +++ b/src/ua.c @@ -32,6 +32,7 @@ #include "SS_Common.h" #include "fota_common.h" #include "ua.h" +#include "ua_types.h" #include "mmc_io.h" #include "fota_cfg.h" #include "fota_tar.h" diff --git a/src/ua.h b/src/ua.h index 1045902..69378ae 100755 --- a/src/ua.h +++ b/src/ua.h @@ -69,12 +69,6 @@ #define DEFAULT_DELTA_NAME "delta.tar" #define UPDATTE_CFG_FILE "update.cfg" -#define UI_OP_SCOUT_UPDATE 0 -#define UI_OP_SCOUT 1 -#define UI_OP_UPDATE 3 - -#define UA_PARTI_MAX 20 - #define UP_STATUS_FILE "UP.STATUS" #define UP_START_NONE 0 @@ -83,79 +77,6 @@ enum { UA_OP_MODE_BG }; -typedef enum { - FULL_IMG, - DELTA_IMG, - DELTA_FS, - EXTRA -} UA_DATA_FORMAT; - -typedef enum { - UA_MODE_SCOUT_UPDATE, - UA_MODE_SCOUT, - UA_MODE_VERIFYTARGET, - UA_MODE_UPDATE, - UA_MODE_SUPPLYIMFOM = 200 -} UA_OPERATION_MODE; - -typedef struct _ua_update_data_t { - unsigned int exist_check; - unsigned int verify_check; - unsigned int update_check; - unsigned int weight; // the sum of weight should be 100 - unsigned int weight_offset; // start offset - unsigned int data_size; // byte - char *ua_delta_path; // it will be allocated to copy delta file path, need to free memory - char *ua_temp_path; // it will be allocated to copy delta file path, need to free memory -} ua_update_data_t; - -typedef struct _ua_update_cfg_t { - unsigned int update_type; - int skip_verify; - int skip_update; - int soure_img_size;//TOTA - int target_img_size; - char *soure_sha1; - char *target_sha1; -} ua_update_cfg_t; - -typedef struct _ua_part_info_t { - char *ua_parti_name; - char *ua_subject_name; - char *ua_blk_name; - int ua_blk_offset; -} ua_part_info_t; - -// User data structure -typedef struct _ua_data_t { // partition operations - ua_part_info_t *parti_info; - ua_update_cfg_t *update_cfg; - ua_update_data_t *update_data; - unsigned long ua_operation; - - int (*ua_op_read_block)(void *, unsigned char*, unsigned long, unsigned long); - int (*ua_op_write_block)(void *, unsigned char*, unsigned long); - void (*ui_progress)(void *, unsigned long); -} ua_data_t; - - -typedef struct _ua_delta_info_t { - char ua_patch_path[MAX_FILE_PATH]; - char ua_patch_info[MAX_FILE_PATH]; - char ua_delta_path[MAX_FILE_PATH]; - char ua_attrib_path[MAX_FILE_PATH]; -} ua_delta_info_t; - - -typedef struct _ua_dataSS_t { // partition operations - ua_part_info_t *parti_info; - ua_update_cfg_t *update_cfg; - ua_update_data_t *update_data; - ua_delta_info_t *update_delta; - unsigned long ua_operation; - void (*ui_progress)(void *, unsigned long); - int (*write_data_to_blkdev)(char *, int, int, char *); -} ua_dataSS_t; void log_deinit(void); #endif -- 2.7.4