• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /*
2  * Copyright (c) 2020 Huawei Device Co., Ltd.
3  * Licensed under the Apache License, Version 2.0 (the "License");
4  * you may not use this file except in compliance with the License.
5  * You may obtain a copy of the License at
6  *
7  *    http://www.apache.org/licenses/LICENSE-2.0
8  *
9  * Unless required by applicable law or agreed to in writing, software
10  * distributed under the License is distributed on an "AS IS" BASIS,
11  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12  * See the License for the specific language governing permissions and
13  * limitations under the License.
14  */
15 
16 #ifndef OHOS_LITE_HOTA_PARTITION_H
17 #define OHOS_LITE_HOTA_PARTITION_H
18 
19 #include "ohos_types.h"
20 
21 #ifdef __cplusplus
22 #if __cplusplus
23 extern "C" {
24 #endif
25 #endif /* End of #ifdef __cplusplus */
26 
27 #define PARTITION_NAME_LENGTH   16
28 #define PARTITION_ERROR         -1
29 #define PARTITION_INFO_COMP     1    /* The info component of ota package. */
30 #define SIGN_RSA2048_LEN       256
31 #define SIGN_RSA3072_LEN       384
32 
33 #define ABILITY_DIFF_UPDATE      (0x1 << 0)
34 #define ABILITY_PATCH_UPDATE     (0x1 << 1)
35 #define ABILITY_PKG_SEARCH       (0x1 << 2)
36 #define ABILITY_PKG_DLOAD        (0x1 << 3)
37 #define ABILITY_UPDATE_AUTH      (0x1 << 4)
38 #define ABILITY_AUTO_UPDATE      (0x1 << 5)
39 #define ABILITY_FLOW_INSTALL     (0x1 << 6)
40 #define ABILITY_AB_PART_INSTALL  (0x1 << 7)
41 
42 typedef enum {
43     SIGN_ARITHMETIC_RSA2048 = 0x0001,
44     SIGN_ARITHMETIC_RSA3072 = 0x0011
45 } HotaSignArithmetic;
46 
47 typedef struct {
48     int id;
49     const char *componentName;
50     const char *imgPath;
51     unsigned char abFlag;
52 } ComponentTableInfo;
53 
54 typedef struct {
55     unsigned char updateMode;
56     unsigned char runningPartition;
57     unsigned char updatePartition;
58     unsigned char runningStatus;
59     unsigned char otaStatus;
60     unsigned char rebootStatus;
61     unsigned char updateStatus;
62 } UpdateMetaData;
63 
64 
65 #ifdef __cplusplus
66 #if __cplusplus
67 }
68 #endif
69 #endif /* End of #ifdef __cplusplus */
70 
71 #endif /* End of #ifndef OHOS_LITE_HOTA_PARTITION_H */
72