From 7e7b7a156aeb14d264de0601c341d64b42fd07a0 Mon Sep 17 00:00:00 2001 From: Jiyong Park Date: Tue, 2 Mar 2021 12:38:22 +0900 Subject: [PATCH] Search fstab also from /first_stage_ramdisk I828ce999be6d786bf46dd5655dfda81d046906ab made a slight behaviral change that fstab is searched and read before /first_stage_ramdisk is mounted as root. Without this change, the attempt to read fstab from / fails at the moment, leaving an empty fstab object. But as a side effect of the attempt, DoCreateDevices() is not called again even after /first_stage_ramdisk is mounted as root and the fstab is found under /. This change fixes the problem by adding /first_stage_ramdisk to the list of places to find the fstab file. Bug: N/A Test: Watch TH Change-Id: I9826610cce436ba706aaea14c9a991822d2bae96 --- fs_mgr/fs_mgr_fstab.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/fs_mgr/fs_mgr_fstab.cpp b/fs_mgr/fs_mgr_fstab.cpp index 8ac3361b7..785a8e08a 100644 --- a/fs_mgr/fs_mgr_fstab.cpp +++ b/fs_mgr/fs_mgr_fstab.cpp @@ -412,7 +412,8 @@ std::string GetFstabPath() { if (!fs_mgr_get_boot_config(prop, &suffix)) continue; - for (const char* prefix : {"/odm/etc/fstab.", "/vendor/etc/fstab.", "/fstab."}) { + for (const char* prefix : + {"/odm/etc/fstab.", "/vendor/etc/fstab.", "/fstab.", "/first_stage_ramdisk/fstab."}) { std::string fstab_path = prefix + suffix; if (access(fstab_path.c_str(), F_OK) == 0) { return fstab_path;