Fixes for devices with internal FAT file system:
Only share a single partition via UMS if a specific partition
is specified in vold.fstab (rather than "auto")
Do not fail to reformat if MBR cannot be found.
Change-Id: I544ca2ee325c308af656ab9f4732c788a964c156
Signed-off-by: Mike Lockwood <[email protected]>
diff --git a/VolumeManager.cpp b/VolumeManager.cpp
index 231b308..b53e7b1 100644
--- a/VolumeManager.cpp
+++ b/VolumeManager.cpp
@@ -1036,7 +1036,7 @@
return -1;
}
- dev_t d = v->getDiskDevice();
+ dev_t d = v->getShareDevice();
if ((MAJOR(d) == 0) && (MINOR(d) == 0)) {
// This volume does not support raw disk access
errno = EINVAL;
@@ -1084,14 +1084,7 @@
return -1;
}
- dev_t d = v->getDiskDevice();
-
int fd;
- char nodepath[255];
- snprintf(nodepath,
- sizeof(nodepath), "/dev/block/vold/%d:%d",
- MAJOR(d), MINOR(d));
-
if ((fd = open("/sys/devices/platform/usb_mass_storage/lun0/file", O_WRONLY)) < 0) {
SLOGE("Unable to open ums lunfile (%s)", strerror(errno));
return -1;