Commit 50b55a77 authored by topjohnwu's avatar topjohnwu

Don't mount images when running core-only mode

parent fdf167db
...@@ -779,7 +779,7 @@ void startup() { ...@@ -779,7 +779,7 @@ void startup() {
execl("/sbin/magisk.bin", "magisk", "--post-fs-data", nullptr); execl("/sbin/magisk.bin", "magisk", "--post-fs-data", nullptr);
} }
[[noreturn]] static void core_only() { [[noreturn]] static inline void core_only() {
auto_start_magiskhide(); auto_start_magiskhide();
unblock_boot_process(); unblock_boot_process();
} }
...@@ -800,6 +800,14 @@ void post_fs_data(int client) { ...@@ -800,6 +800,14 @@ void post_fs_data(int client) {
start_log_daemon(); start_log_daemon();
// Run common scripts
LOGI("* Running post-fs-data.d scripts\n");
exec_common_script("post-fs-data");
// Core only mode
if (access(DISABLEFILE, F_OK) == 0)
core_only();
if (!prepare_img()) { if (!prepare_img()) {
LOGE("* Magisk image mount failed, switch to core-only mode\n"); LOGE("* Magisk image mount failed, switch to core-only mode\n");
free(magiskloop); free(magiskloop);
...@@ -810,14 +818,6 @@ void post_fs_data(int client) { ...@@ -810,14 +818,6 @@ void post_fs_data(int client) {
restorecon(); restorecon();
chmod(SECURE_DIR, 0700); chmod(SECURE_DIR, 0700);
// Run common scripts
LOGI("* Running post-fs-data.d scripts\n");
exec_common_script("post-fs-data");
// Core only mode
if (access(DISABLEFILE, F_OK) == 0)
core_only();
// Execute module scripts // Execute module scripts
LOGI("* Running module post-fs-data scripts\n"); LOGI("* Running module post-fs-data scripts\n");
exec_module_script("post-fs-data"); exec_module_script("post-fs-data");
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment