VeraCrypt
aboutsummaryrefslogtreecommitdiff
path: root/src/Main/Forms/VolumeCreationWizard.cpp
diff options
context:
space:
mode:
authorMounir IDRASSI <mounir.idrassi@idrix.fr>2020-08-05 00:05:18 (GMT)
committerMounir IDRASSI <mounir.idrassi@idrix.fr>2020-08-05 00:08:12 (GMT)
commit388e44c8095c04eac53ca6500363ebfb0d8f14bb (patch)
tree4d0439848321a308f63d51edcc559695b10fb9db /src/Main/Forms/VolumeCreationWizard.cpp
parentc8b501062d31afb37168f676fa3168ad8b1e9007 (diff)
downloadVeraCrypt-388e44c8095c04eac53ca6500363ebfb0d8f14bb.zip
VeraCrypt-388e44c8095c04eac53ca6500363ebfb0d8f14bb.tar.gz
Linux: Add support for Btrfs filesystem when creating volumes
Diffstat (limited to 'src/Main/Forms/VolumeCreationWizard.cpp')
-rw-r--r--src/Main/Forms/VolumeCreationWizard.cpp23
1 files changed, 4 insertions, 19 deletions
diff --git a/src/Main/Forms/VolumeCreationWizard.cpp b/src/Main/Forms/VolumeCreationWizard.cpp
index 37af636..4df2030 100644
--- a/src/Main/Forms/VolumeCreationWizard.cpp
+++ b/src/Main/Forms/VolumeCreationWizard.cpp
@@ -466,25 +466,7 @@ namespace VeraCrypt
#ifdef TC_UNIX
// Format non-FAT filesystem
- const char *fsFormatter = nullptr;
-
- switch (SelectedFilesystemType)
- {
-#if defined (TC_LINUX)
- case VolumeCreationOptions::FilesystemType::Ext2: fsFormatter = "mkfs.ext2"; break;
- case VolumeCreationOptions::FilesystemType::Ext3: fsFormatter = "mkfs.ext3"; break;
- case VolumeCreationOptions::FilesystemType::Ext4: fsFormatter = "mkfs.ext4"; break;
- case VolumeCreationOptions::FilesystemType::NTFS: fsFormatter = "mkfs.ntfs"; break;
- case VolumeCreationOptions::FilesystemType::exFAT: fsFormatter = "mkfs.exfat"; break;
-#elif defined (TC_MACOSX)
- case VolumeCreationOptions::FilesystemType::MacOsExt: fsFormatter = "newfs_hfs"; break;
- case VolumeCreationOptions::FilesystemType::exFAT: fsFormatter = "newfs_exfat"; break;
- case VolumeCreationOptions::FilesystemType::APFS: fsFormatter = "newfs_apfs"; break;
-#elif defined (TC_FREEBSD) || defined (TC_SOLARIS)
- case VolumeCreationOptions::FilesystemType::UFS: fsFormatter = "newfs" ; break;
-#endif
- default: break;
- }
+ const char *fsFormatter = VolumeCreationOptions::FilesystemType::GetFsFormatter (SelectedFilesystemType);
if (fsFormatter)
{
@@ -544,6 +526,9 @@ namespace VeraCrypt
if (SelectedFilesystemType == VolumeCreationOptions::FilesystemType::NTFS)
args.push_back ("-f");
+ if (SelectedFilesystemType == VolumeCreationOptions::FilesystemType::Btrfs)
+ args.push_back ("-f");
+
args.push_back (string (virtualDevice));
Process::Execute (fsFormatter, args);