From 85a30f4c8695377eaffa5fff56fecc772b35b65a Mon Sep 17 00:00:00 2001 From: Bruno Martins Date: Sun, 19 Apr 2020 16:28:53 +0100 Subject: [PATCH] fs_mgr: Allow remounts with Magisk installed This allows remount to gracefully mount /system when Magisk is installed. As a sidenote, the ro.debuggable property check can safely be removed due to the simple fact that CPP preprocessor flag ALLOW_ADBD_DISABLE_VERITY=1 is passed when building userdebug/eng. Change-Id: Ic10eccbf5d225468c3dc42f8ae3ae7c05b49a699 --- fs_mgr/fs_mgr_remount.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/fs_mgr/fs_mgr_remount.cpp b/fs_mgr/fs_mgr_remount.cpp index 79c0b6df0..1a57b10b6 100644 --- a/fs_mgr/fs_mgr_remount.cpp +++ b/fs_mgr/fs_mgr_remount.cpp @@ -374,7 +374,8 @@ bool RemountPartition(Fstab& fstab, Fstab& mounts, FstabEntry& entry) { fs_mgr_set_blk_ro(blk_device, false); // Find system-as-root mount point? - if ((mount_point == "/system") && !GetEntryForMountPoint(&mounts, mount_point) && + if ((mount_point == "/system" || mount_point == "/system_root") && + !GetEntryForMountPoint(&mounts, mount_point) && GetEntryForMountPoint(&mounts, "/")) { mount_point = "/"; } @@ -629,7 +630,7 @@ int main(int argc, char* argv[]) { // If somehow this executable is delivered on a "user" build, it can // not function, so providing a clear message to the caller rather than // letting if fall through and provide a lot of confusing failure messages. - if (!ALLOW_ADBD_DISABLE_VERITY || !android::base::GetBoolProperty("ro.debuggable", false)) { + if (!ALLOW_ADBD_DISABLE_VERITY) { LOG(ERROR) << "Device must be userdebug build"; return EXIT_FAILURE; }