Do not label swap devices as mountable or containing a filesystem

pull/16/head
Timothy Pearson 11 years ago
parent 26a59d1ea7
commit 4730b89323

@ -4311,7 +4311,7 @@ TDEGenericDevice* TDEHardwareDevices::classifyUnknownDevice(udev_device* dev, TD
diskstatus = diskstatus | TDEDiskDeviceStatus::Hotpluggable;
}
if ((filesystemtype.upper() != "CRYPTO_LUKS") && (filesystemtype.upper() != "CRYPTO") && (!filesystemtype.isNull())) {
if ((filesystemtype.upper() != "CRYPTO_LUKS") && (filesystemtype.upper() != "CRYPTO") && (filesystemtype.upper() != "SWAP") && (!filesystemtype.isNull())) {
diskstatus = diskstatus | TDEDiskDeviceStatus::ContainsFilesystem;
}
@ -4328,6 +4328,10 @@ TDEGenericDevice* TDEHardwareDevices::classifyUnknownDevice(udev_device* dev, TD
diskstatus = diskstatus & ~TDEDiskDeviceStatus::Mountable;
}
}
// Swap partitions cannot be mounted
if (filesystemtype.upper() == "SWAP") {
diskstatus = diskstatus & ~TDEDiskDeviceStatus::Mountable;
}
// If certain disk types do not report the presence of a filesystem, they are likely not mountable
if ((disktype & TDEDiskDeviceType::HDD) || (disktype & TDEDiskDeviceType::Optical)) {
if (!(diskstatus & TDEDiskDeviceStatus::ContainsFilesystem)) {

Loading…
Cancel
Save