Force removable flag for flask disks in tdehwlib

This resolves Bug 2473

Signed-off-by: Slávek Banko <slavek.banko@axis.cz>
(cherry picked from commit dc350e6c64)
pull/16/head
Slávek Banko 8 years ago
parent fd96a6c2a8
commit 9b33264c99

@ -2656,6 +2656,16 @@ void TDEHardwareDevices::updateExistingDeviceInformation(TDEGenericDevice* exist
if (hotpluggable) {
diskstatus = diskstatus | TDEDiskDeviceStatus::Hotpluggable;
}
// Force removable flag for flash disks
// udev reports disks as non-removable for card readers on PCI controllers
if (((disktype & TDEDiskDeviceType::CompactFlash)
|| (disktype & TDEDiskDeviceType::MemoryStick)
|| (disktype & TDEDiskDeviceType::SmartMedia)
|| (disktype & TDEDiskDeviceType::SDMMC))
&& !(diskstatus & TDEDiskDeviceStatus::Removable)
&& !(diskstatus & TDEDiskDeviceStatus::Hotpluggable)) {
diskstatus = diskstatus | TDEDiskDeviceStatus::Removable;
}
if ((filesystemtype.upper() != "CRYPTO_LUKS") && (filesystemtype.upper() != "CRYPTO") && (filesystemtype.upper() != "SWAP") && (!filesystemtype.isNull())) {
diskstatus = diskstatus | TDEDiskDeviceStatus::ContainsFilesystem;

Loading…
Cancel
Save