未验证 提交 36e06b87 编写于 作者: O openharmony_ci 提交者: Gitee

!1340 添加支持沙盒 扩展 json 配置文件, 支持厂家扩展

Merge pull request !1340 from cheng_jinsong/init0930_1
...@@ -16,7 +16,10 @@ import("//build/ohos.gni") ...@@ -16,7 +16,10 @@ import("//build/ohos.gni")
config("exported_header_files") { config("exported_header_files") {
visibility = [ ":*" ] visibility = [ ":*" ]
include_dirs = [ "//base/startup/init/interfaces/innerkits/sandbox/include" ] include_dirs = [
"//base/startup/init/interfaces/innerkits/sandbox/include",
"//base/customization/config_policy/interfaces/inner_api/include",
]
} }
ohos_static_library("sandbox") { ohos_static_library("sandbox") {
......
...@@ -21,33 +21,33 @@ extern "C" { ...@@ -21,33 +21,33 @@ extern "C" {
#endif #endif
#include <stdbool.h> #include <stdbool.h>
#include "init_utils.h" #include "init_utils.h"
#include "list.h"
typedef struct { typedef enum SandboxTag {
SANDBOX_TAG_MOUNT_PATH = 0,
SANDBOX_TAG_MOUNT_FILE,
SANDBOX_TAG_SYMLINK
} SandboxTag;
typedef struct MountList {
char *source; // source 目录,一般是全局的fs 目录 char *source; // source 目录,一般是全局的fs 目录
char *target; // 沙盒化后的目录 char *target; // 沙盒化后的目录
unsigned long flags; unsigned long flags;
bool ignoreErrors; bool ignoreErrors;
} mount_t; SandboxTag tag;
struct ListNode node;
typedef struct MountList {
mount_t *info;
struct MountList *next;
} mountlist_t; } mountlist_t;
typedef struct { typedef struct LinkList {
char *target; char *target;
char *linkName; char *linkName;
} linker_t; struct ListNode node;
typedef struct LinkList {
linker_t *info;
struct LinkList *next;
} linklist_t; } linklist_t;
typedef struct { typedef struct {
mountlist_t *pathMounts; ListNode pathMountsHead;
mountlist_t *fileMounts; ListNode fileMountsHead;
linklist_t *links; ListNode linksHead;
char *rootPath; // /mnt/sandbox/system|vendor|xxx char *rootPath; // /mnt/sandbox/system|vendor|xxx
char name[MAX_BUFFER_LEN]; // name of sandbox. i.e system, chipset etc. char name[MAX_BUFFER_LEN]; // name of sandbox. i.e system, chipset etc.
bool isCreated; // sandbox already created or not bool isCreated; // sandbox already created or not
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册