Identify tmpfs used by magisk

This commit is contained in:
vvb2060 2023-02-13 02:11:25 +08:00 committed by John Wu
parent 5520f0fbf7
commit 2a4aa95a6f
2 changed files with 3 additions and 5 deletions

View File

@ -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

View File

@ -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");