From 50b55a77de3549f38e27421ad9c19bba57b02d80 Mon Sep 17 00:00:00 2001 From: topjohnwu Date: Sun, 20 Jan 2019 17:01:59 -0500 Subject: [PATCH] Don't mount images when running core-only mode --- native/jni/daemon/bootstages.cpp | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/native/jni/daemon/bootstages.cpp b/native/jni/daemon/bootstages.cpp index 010bc6eeb..13ed0ced4 100644 --- a/native/jni/daemon/bootstages.cpp +++ b/native/jni/daemon/bootstages.cpp @@ -779,7 +779,7 @@ void startup() { execl("/sbin/magisk.bin", "magisk", "--post-fs-data", nullptr); } -[[noreturn]] static void core_only() { +[[noreturn]] static inline void core_only() { auto_start_magiskhide(); unblock_boot_process(); } @@ -800,6 +800,14 @@ void post_fs_data(int client) { 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()) { LOGE("* Magisk image mount failed, switch to core-only mode\n"); free(magiskloop); @@ -810,14 +818,6 @@ void post_fs_data(int client) { restorecon(); 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 LOGI("* Running module post-fs-data scripts\n"); exec_module_script("post-fs-data");