diff --git a/native/jni/daemon/bootstages.cpp b/native/jni/daemon/bootstages.cpp index 406071c83..2d6c6658a 100644 --- a/native/jni/daemon/bootstages.cpp +++ b/native/jni/daemon/bootstages.cpp @@ -319,7 +319,7 @@ static void exec_common_script(const char* stage) { LOGI("%s.d: exec [%s]\n", stage, entry->d_name); int pid = exec_command(false, nullptr, strcmp(stage, "post-fs-data") ? set_path : set_mirror_path, - "sh", entry->d_name, nullptr); + MIRRDIR "/system/bin/sh", entry->d_name, nullptr); if (pid != -1) waitpid(pid, nullptr, 0); } @@ -338,7 +338,7 @@ static void exec_module_script(const char* stage) { LOGI("%s: exec [%s.sh]\n", module, stage); int pid = exec_command(false, nullptr, strcmp(stage, "post-fs-data") ? set_path : set_mirror_path, - "sh", buf2, nullptr); + MIRRDIR "/system/bin/sh", buf2, nullptr); if (pid != -1) waitpid(pid, nullptr, 0); } diff --git a/native/jni/utils/misc.cpp b/native/jni/utils/misc.cpp index a0a187f95..f06fdd542 100644 --- a/native/jni/utils/misc.cpp +++ b/native/jni/utils/misc.cpp @@ -211,8 +211,8 @@ int exec_array(bool err, int *fd, void (*pre_exec)(void), const char **argv) { if (pre_exec) pre_exec(); - execvp(argv[0], (char **) argv); - PLOGE("execvp %s", argv[0]); + execve(argv[0], (char **) argv, environ); + PLOGE("execve %s", argv[0]); return -1; }