Skip to content

Commit

Permalink
fs_mgr: Allow remounts with Magisk installed
Browse files Browse the repository at this point in the history
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
  • Loading branch information
bgcngm authored and ziasam committed Nov 9, 2021
1 parent c330a6f commit 0844470
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions fs_mgr/fs_mgr_remount.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -150,7 +150,7 @@ static int do_remount(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::GetProperty("ro.debuggable", "0") != "1")) {
if (!ALLOW_ADBD_DISABLE_VERITY) {
LOG(ERROR) << "only functions on userdebug or eng builds";
return NOT_USERDEBUG;
}
Expand Down Expand Up @@ -438,7 +438,8 @@ static int do_remount(int argc, char* argv[]) {
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 = "/";
}
Expand Down

0 comments on commit 0844470

Please sign in to comment.