From c577a9525d9707c96b07a4e4edc4bd007cc00a13 Mon Sep 17 00:00:00 2001 From: topjohnwu Date: Sun, 31 Mar 2019 15:10:01 -0400 Subject: [PATCH] Remove simple mount mode This mode is proven to have no difference than normal post-fs-data module mounting. No reason to keep this code in the sources. --- native/jni/core/bootstages.cpp | 41 ---------------------------------- 1 file changed, 41 deletions(-) diff --git a/native/jni/core/bootstages.cpp b/native/jni/core/bootstages.cpp index 95d041d39..44969b187 100644 --- a/native/jni/core/bootstages.cpp +++ b/native/jni/core/bootstages.cpp @@ -293,41 +293,6 @@ node_entry *node_entry::extract(const char *name) { return node; } -/**************** - * Simple Mount * - ****************/ - -static void simple_mount(const char *path) { - DIR *dir; - struct dirent *entry; - - snprintf(buf, PATH_MAX, "%s%s", SIMPLEMOUNT, path); - if (!(dir = opendir(buf))) - return; - - while ((entry = xreaddir(dir))) { - if (strcmp(entry->d_name, ".") == 0 || strcmp(entry->d_name, "..") == 0) - continue; - // Target file path - snprintf(buf2, PATH_MAX, "%s/%s", path, entry->d_name); - // Only mount existing file - if (access(buf2, F_OK) == -1) - continue; - if (entry->d_type == DT_DIR) { - simple_mount(string(buf2).c_str()); - } else if (entry->d_type == DT_REG) { - // Actual file path - snprintf(buf, PATH_MAX, "%s%s", SIMPLEMOUNT, buf2); - // Clone all attributes - clone_attr(buf2, buf); - // Finally, mount the file - bind_mount(buf, buf2); - } - } - - closedir(dir); -} - /***************** * Miscellaneous * *****************/ @@ -627,12 +592,6 @@ void post_fs_data(int client) { fclose(cf); #endif - // Not core-only mode - if (access(DISABLEFILE, F_OK) != 0) { - simple_mount("/system"); - simple_mount("/vendor"); - } - if (!magisk_env()) { LOGE("* Magisk environment setup incomplete, abort\n"); unblock_boot_process();