fs_mgr: Get additional supported fs from prop in recovery

Change-Id: I73ad8e92fe3dc1f402694579c1931c9a02dc908f
This commit is contained in:
Yumi Yukimura 2024-11-23 15:33:34 +08:00
parent 78e10dfc1b
commit 409de40ac2

View file

@ -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 <sys/mount.h>
@ -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<std::string> 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);