fs_mgr: mount: don't set the block device as ro for recovery

* In recovery we need to be able to edit the block device
   after it's been mounted.
   This allows, for example, to wipe system after mounting it

Change-Id: Ie536d275643e9d6063bba789e4cd2fa2671fc8fa
This commit is contained in:
Alessandro Astone 2019-10-06 23:52:16 +02:00 committed by zlewchan
parent 3fb9072f4d
commit 85949a0b05
2 changed files with 7 additions and 0 deletions

View file

@ -159,6 +159,11 @@ cc_library {
srcs: [
":libfiemap_passthrough_srcs",
],
target: {
recovery: {
cflags: ["-DSKIP_SET_BLK_RO"],
},
},
}
cc_library {

View file

@ -880,9 +880,11 @@ static int __mount(const std::string& source, const std::string& target, const F
}
PINFO << __FUNCTION__ << "(source=" << source << source_missing << ",target=" << target
<< target_missing << ",type=" << entry.fs_type << ")=" << ret;
#ifndef SKIP_SET_BLK_RO
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()));