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.
19 #ifndef __FOTA_COMMON_H__
20 #define __FOTA_COMMON_H__
25 typedef unsigned int u32;
26 #ifndef __size_t /* typedef check for x86 env: stddef.h */
31 #define MAX_FILE_PATH 512
33 #ifndef TIME_PROFILING
34 //#define TIME_PROFILING
36 #ifndef HEAP_PROFILING
37 //#define HEAP_PROFILING;
40 //#define MEM_PROFILING
42 #ifndef POWER_FAIL_TEST
43 //#define POWER_FAIL_TEST
46 #define UNUSED(x) (void)(x)
48 #define SS_TOTA_VERSION "1.0.19"
49 #define BSDIFF "BSDIFF40"
50 #define IMGDIFF "IMGDIFF2"
51 #define SECTOR_SIZE 512F
52 #define SS_KERNEL_DELTA_HEADER 128
54 #define SS_BACKUP_SOURCE "/saved.file" //How to make sure there is SPACE
55 #define SS_PATCHFILE_SOURCE "/patchfile.file" //define in common place
56 #define SS_PATCHLIST_BKUPLOC "/patchlist.txt"
57 #define SS_NEW_COMPRESSED_FILE "/system.7z"
58 #define SS_UPDATE_STATUS_PATH "/UP.STATUS"
60 #define SS_PATCHLISTFORMAT ".txt"
61 #define SS_PATCH_ATTR_FORMAT "_attr.txt"
62 #define SS_FSCOUNT_MAGIC_KEY "PaTcHCoUnT:"
63 #define SS_FSCOUNT_MAGIG_KEYLEN (11) //length of SS_FSCOUNT_MAGIC_KEY
65 #define SS_TOKEN_SPACE " "
66 #define SS_TOKEN_NEWLINE "\n"
67 #define SS_TOEKN_COLON ":"
68 #define SS_FWSLASH "/"
69 #define SS_NULLENTRY "0"
70 #define SS_MAX_NAMELENSUPPORTED (200) //(Tar supports 256, But extra space is used for PartitionName, .delta, /p, so restricting filename max to 200)
71 #define SS_MAX_FILE_PATH (512)
72 #define SS_TOKEN_MAXLINE_LEN (1024)
73 #define SS_COMPRESSED_FILE "system.7z"
75 #define SS_STRING_DIFF "DIFF"
76 #define SS_STRING_MOVE "MOVE"
77 #define SS_STRING_DEL "DEL"
78 #define SS_STRING_SYM "SYM"
79 #define SS_STRING_HARD "HARD"
80 #define SS_STRING_NEW "NEW"
81 #define SS_STRING_REG "REG"
82 #define SS_STRING_TPK "TPK"
83 #define SS_STRING_ZIP "ZIP"
84 #define SS_STRING_END "END"
86 #define SS_COMMON_WORKSPACE "/run/upgrade-sysroot/opt/usr/data/fota"
89 #define SS_MEMORY_USAGE_LOG SS_COMMON_WORKSPACE "/log_memory"
90 #define SS_MEMORY_PROFILING_SCRIPT SS_COMMON_WORKSPACE "/mem_use.sh"
93 #ifdef POWER_FAIL_TEST
94 #define SS_POWER_FAIL_TEST_FLAG SS_COMMON_WORKSPACE "/power_fail_test_flag"
101 struct tar_Data *nextnode;
103 typedef struct tar_Data tar_Data_t;
105 #endif /* __FOTA_COMMON_H__ */