From 2a4aa95a6fba2c4293a8b2661c524b9addfefb34 Mon Sep 17 00:00:00 2001 From: vvb2060 Date: Mon, 13 Feb 2023 02:11:25 +0800 Subject: [PATCH] Identify tmpfs used by magisk --- native/src/core/bootstages.cpp | 6 ++---- native/src/init/mount.cpp | 2 +- 2 files changed, 3 insertions(+), 5 deletions(-) diff --git a/native/src/core/bootstages.cpp b/native/src/core/bootstages.cpp index c294ac278..c2d1a8362 100644 --- a/native/src/core/bootstages.cpp +++ b/native/src/core/bootstages.cpp @@ -45,10 +45,8 @@ static bool mount_mirror(const std::string_view from, const std::string_view to) static void mount_mirrors() { LOGI("* Prepare worker\n"); - if (auto worker_dir = MAGISKTMP + "/" WORKERDIR; - xmount(worker_dir.data(), worker_dir.data(), nullptr, MS_BIND, nullptr) == 0) { - xmount(nullptr, worker_dir.data(), nullptr, MS_PRIVATE, nullptr); - } + auto worker_dir = MAGISKTMP + "/" WORKERDIR; + xmount("worker", worker_dir.data(), "tmpfs", 0, "mode=755"); LOGI("* Mounting mirrors\n"); // recursively bind mount / to mirror dir diff --git a/native/src/init/mount.cpp b/native/src/init/mount.cpp index 60adddce3..52dc23c1d 100644 --- a/native/src/init/mount.cpp +++ b/native/src/init/mount.cpp @@ -231,7 +231,7 @@ void BaseInit::exec_init() { void BaseInit::prepare_data() { LOGD("Setup data tmp\n"); xmkdir("/data", 0755); - xmount("tmpfs", "/data", "tmpfs", 0, "mode=755"); + xmount("magisk", "/data", "tmpfs", 0, "mode=755"); cp_afc("/init", "/data/magiskinit"); cp_afc("/.backup", "/data/.backup");