Skip to content

Commit bd0ff86

Browse files
aleastomikeNG
authored andcommitted
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
1 parent 662be09 commit bd0ff86

File tree

2 files changed

+7
-0
lines changed

2 files changed

+7
-0
lines changed

fs_mgr/Android.bp

+5
Original file line numberDiff line numberDiff line change
@@ -149,6 +149,11 @@ cc_library {
149149
srcs: [
150150
":libfiemap_passthrough_srcs",
151151
],
152+
target: {
153+
recovery: {
154+
cflags: ["-DSKIP_SET_BLK_RO"],
155+
},
156+
},
152157
}
153158

154159
cc_library {

fs_mgr/fs_mgr.cpp

+2
Original file line numberDiff line numberDiff line change
@@ -828,9 +828,11 @@ static int __mount(const std::string& source, const std::string& target, const F
828828
}
829829
PINFO << __FUNCTION__ << "(source=" << source << source_missing << ",target=" << target
830830
<< target_missing << ",type=" << entry.fs_type << ")=" << ret;
831+
#ifndef SKIP_SET_BLK_RO
831832
if ((ret == 0) && (mountflags & MS_RDONLY) != 0) {
832833
fs_mgr_set_blk_ro(source);
833834
}
835+
#endif
834836
android::base::SetProperty("ro.boottime.init.mount." + Basename(target),
835837
std::to_string(t.duration().count()));
836838
errno = save_errno;

0 commit comments

Comments
 (0)