Move REMOUNT_ROOT

This commit is contained in:
vvb2060 2023-02-28 21:51:58 +08:00 committed by John Wu
parent 78df677a42
commit 4772868d6a
2 changed files with 5 additions and 4 deletions

View File

@ -234,9 +234,6 @@ static bool check_key_combo() {
extern int disable_deny();
static void post_fs_data() {
if (getenv("REMOUNT_ROOT"))
xmount(nullptr, "/", nullptr, MS_REMOUNT | MS_RDONLY, nullptr);
if (!check_data())
return;

View File

@ -358,7 +358,7 @@ static void daemon_entry() {
restore_tmpcon();
// SAR cleanups
// Cleanups
auto mount_list = MAGISKTMP + "/" ROOTMNT;
if (access(mount_list.data(), F_OK) == 0) {
file_readline(true, mount_list.data(), [](string_view line) -> bool {
@ -366,6 +366,10 @@ static void daemon_entry() {
return true;
});
}
if (getenv("REMOUNT_ROOT")) {
xmount(nullptr, "/", nullptr, MS_REMOUNT | MS_RDONLY, nullptr);
unsetenv("REMOUNT_ROOT");
}
rm_rf((MAGISKTMP + "/" ROOTOVL).data());
// Load config status