system/vold
Revision | 270192528a107136329f36de30fa345226b4c880 (tree) |
---|---|
Zeit | 2020-05-05 01:49:35 |
Autor | Chih-Wei Huang <cwhuang@linu...> |
Commiter | Chih-Wei Huang |
Support mounting exfat via fuse
@@ -563,7 +563,8 @@ bool IsFilesystemSupported(const std::string& fsType) { | ||
563 | 563 | } |
564 | 564 | |
565 | 565 | /* fuse filesystems */ |
566 | - supported.append("fuse\tntfs\n"); | |
566 | + supported.append("fuse\tntfs\n" | |
567 | + "fuse\texfat\n"); | |
567 | 568 | |
568 | 569 | if (supported.find(fsType + "\n") != std::string::npos) { |
569 | 570 | return true; |
@@ -32,6 +32,7 @@ namespace exfat { | ||
32 | 32 | |
33 | 33 | static const char* kMkfsPath = "/system/bin/mkfs.exfat"; |
34 | 34 | static const char* kFsckPath = "/system/bin/fsck.exfat"; |
35 | +static const char* kMountPath = "/system/bin/mount.exfat"; | |
35 | 36 | |
36 | 37 | bool IsSupported() { |
37 | 38 | return access(kMkfsPath, X_OK) == 0 && access(kFsckPath, X_OK) == 0 && |
@@ -70,7 +71,18 @@ status_t Mount(const std::string& source, const std::string& target, int ownerUi | ||
70 | 71 | return 0; |
71 | 72 | } |
72 | 73 | |
73 | - return -1; | |
74 | + mountData = android::base::StringPrintf( | |
75 | + "noatime,nodev,nosuid,dirsync,uid=%d,gid=%d,fmask=%o,dmask=%o,noexec,rw", | |
76 | + ownerUid, ownerGid, permMask, permMask); | |
77 | + | |
78 | + std::vector<std::string> cmd; | |
79 | + cmd.push_back(kMountPath); | |
80 | + cmd.push_back("-o"); | |
81 | + cmd.push_back(mountData); | |
82 | + cmd.push_back(source); | |
83 | + cmd.push_back(target); | |
84 | + | |
85 | + return ForkExecvp(cmd); | |
74 | 86 | } |
75 | 87 | |
76 | 88 | status_t Format(const std::string& source) { |