diff options
-rw-r--r-- | Android.mk | 4 | ||||
-rw-r--r-- | fs/Ntfs.cpp | 12 |
2 files changed, 16 insertions, 0 deletions
@@ -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); |