fs_mgr: Make block devices rw by default in recovery
* Needed for incremental OTA on dynamic partitions
if we still want to be able to map partitions for
3rd party flashable zips
Change-Id: I4b17e3a566a77de36fa5fcf7862ad0d8b1b5c041
diff --git a/fs_mgr/fs_mgr.cpp b/fs_mgr/fs_mgr.cpp
index af2b35a..0a6cace 100644
--- a/fs_mgr/fs_mgr.cpp
+++ b/fs_mgr/fs_mgr.cpp
@@ -876,9 +876,11 @@
}
PINFO << __FUNCTION__ << "(source=" << source << source_missing << ",target=" << target
<< target_missing << ",type=" << entry.fs_type << ")=" << ret;
+#ifndef __ANDROID_RECOVERY__
if ((ret == 0) && (mountflags & MS_RDONLY) != 0) {
fs_mgr_set_blk_ro(source);
}
+#endif
if (ret == 0) {
android::base::SetProperty("ro.boottime.init.mount." + Basename(target),
std::to_string(t.duration().count()));
@@ -1453,9 +1455,11 @@
// Skip mounting the root partition, as it will already have been mounted.
if (current_entry.mount_point == "/" || current_entry.mount_point == "/system") {
+#ifndef __ANDROID_RECOVERY__
if ((current_entry.flags & MS_RDONLY) != 0) {
fs_mgr_set_blk_ro(current_entry.blk_device);
}
+#endif
continue;
}
diff --git a/fs_mgr/libdm/dm.cpp b/fs_mgr/libdm/dm.cpp
index e261aa3..0865253 100644
--- a/fs_mgr/libdm/dm.cpp
+++ b/fs_mgr/libdm/dm.cpp
@@ -322,9 +322,11 @@
io->data_size = ioctl_buffer.size();
io->data_start = sizeof(struct dm_ioctl);
io->target_count = static_cast<uint32_t>(table.num_targets());
+#ifndef __ANDROID_RECOVERY__
if (table.readonly()) {
io->flags |= DM_READONLY_FLAG;
}
+#endif
if (ioctl(fd_, DM_TABLE_LOAD, io)) {
PLOG(ERROR) << "DM_TABLE_LOAD failed";
return false;