diff --git a/fs_mgr/Android.bp b/fs_mgr/Android.bp index 87db98b08..1ef6688fd 100644 --- a/fs_mgr/Android.bp +++ b/fs_mgr/Android.bp @@ -159,6 +159,11 @@ cc_library { srcs: [ ":libfiemap_passthrough_srcs", ], + target: { + recovery: { + cflags: ["-DSKIP_SET_BLK_RO"], + }, + }, } cc_library { diff --git a/fs_mgr/fs_mgr.cpp b/fs_mgr/fs_mgr.cpp index 7f41cea83..6fd59148b 100644 --- a/fs_mgr/fs_mgr.cpp +++ b/fs_mgr/fs_mgr.cpp @@ -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()));