From 02a51083087dc948dd7e560a17700c13ee364c1c Mon Sep 17 00:00:00 2001 From: Sandeep Patil Date: Fri, 26 May 2017 18:09:06 -0700 Subject: [PATCH] Respect that status property when parsing fstab from device tree For an fstab entry in device tree, fs_mgr now honors the status property as done by linux. i.e. the node (in this case, the fstab entry) is enabled if status is not set, "ok" or "okay". For every other value, the node is considered as disabled. Merged-In: I5ff8f710de2c54afc76b4af28108ca9075357ad1 Bug: 62127741 Test: Test sailfish w/ no status property, result: boots Test: Test with status = "disabled", result: skips mounting /vendor Test: Test with status = "ok", result: boots Change-Id: I5ff8f710de2c54afc76b4af28108ca9075357ad1 Signed-off-by: Sandeep Patil (cherry picked from commit be4302bf582ef9db2387b098bf80b4e5b6d1f0e9) --- fs_mgr/fs_mgr_fstab.cpp | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/fs_mgr/fs_mgr_fstab.cpp b/fs_mgr/fs_mgr_fstab.cpp index dc73c242f..70cd60878 100644 --- a/fs_mgr/fs_mgr_fstab.cpp +++ b/fs_mgr/fs_mgr_fstab.cpp @@ -352,6 +352,15 @@ static std::string read_fstab_from_dt() { std::vector fstab_entry; std::string file_name; std::string value; + // skip a partition entry if the status property is present and not set to ok + file_name = android::base::StringPrintf("%s/%s/status", fstabdir_name.c_str(), dp->d_name); + if (read_dt_file(file_name, &value)) { + if (value != "okay" && value != "ok") { + LINFO << "dt_fstab: Skip disabled entry for partition " << dp->d_name; + continue; + } + } + file_name = android::base::StringPrintf("%s/%s/dev", fstabdir_name.c_str(), dp->d_name); if (!read_dt_file(file_name, &value)) { LERROR << "dt_fstab: Failed to find device for partition " << dp->d_name;