Merge "fs_mgr: remount: system is root"

am: 2b8e96bd64

Change-Id: I09e8809aaae61706a1b92139fa8127c1a3d67ff9
This commit is contained in:
Mark Salyzyn 2019-04-02 15:18:38 -07:00 committed by android-build-merger
commit 81e08d4c98
1 changed files with 7 additions and 0 deletions

View File

@ -340,6 +340,7 @@ int main(int argc, char* argv[]) {
blk_device = rentry.blk_device;
break;
}
// Find overlayfs mount point?
if ((mount_point == "/") && (rentry.mount_point == "/system")) {
blk_device = rentry.blk_device;
mount_point = "/system";
@ -352,6 +353,12 @@ int main(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) &&
GetEntryForMountPoint(&mounts, "/")) {
mount_point = "/";
}
// Now remount!
if (::mount(blk_device.c_str(), mount_point.c_str(), entry.fs_type.c_str(), MS_REMOUNT,
nullptr) == 0) {