2 * upgrade-apply-deltafs
4 * Copyright (c) 2017 - 2022 Samsung Electronics Co., Ltd.
6 * Licensed under the Apache License, Version 2.0 (the License);
7 * you may not use this file except in compliance with the License.
8 * You may obtain a copy of the License at
10 * http://www.apache.org/licenses/LICENSE-2.0
12 * Unless required by applicable law or agreed to in writing, software
13 * distributed under the License is distributed on an "AS IS" BASIS,
14 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15 * See the License for the specific language governing permissions and
16 * limitations under the License.
21 #include "fota_common.h"
22 #include "SS_Common.h"
24 #define DISPLAYRESOLUTION_SIZE 50
37 enum DEL_TYPE { DELETES = 1, DIFFS, MOVES, DELETE_END, NEWFILES, SYMDIFFS, SYMNEWFILES, HARDDIFFS, HARDNEWFILES, DEL_TYPE_MAX };
38 struct fs_params { // Use Macros
39 char file_old_path[512];
40 char file_new_path[512];
46 int type; //0 is for diff and 1 is for verbatim
47 struct fs_params *nextnode;
49 typedef struct fs_params fs_params;
56 fs_params *sym_difref;
57 fs_params *sym_newref;
58 fs_params *hard_difref;
59 fs_params *hard_newref;
62 typedef struct fs_list fs_list;
64 int SS_AppendNode(const char *ubDeltaPath, fs_params ** headparam, fs_params ** tailparam, const char *old_path,
65 const char *new_path, const char *patchname, const char *sha1src, const char *sha1trg, int type,
66 char *patchpath_name);
67 long SS_GetUPIVersion(unsigned char *ver_str);
68 int decompress_tar_brotli(const char *path);
69 extern int SS_FSUpdatemain(ua_dataSS_t * ua_dataSS);
70 extern int SS_FSVerifyPartition(ua_dataSS_t * ua_dataSS);
73 extern void *SS_Malloc(unsigned int size);
74 extern void SS_Free(void *pMemBlock);
75 extern int SS_UpdateDeltaFS(const char *source_filename, const char *target_filename,
76 const char *source_sha1_str, const char *target_sha1_str, int patch_data_size, TAR* tar_file);
77 extern long SS_GetFileType(char *pLinkName, enumFileType * fileType);