Replacing fs_mgr_read_fstab() with new fs_mgr APIs
The fstab settings of early-mounted partitions (e.g., /vendor)
will be in kernel device tree. Switch to the new API to get the
whole settings with those in device tree:
fs_mgr_read_fstab_with_dt("/fstab.device")
The original default /fstab.{ro.hardware} might be moved to
/vendor/etc/. or /odm/etc/. Use another new API to get the default
fstab instead of using the hard-coded /fstab.{ro.hardware}.
This API also includes the settings from device tree:
fs_mgr_read_fstab_default()
Bug: 35811655
Test: boot sailfish
Change-Id: If8361d891e17fa98b407b0e70f9f8984afcbcfe7
diff --git a/utils_android.cc b/utils_android.cc
index a4f1ea8..bda7337 100644
--- a/utils_android.cc
+++ b/utils_android.cc
@@ -28,16 +28,11 @@
// Open the appropriate fstab file and fallback to /fstab.device if
// that's what's being used.
static struct fstab* OpenFSTab() {
- char propbuf[PROPERTY_VALUE_MAX];
- struct fstab* fstab;
-
- property_get("ro.hardware", propbuf, "");
- string fstab_name = string("/fstab.") + propbuf;
- fstab = fs_mgr_read_fstab(fstab_name.c_str());
+ struct fstab* fstab = fs_mgr_read_fstab_default();
if (fstab != nullptr)
return fstab;
- fstab = fs_mgr_read_fstab("/fstab.device");
+ fstab = fs_mgr_read_fstab_with_dt("/fstab.device");
return fstab;
}