Fix for Cannot load etc/recovery.fstab when doing OTA upgrade
1.In ANP, the path of the executable file recovery is sbin/recovery, and in ANR it is system/bin/recovery
2.Add a judgment on whether sbin/recovery exists in fs_mgr_fstab.cpp,
Make it possible to correctly load etc/recovery.fstab in recovery mode
Bug: 237368169
Change-Id: I8df76a003bc2edbaa01d9dd173a0cba1401ef3ac
diff --git a/fs_mgr/fs_mgr_fstab.cpp b/fs_mgr/fs_mgr_fstab.cpp
index fc200b2..4940610 100644
--- a/fs_mgr/fs_mgr_fstab.cpp
+++ b/fs_mgr/fs_mgr_fstab.cpp
@@ -825,7 +825,7 @@
std::string default_fstab_path;
// Use different fstab paths for normal boot and recovery boot, respectively
- if (access("/system/bin/recovery", F_OK) == 0) {
+ if ((access("/sbin/recovery", F_OK) == 0) || (access("/system/bin/recovery", F_OK) == 0)) {
default_fstab_path = "/etc/recovery.fstab";
} else { // normal boot
default_fstab_path = GetFstabPath();