summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authordhacker29 <dhackerdvm@gmail.com>2015-12-06 05:32:30 -0500
committerMichael Bestas <mkbestas@lineageos.org>2017-12-27 13:14:24 +0000
commit069602e4f7d3e14edc400a8ca312d3ee88d99545 (patch)
treec143ecc90e506e004bee877baef5dd89301cab24
parentc5df265dce568e476ccb93a54239111ad8c4417e (diff)
downloadandroid_system_vold-069602e4f7d3e14edc400a8ca312d3ee88d99545.tar.gz
android_system_vold-069602e4f7d3e14edc400a8ca312d3ee88d99545.tar.bz2
android_system_vold-069602e4f7d3e14edc400a8ca312d3ee88d99545.zip
vold: Native NTFS kernel driver support
Change-Id: I825b2840a03e5cdab9b68f13fd5170acbbcec2e5
-rw-r--r--Android.mk4
-rw-r--r--fs/Ntfs.cpp12
2 files changed, 16 insertions, 0 deletions
diff --git a/Android.mk b/Android.mk
index f759047..29a7852 100644
--- a/Android.mk
+++ b/Android.mk
@@ -118,6 +118,10 @@ ifeq ($(TARGET_KERNEL_HAVE_EXFAT),true)
vold_cflags += -DCONFIG_KERNEL_HAVE_EXFAT
endif
+ifeq ($(TARGET_KERNEL_HAVE_NTFS),true)
+ vold_cflags += -DCONFIG_KERNEL_HAVE_NTFS
+endif
+
include $(CLEAR_VARS)
LOCAL_ADDITIONAL_DEPENDENCIES := $(LOCAL_PATH)/Android.mk
diff --git a/fs/Ntfs.cpp b/fs/Ntfs.cpp
index 81d5d15..76330b4 100644
--- a/fs/Ntfs.cpp
+++ b/fs/Ntfs.cpp
@@ -33,7 +33,11 @@ namespace ntfs {
static const char* kMkfsPath = "/system/bin/mkfs.ntfs";
static const char* kFsckPath = "/system/bin/fsck.ntfs";
+#ifdef CONFIG_KERNEL_HAVE_NTFS
+static const char* kMountPath = "/system/bin/mount";
+#else
static const char* kMountPath = "/system/bin/mount.ntfs";
+#endif
bool IsSupported() {
return access(kMkfsPath, X_OK) == 0
@@ -61,8 +65,12 @@ status_t Mount(const std::string& source, const std::string& target, bool ro,
const char* c_target = target.c_str();
sprintf(mountData,
+#ifdef CONFIG_KERNEL_HAVE_NTFS
+ "utf8,uid=%d,gid=%d,fmask=%o,dmask=%o,nodev,nosuid",
+#else
"utf8,uid=%d,gid=%d,fmask=%o,dmask=%o,"
"shortname=mixed,nodev,nosuid,dirsync",
+#endif
ownerUid, ownerGid, permMask, permMask);
if (!executable)
@@ -74,6 +82,10 @@ status_t Mount(const std::string& source, const std::string& target, bool ro,
std::vector<std::string> cmd;
cmd.push_back(kMountPath);
+#ifdef CONFIG_KERNEL_HAVE_NTFS
+ cmd.push_back("-t");
+ cmd.push_back("ntfs");
+#endif
cmd.push_back("-o");
cmd.push_back(mountData);
cmd.push_back(c_source);