#include "Volume.h"
#include "VolumeManager.h"
#include "ResponseCode.h"
+#include "Ext4.h"
#include "Fat.h"
#include "Ntfs.h"
#include "Exfat.h"
if (strcmp(fstype, "exfat") == 0) {
ret = Exfat::format(devicePath);
+ } else if (strcmp(fstype, "ext4") == 0) {
+ ret = Ext4::format(devicePath, 0, NULL);
} else if (strcmp(fstype, "ntfs") == 0) {
ret = Ntfs::format(devicePath, wipe);
} else {
continue;
}
+ } else if (strcmp(fstype, "ext4") == 0) {
+
+ if (Ext4::check(devicePath)) {
+ errno = EIO;
+ /* Badness - abort the mount */
+ SLOGE("%s failed FS checks (%s)", devicePath, strerror(errno));
+ setState(Volume::State_Idle);
+ free(fstype);
+ return -1;
+ }
+
+ if (Ext4::doMount(devicePath, getMountpoint(), false, false, false)) {
+ SLOGE("%s failed to mount via EXT4 (%s)\n", devicePath, strerror(errno));
+ continue;
+ }
+
} else if (strcmp(fstype, "ntfs") == 0) {
if (Ntfs::doMount(devicePath, getMountpoint(), false, false, false,