diff --git a/interfaces/innerkits/init_module_engine/BUILD.gn b/interfaces/innerkits/init_module_engine/BUILD.gn index c206211c16a6a3350d8d96954d9106f433470d57..d5d633ca502649e3dfed57f168b3885f09ba81b6 100644 --- a/interfaces/innerkits/init_module_engine/BUILD.gn +++ b/interfaces/innerkits/init_module_engine/BUILD.gn @@ -61,6 +61,7 @@ if (defined(ohos_lite)) { install_images = [ "system", "updater", + "ramdisk", ] symlink_target_name = [ "libinit_module_engine.so" ] } diff --git a/services/init/standard/BUILD.gn b/services/init/standard/BUILD.gn index 32113ec2fe80a611c5d7afed95d4153426dfcde6..03c6b9a687735bad44753dd5565dc0e9cb21841b 100644 --- a/services/init/standard/BUILD.gn +++ b/services/init/standard/BUILD.gn @@ -132,6 +132,7 @@ ohos_executable("init") { } if (support_jsapi) { defines += [ "SUPPORT_PROFILER_HIDEBUG" ] + external_deps = [ "profiler:libhidebug_init" ] } if (asan_detector) { defines += [ "ASAN_DETECTOR" ] diff --git a/services/init/standard/init_cmds.c b/services/init/standard/init_cmds.c index be2d2fc54ead41e36b5121e1c9da71616ca3b7a9..6086f1b78f6af8412b4a0dcece5ad7766b51361d 100755 --- a/services/init/standard/init_cmds.c +++ b/services/init/standard/init_cmds.c @@ -44,6 +44,10 @@ #include "securec.h" #include "fscrypt_utils.h" +#ifdef SUPPORT_PROFILER_HIDEBUG +#include +#endif + #define FSCRYPT_POLICY_BUF_SIZE (60) #define DECIMAL 10 #define OCTAL 8 @@ -526,30 +530,7 @@ const struct CmdTable *GetCmdTable(int *number) void OpenHidebug(const char *name) { #ifdef SUPPORT_PROFILER_HIDEBUG -#ifdef __aarch64__ - const char *debugSoPath = "/system/lib64/libhidebug.so"; -#else - const char *debugSoPath = "/system/lib/libhidebug.so"; -#endif - do { - if (access(debugSoPath, F_OK) != 0) { - break; - } - void* handle = dlopen(debugSoPath, RTLD_LAZY); - if (handle == NULL) { - INIT_LOGE("Failed to dlopen libhidebug.so, %s\n", dlerror()); - break; - } - bool (* initParam)(); - initParam = (bool (*)())dlsym(handle, "InitEnvironmentParam"); - if (initParam == NULL) { - INIT_LOGE("Failed to dlsym InitEnvironmentParam, %s\n", dlerror()); - dlclose(handle); - break; - } - (*initParam)(name); - dlclose(handle); - } while (0); + InitEnvironmentParam(name); #endif }