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

Commit 45ae1b27 authored by Keun-young Park's avatar Keun-young Park
Browse files

Do not umount /vendor, /system, and /oem even if they are R/W.

- /vendor, /system, /oem can be remounted to R/W for development
  purpose.

- In such case, umounting these partitions can lead into some processes
  not running properly during shutdown or blocking umount of fs.

- So skip them. As it is dev feature, it is up to each developer to
  understand the risk. But for normal adb sync - reboot should be ok
  as shutdown involves sync operations.

bug: 37737296
Test: adb remount,reboot, and check last kmsg

(cherry picked from commit 6e12b388)

Change-Id: Ia92a20aa672e68f695818e451ba2ae53af8f5ab9
parent 3ec9aa4a
Loading
Loading
Loading
Loading
+6 −1
Original line number Diff line number Diff line
@@ -198,7 +198,12 @@ static bool FindPartitionsToUmount(std::vector<MountEntry>* blockDevPartitions,
            LOG(INFO) << "mount entry " << mentry->mnt_fsname << ":" << mentry->mnt_dir << " opts "
                      << mentry->mnt_opts << " type " << mentry->mnt_type;
        } else if (MountEntry::IsBlockDevice(*mentry) && hasmntopt(mentry, "rw")) {
            std::string mount_dir(mentry->mnt_dir);
            // These are R/O partitions changed to R/W after adb remount.
            // Do not umount them as shutdown critical services may rely on them.
            if (mount_dir != "/system" && mount_dir != "/vendor" && mount_dir != "/oem") {
                blockDevPartitions->emplace(blockDevPartitions->begin(), *mentry);
            }
        } else if (MountEntry::IsEmulatedDevice(*mentry)) {
            emulatedPartitions->emplace(emulatedPartitions->begin(), *mentry);
        }