vold: Allow creation of a container with no filesystem

Signed-off-by: San Mehat <san@google.com>
This commit is contained in:
San Mehat 2010-02-28 20:17:20 -08:00
parent 55013f7131
commit a1091cb0c4

View file

@ -219,6 +219,11 @@ int VolumeManager::createAsec(const char *id, unsigned int numSectors,
strcpy(dmDevice, loopDevice);
}
if (strcmp(fstype, "none")) {
if (strcmp(fstype, "fat")) {
LOGW("Unknown fstype '%s' specified for container", fstype);
}
if (Fat::format(dmDevice)) {
LOGE("ASEC FAT format failed (%s)", strerror(errno));
if (cleanupDm) {
@ -228,7 +233,6 @@ int VolumeManager::createAsec(const char *id, unsigned int numSectors,
unlink(asecFileName);
return -1;
}
char mountPoint[255];
snprintf(mountPoint, sizeof(mountPoint), "%s/%s", Volume::ASECDIR, id);
@ -246,7 +250,6 @@ int VolumeManager::createAsec(const char *id, unsigned int numSectors,
if (Fat::doMount(dmDevice, mountPoint, false, false, ownerUid,
0, 0000, false)) {
// 0, 0007, false)) {
LOGE("ASEC FAT mount failed (%s)", strerror(errno));
if (cleanupDm) {
Devmapper::destroy(id);
@ -255,6 +258,9 @@ int VolumeManager::createAsec(const char *id, unsigned int numSectors,
unlink(asecFileName);
return -1;
}
} else {
LOGI("Created raw secure container %s (no filesystem)", id);
}
mActiveContainers->push_back(strdup(id));
return 0;