提交 20e73cb8 编写于 作者: Z zff

feat: 系统组件支持64位集成

close: #I5113F
Signed-off-by: Nzff <zhangfanfan2@huawei.com>
Change-Id: I4ead32fc38568e3b2160371373906079486bbe6e
上级 164415c8
{
"sandbox-root" : "/mnt/sandbox/app",
"mount-bind-paths" : [{
"src-path" : "/mnt",
"sandbox-path" : "/mnt",
"sandbox-flags" : [ "bind", "rec", "private" ]
}, {
"src-path" : "/system/bin",
"sandbox-path" : "/system/bin",
"sandbox-flags" : [ "bind", "rec", "private" ]
}, {
"src-path" : "/system/lib64",
"sandbox-path" : "/system/lib64",
"sandbox-flags" : [ "bind", "rec", "private" ]
}, {
"src-path" : "/system/lib64/module",
"sandbox-path" : "/system/lib64/module",
"sandbox-flags" : [ "bind", "rec", "private" ]
}, {
"src-path" : "/system/etc",
"sandbox-path" : "/system/etc",
"sandbox-flags" : [ "bind", "rec", "private" ]
}, {
"src-path" : "/sys",
"sandbox-path" : "/sys",
"sandbox-flags" : [ "bind", "rec", "private" ]
}, {
"src-path" : "/proc",
"sandbox-path" : "/proc",
"sandbox-flags" : [ "bind", "rec" ]
}, {
"src-path" : "/dev",
"sandbox-path" : "/dev",
"sandbox-flags" : [ "bind", "rec", "private" ]
}, {
"src-path" : "/data",
"sandbox-path" : "/data",
"sandbox-flags" : [ "bind", "rec", "private" ]
}
],
"mount-bind-files" : [{
}],
"symbol-links" : [{
"target-name" : "/system/bin",
"link-name" : "/bin"
}, {
"target-name" : "/system/lib64",
"link-name" : "/lib64"
}, {
"target-name" : "/system/etc",
"link-name" : "/etc"
}
]
}
{
"sandbox-root" : "/mnt/sandbox/chipset",
"mount-bind-paths" : [{
"src-path" : "/system/lib64/vndk",
"sandbox-path" : "/system/lib64/vndk",
"sandbox-flags" : [ "bind", "rec", "private" ]
}, {
"src-path" : "/system/lib64/platform-vndk",
"sandbox-path" : "/system/lib64/platform-vndk",
"sandbox-flags" : [ "bind", "rec", "private" ]
}, {
"src-path" : "/system/lib64/ndk",
"sandbox-path" : "/system/lib64/ndk",
"sandbox-flags" : [ "bind", "rec", "private" ]
}, {
"src-path" : "/vendor/lib64",
"sandbox-path" : "/vendor/lib64",
"sandbox-flags" : [ "bind", "rec", "private" ]
}, {
"src-path" : "/vendor/bin",
"sandbox-path" : "/vendor/bin",
"sandbox-flags" : [ "bind", "rec", "private" ]
}, {
"src-path" : "/vendor/etc",
"sandbox-path" : "/vendor/etc",
"sandbox-flags" : [ "bind", "rec", "private" ]
}, {
"src-path" : "/dev",
"sandbox-path" : "/dev",
"sandbox-flags" : [ "bind", "rec", "private" ]
}, {
"src-path" : "/proc",
"sandbox-path" : "/proc",
"sandbox-flags" : [ "bind", "rec", "private" ]
}, {
"src-path" : "/data",
"sandbox-path" : "/data",
"sandbox-flags" : [ "bind", "rec", "private" ]
}, {
"src-path" : "/sys",
"sandbox-path" : "/sys",
"sandbox-flags" : [ "bind", "rec", "private" ]
}
],
"mount-bind-files" : [{
}],
"symbol-links" : [{
"target-name" : "/vendor/lib64",
"link-name" : "/lib64"
}, {
"target-name" : "/vendor/bin",
"link-name" : "/bin"
}, {
"target-name" : "/vendor/etc",
"link-name" : "/etc"
}
]
}
{
"sandbox-root" : "/mnt/sandbox/priv-app",
"mount-bind-paths" : [{
"src-path" : "/mnt",
"sandbox-path" : "/mnt",
"sandbox-flags" : [ "bind", "rec" ]
}, {
"src-path" : "/system/bin",
"sandbox-path" : "/system/bin",
"sandbox-flags" : [ "bind", "rec" ]
}, {
"src-path" : "/system/bin",
"sandbox-path" : "/system/common/bin",
"sandbox-flags" : [ "bind", "rec" ]
}, {
"src-path" : "/system/lib64",
"sandbox-path" : "/system/lib64",
"sandbox-flags" : [ "bind", "rec" ]
}, {
"src-path" : "/system/lib64/module",
"sandbox-path" : "/system/lib64/module",
"sandbox-flags" : [ "bind", "rec" ]
}, {
"src-path" : "/system/etc",
"sandbox-path" : "/system/etc",
"sandbox-flags" : [ "bind", "rec" ]
}, {
"src-path" : "/sys",
"sandbox-path" : "/sys",
"sandbox-flags" : [ "bind", "rec" ]
}, {
"src-path" : "/proc",
"sandbox-path" : "/proc",
"sandbox-flags" : [ "bind", "rec" ]
}, {
"src-path" : "/dev",
"sandbox-path" : "/dev",
"sandbox-flags" : [ "bind", "rec" ]
}, {
"src-path" : "/data",
"sandbox-path" : "/data",
"sandbox-flags" : [ "bind", "rec" ]
}
],
"mount-bind-files": [{
}],
"symbol-links": [{
"target-name" : "/system/bin",
"link-name" : "/bin"
}, {
"target-name" : "/system/lib64",
"link-name" : "/lib64"
}, {
"target-name" : "/system/etc",
"link-name" : "/etc"
}
]
}
{
"sandbox-root" : "/mnt/sandbox/system",
"mount-bind-paths" : [{
"src-path" : "/system/bin",
"sandbox-path" : "/system/bin",
"sandbox-flags" : [ "bind", "rec", "private" ]
}, {
"src-path" : "/system/etc",
"sandbox-path" : "/system/etc",
"sandbox-flags" : [ "bind", "rec", "private" ]
}, {
"src-path" : "/system/lib64",
"sandbox-path" : "/system/lib64",
"sandbox-flags" : [ "bind", "rec", "private" ]
}, {
"src-path" : "/system/profile",
"sandbox-path" : "/system/profile",
"sandbox-flags" : [ "bind", "rec", "private" ]
}, {
"src-path" : "/system/app",
"sandbox-path" : "/system/app",
"sandbox-flags" : [ "bind", "rec", "private" ]
}, {
"src-path" : "/system/fonts",
"sandbox-path" : "/system/fonts",
"sandbox-flags" : [ "bind", "rec", "private" ]
}, {
"src-path" : "/system/usr",
"sandbox-path" : "/system/usr",
"sandbox-flags" : [ "bind", "rec", "private" ]
}, {
"src-path" : "/vendor",
"sandbox-path" : "/vendor",
"sandbox-flags" : [ "bind", "rec", "private" ]
}, {
"src-path" : "/dev",
"sandbox-path" : "/dev",
"sandbox-flags" : [ "bind", "rec", "private" ]
}, {
"src-path" : "/proc",
"sandbox-path" : "/proc",
"sandbox-flags" : [ "bind", "rec", "private" ]
}, {
"src-path" : "/data",
"sandbox-path" : "/data",
"sandbox-flags" : [ "bind", "rec", "private" ]
}, {
"src-path" : "/sys",
"sandbox-path" : "/sys",
"sandbox-flags" : [ "bind", "rec", "private" ]
}, {
"src-path" : "/config",
"sandbox-path" : "/config",
"sandbox-flags" : [ "bind", "rec", "private" ]
}, {
"src-path" : "/mnt",
"sandbox-path" : "/mnt",
"sandbox-flags" : [ "bind", "rec", "private" ]
}, {
"src-path" : "/storage",
"sandbox-path" : "/storage",
"sandbox-flags" : [ "bind", "rec", "private" ]
}, {
"src-path" : "/sys_prod",
"sandbox-path" : "/sys_prod",
"sandbox-flags" : [ "bind", "rec", "private" ]
}
],
"mount-bind-files" : [{
}],
"symbol-links" : [{
"target-name" : "/system/lib64",
"link-name" : "/lib64"
}, {
"target-name" : "/system/bin",
"link-name" : "/bin"
}, {
"target-name" : "/system/etc",
"link-name" : "/etc"
}
]
}
......@@ -304,26 +304,41 @@ if (defined(ohos_lite)) {
}
ohos_prebuilt_etc("system-sandbox.json") {
source = "//base/startup/init_lite/interfaces/innerkits/sandbox/system-sandbox.json"
if (target_cpu == "arm64") {
source = "//base/startup/init_lite/interfaces/innerkits/sandbox/system-sandbox64.json"
} else {
source = "//base/startup/init_lite/interfaces/innerkits/sandbox/system-sandbox.json"
}
part_name = "init"
module_install_dir = "etc/sandbox"
}
ohos_prebuilt_etc("chipset-sandbox.json") {
source = "//base/startup/init_lite/interfaces/innerkits/sandbox/chipset-sandbox.json"
if (target_cpu == "arm64") {
source = "//base/startup/init_lite/interfaces/innerkits/sandbox/chipset-sandbox64.json"
} else {
source = "//base/startup/init_lite/interfaces/innerkits/sandbox/chipset-sandbox.json"
}
part_name = "init"
module_install_dir = "etc/sandbox"
}
ohos_prebuilt_etc("privapp-sandbox.json") {
source = "//base/startup/init_lite/interfaces/innerkits/sandbox/privapp-sandbox.json"
if (target_cpu == "arm64") {
source = "//base/startup/init_lite/interfaces/innerkits/sandbox/privapp-sandbox64.json"
} else {
source = "//base/startup/init_lite/interfaces/innerkits/sandbox/privapp-sandbox.json"
}
part_name = "init"
module_install_dir = "etc/sandbox"
}
ohos_prebuilt_etc("app-sandbox.json") {
source =
"//base/startup/init_lite/interfaces/innerkits/sandbox/app-sandbox.json"
if (target_cpu == "arm64") {
source = "//base/startup/init_lite/interfaces/innerkits/sandbox/app-sandbox64.json"
} else {
source = "//base/startup/init_lite/interfaces/innerkits/sandbox/app-sandbox.json"
}
part_name = "init"
module_install_dir = "etc/sandbox"
}
......
......@@ -25,8 +25,11 @@
extern "C" {
#endif
#endif
#ifdef __aarch64__
#define DEFAULT_PLUGIN_PATH "/system/lib64/plugin"
#else
#define DEFAULT_PLUGIN_PATH "/system/lib/plugin"
#endif
#define DEFAULT_PLUGIN_CFG "/system/etc/plugin_modules.cfg"
typedef enum {
PLUGIN_STATE_IDLE,
......
......@@ -185,11 +185,16 @@ static void DoExec(const struct CmdArgs *ctx)
if (pid == 0) {
#ifdef SUPPORT_PROFILER_HIDEBUG
do {
if (access("/system/lib/libhidebug.so", F_OK) != 0) {
#ifdef __aarch64__
const char *debugSoPath = "/system/lib64/libhidebug.so";
#else
const char *debugSoPath = "/system/lib/libhidebug.so";
#endif
if (access(debugSoPath, F_OK) != 0) {
INIT_LOGE("access failed, errno = %d\n", errno);
break;
}
void* handle = dlopen("/system/lib/libhidebug.so", RTLD_LAZY);
void* handle = dlopen(debugSoPath, RTLD_LAZY);
if (handle == NULL) {
INIT_LOGE("Failed to dlopen libhidebug.so, %s\n", dlerror());
break;
......
......@@ -89,11 +89,16 @@ int ServiceExec(const Service *service)
INIT_CHECK_ONLY_ELOG(unsetenv("UV_THREADPOOL_SIZE") == 0, "set UV_THREADPOOL_SIZE error : %d.", errno);
#ifdef SUPPORT_PROFILER_HIDEBUG
do {
if (access("/system/lib/libhidebug.so", F_OK) != 0) {
#ifdef __aarch64__
const char *debugSoPath = "/system/lib64/libhidebug.so";
#else
const char *debugSoPath = "/system/lib/libhidebug.so";
#endif
if (access(debugSoPath, F_OK) != 0) {
INIT_LOGE("access failed, errno = %d\n", errno);
break;
}
void* handle = dlopen("/system/lib/libhidebug.so", RTLD_LAZY);
void* handle = dlopen(debugSoPath, RTLD_LAZY);
if (handle == NULL) {
INIT_LOGE("Failed to dlopen libhidebug.so, %s\n", dlerror());
break;
......
......@@ -259,7 +259,11 @@ static int CheckParamPermissionWithSelinux(const ParamSecurityLabel *srcLabel, c
static void (*setSelinuxLogCallback)();
static int (*setParamCheck)(const char *paraName, struct ucred *uc);
if (g_selinuxHandle == NULL) {
#ifdef __aarch64__
g_selinuxHandle = dlopen("/system/lib64/libparaperm_checker.z.so", RTLD_LAZY);
#else
g_selinuxHandle = dlopen("/system/lib/libparaperm_checker.z.so", RTLD_LAZY);
#endif
if (g_selinuxHandle == NULL) {
PARAM_LOGE("Failed to dlopen libparaperm_checker.z.so, %s\n", dlerror());
return DAC_RESULT_FORBIDED;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册