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.
This commit is contained in:
topjohnwu 2019-03-23 03:05:38 -04:00
parent db06038548
commit 9bb2243b56

View File

@ -674,9 +674,9 @@ void post_fs_data(int client) {
LOGI("%s: loading [system.prop]\n", module); LOGI("%s: loading [system.prop]\n", module);
load_prop_file(buf, false); load_prop_file(buf, false);
} }
// Check whether enable auto_mount // Check whether skip mounting
snprintf(buf, PATH_MAX, "%s/%s/auto_mount", MODULEROOT, module); snprintf(buf, PATH_MAX, "%s/%s/skip_mount", MODULEROOT, module);
if (access(buf, F_OK) == -1) if (access(buf, F_OK) == 0)
continue; continue;
// Double check whether the system folder exists // Double check whether the system folder exists
snprintf(buf, PATH_MAX, "%s/%s/system", MODULEROOT, module); snprintf(buf, PATH_MAX, "%s/%s/system", MODULEROOT, module);