Extend vold support for creating ext4 images.
Augment the Ext4::format function to take
a mountpoint parameter. This will then
be passed to make_ext4fs through the
-a option to allow proper security labeling.
Change-Id: Ic26703406a2c463c12e32c8103a0c75c727b7d29
diff --git a/VolumeManager.cpp b/VolumeManager.cpp
index 1c48932..9867bbb 100644
--- a/VolumeManager.cpp
+++ b/VolumeManager.cpp
@@ -379,8 +379,12 @@
if (wantFilesystem) {
int formatStatus;
+ char mountPoint[255];
+
+ snprintf(mountPoint, sizeof(mountPoint), "%s/%s", Volume::ASECDIR, id);
+
if (usingExt4) {
- formatStatus = Ext4::format(dmDevice);
+ formatStatus = Ext4::format(dmDevice, mountPoint);
} else {
formatStatus = Fat::format(dmDevice, numImgSectors);
}
@@ -395,9 +399,6 @@
return -1;
}
- char mountPoint[255];
-
- snprintf(mountPoint, sizeof(mountPoint), "%s/%s", Volume::ASECDIR, id);
if (mkdir(mountPoint, 0000)) {
if (errno != EEXIST) {
SLOGE("Mountpoint creation failed (%s)", strerror(errno));