diff --git a/fs_mgr/fs_mgr_roots.cpp b/fs_mgr/fs_mgr_roots.cpp index 918e243de..444507651 100644 --- a/fs_mgr/fs_mgr_roots.cpp +++ b/fs_mgr/fs_mgr_roots.cpp @@ -15,6 +15,8 @@ */ #include "android-base/file.h" +#include "android-base/properties.h" +#include "android-base/strings.h" #include "fs_mgr/roots.h" #include @@ -30,6 +32,9 @@ namespace android { namespace fs_mgr { +#if defined(__ANDROID_RECOVERY__) +static constexpr const char* kSupportedFsProp = "ro.recovery.supported_fs"; +#endif static constexpr const char* kSystemRoot = "/system"; static bool gDidMapLogicalPartitions = false; @@ -118,8 +123,18 @@ bool TryPathMount(FstabEntry* rec, const std::string& mount_pt) { static const std::vector supported_fs{"ext4", "squashfs", "vfat", "exfat", "f2fs", "erofs", "none"}; if (std::find(supported_fs.begin(), supported_fs.end(), rec->fs_type) == supported_fs.end()) { +#if defined(__ANDROID_RECOVERY__) + auto supported_fs_from_prop = + android::base::Split(android::base::GetProperty(kSupportedFsProp, ""), ","); + if (std::find(supported_fs_from_prop.begin(), supported_fs_from_prop.end(), rec->fs_type) == + supported_fs_from_prop.end()) { + LERROR << "unknown fs_type \"" << rec->fs_type << "\" for " << mount_point; + return false; + } +#else LERROR << "unknown fs_type \"" << rec->fs_type << "\" for " << mount_point; return false; +#endif } int result = fs_mgr_do_mount_one(*rec, mount_point);