From 9bb2243b5643f4fca6629064f0a0eb1b32424d33 Mon Sep 17 00:00:00 2001 From: topjohnwu Date: Sat, 23 Mar 2019 03:05:38 -0400 Subject: [PATCH] Switch to skip_mount instead of auto_mount 95%+ of existing modules enables auto mount (obviously). Switching auto mount to opt-out makes more sense than opt-in as in previous module format. The file 'auto_mount' will be ignored, and the file 'skip_mount' will be checked to toggle the mounting behavior. After scanning through the current Magisk Module Repo modules, no modules are using custom bind mounting; all modules with auto mount disabled have empty system folder, which means this change will not affect any existing module. --- native/jni/core/bootstages.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/native/jni/core/bootstages.cpp b/native/jni/core/bootstages.cpp index e64bc8ef5..046b35324 100644 --- a/native/jni/core/bootstages.cpp +++ b/native/jni/core/bootstages.cpp @@ -674,9 +674,9 @@ void post_fs_data(int client) { LOGI("%s: loading [system.prop]\n", module); load_prop_file(buf, false); } - // Check whether enable auto_mount - snprintf(buf, PATH_MAX, "%s/%s/auto_mount", MODULEROOT, module); - if (access(buf, F_OK) == -1) + // Check whether skip mounting + snprintf(buf, PATH_MAX, "%s/%s/skip_mount", MODULEROOT, module); + if (access(buf, F_OK) == 0) continue; // Double check whether the system folder exists snprintf(buf, PATH_MAX, "%s/%s/system", MODULEROOT, module);