OSDN Git Service

vold3: check supported filesystem modules marshmallow-x86 android-x86-6.0-r3
authorChih-Wei Huang <cwhuang@linux.org.tw>
Sat, 25 Mar 2017 16:47:42 +0000 (00:47 +0800)
committerChih-Wei Huang <cwhuang@linux.org.tw>
Sat, 25 Mar 2017 16:47:42 +0000 (00:47 +0800)
If there is a filesystem module of the requested type,
it should be considered supported.

Note the kernel will auto load the filesystem module
on mounting by modprobe.

Utils.cpp

index fea7dab..a420fe7 100644 (file)
--- a/Utils.cpp
+++ b/Utils.cpp
@@ -26,6 +26,7 @@
 #include <base/stringprintf.h>
 #include <cutils/fs.h>
 #include <cutils/properties.h>
+#include <cutils/probe_module.h>
 #include <private/android_filesystem_config.h>
 #include <logwrap/logwrap.h>
 
@@ -542,7 +543,15 @@ bool IsFilesystemSupported(const std::string& fsType) {
     supported.append("fuse\tntfs\n"
                      "fuse\texfat\n");
 
-    return supported.find(fsType + "\n") != std::string::npos;
+    if (supported.find(fsType + "\n") != std::string::npos) {
+        return true;
+    }
+
+    // Check if there is a filesystem module available
+    char fs[PATH_MAX];
+    get_default_mod_path(fs);
+    supported = StringPrintf("%skernel/fs/%s", fs, fsType.c_str());
+    return !access(supported.c_str(), F_OK);
 }
 
 status_t WipeBlockDevice(const std::string& path) {