From be4302bf582ef9db2387b098bf80b4e5b6d1f0e9 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. 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 --- 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 0a694c145..7d09d011d 100644 --- a/fs_mgr/fs_mgr_fstab.cpp +++ b/fs_mgr/fs_mgr_fstab.cpp @@ -397,6 +397,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;