Merge "fs_mgr: use different fstab paths for normal/recovery boot" am: 9c59029add am: 07052c0509

am: 4ba8d8b5bf

Change-Id: Id3b713b7d132bc1e500a24aa79598350868470d3
This commit is contained in:
Tao Bao 2017-03-27 19:37:12 +00:00 committed by android-build-merger
commit 9d3760e3b3
1 changed files with 4 additions and 1 deletions

View File

@ -692,7 +692,10 @@ struct fstab *fs_mgr_read_fstab_default()
std::string hw;
std::string default_fstab;
if (fs_mgr_get_boot_config("hardware", &hw)) {
// Use different fstab paths for normal boot and recovery boot, respectively
if (access("/sbin/recovery", F_OK) == 0) {
default_fstab = "/etc/recovery.fstab";
} else if (fs_mgr_get_boot_config("hardware", &hw)) { // normal boot
for (const char *prefix : {"/odm/etc/fstab.","/vendor/etc/fstab.", "/fstab."}) {
default_fstab = prefix + hw;
if (access(default_fstab.c_str(), F_OK) == 0) break;