Merge "Try to remount mounted points only"
This commit is contained in:
commit
33d15ca2ce
1 changed files with 7 additions and 0 deletions
|
|
@ -411,19 +411,26 @@ static int do_remount(int argc, char* argv[]) {
|
||||||
auto blk_device = entry.blk_device;
|
auto blk_device = entry.blk_device;
|
||||||
auto mount_point = entry.mount_point;
|
auto mount_point = entry.mount_point;
|
||||||
|
|
||||||
|
auto found = false;
|
||||||
for (auto it = mounts.rbegin(); it != mounts.rend(); ++it) {
|
for (auto it = mounts.rbegin(); it != mounts.rend(); ++it) {
|
||||||
auto& rentry = *it;
|
auto& rentry = *it;
|
||||||
if (mount_point == rentry.mount_point) {
|
if (mount_point == rentry.mount_point) {
|
||||||
blk_device = rentry.blk_device;
|
blk_device = rentry.blk_device;
|
||||||
|
found = true;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
// Find overlayfs mount point?
|
// Find overlayfs mount point?
|
||||||
if ((mount_point == "/") && (rentry.mount_point == "/system")) {
|
if ((mount_point == "/") && (rentry.mount_point == "/system")) {
|
||||||
blk_device = rentry.blk_device;
|
blk_device = rentry.blk_device;
|
||||||
mount_point = "/system";
|
mount_point = "/system";
|
||||||
|
found = true;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
if (!found) {
|
||||||
|
PLOG(INFO) << "skip unmounted partition dev:" << blk_device << " mnt:" << mount_point;
|
||||||
|
continue;
|
||||||
|
}
|
||||||
if (blk_device == "/dev/root") {
|
if (blk_device == "/dev/root") {
|
||||||
auto from_fstab = GetEntryForMountPoint(&fstab, mount_point);
|
auto from_fstab = GetEntryForMountPoint(&fstab, mount_point);
|
||||||
if (from_fstab) blk_device = from_fstab->blk_device;
|
if (from_fstab) blk_device = from_fstab->blk_device;
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue