Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 4f7f40f0 authored by Jaegeuk Kim's avatar Jaegeuk Kim Committed by Automerger Merge Worker
Browse files

Merge "Try to remount mounted points only" am: 33d15ca2

Original change: https://android-review.googlesource.com/c/platform/system/core/+/1593131

MUST ONLY BE SUBMITTED BY AUTOMERGER

Change-Id: I3f948cbdae2d83f50a5336b6761db143361e8b29
parents 6c2781b4 33d15ca2
Loading
Loading
Loading
Loading
+7 −0
Original line number Diff line number Diff line
@@ -411,19 +411,26 @@ static int do_remount(int argc, char* argv[]) {
        auto blk_device = entry.blk_device;
        auto mount_point = entry.mount_point;

        auto found = false;
        for (auto it = mounts.rbegin(); it != mounts.rend(); ++it) {
            auto& rentry = *it;
            if (mount_point == rentry.mount_point) {
                blk_device = rentry.blk_device;
                found = true;
                break;
            }
            // Find overlayfs mount point?
            if ((mount_point == "/") && (rentry.mount_point == "/system")) {
                blk_device = rentry.blk_device;
                mount_point = "/system";
                found = true;
                break;
            }
        }
        if (!found) {
            PLOG(INFO) << "skip unmounted partition dev:" << blk_device << " mnt:" << mount_point;
            continue;
        }
        if (blk_device == "/dev/root") {
            auto from_fstab = GetEntryForMountPoint(&fstab, mount_point);
            if (from_fstab) blk_device = from_fstab->blk_device;