diff --git a/src/modules/partition/core/DeviceList.cpp b/src/modules/partition/core/DeviceList.cpp index 944940d9a..1eb7d26eb 100644 --- a/src/modules/partition/core/DeviceList.cpp +++ b/src/modules/partition/core/DeviceList.cpp @@ -92,6 +92,19 @@ isIso9660( const Device* device ) return false; } +static inline bool +isZRam( const Device* device ) +{ + const QString path = device->deviceNode(); + return path.startswith( "/dev/zram" ); +} + +static inline bool +isFloppyDrive( const Device* device ) +{ + const QString path = device->deviceNode(); + return path.startswith( "/dev/fd" ) || path.startswith( "/dev/floppy" ); +} static inline QDebug& operator<<( QDebug& s, QList< Device* >::iterator& it ) @@ -138,11 +151,16 @@ getDevices( DeviceType which, qint64 minimumSize ) cDebug() << Logger::SubEntry << "Skipping nullptr device"; it = erase( devices, it ); } - else if ( ( *it )->deviceNode().startsWith( "/dev/zram" ) ) + else if ( isZRam( *it ) ) { cDebug() << Logger::SubEntry << "Removing zram" << it; it = erase( devices, it ); } + else if ( isFloppyDrive( ( *it ) ) ) + { + cDebug() << Logger::SubEntry << "Removing floppy disk" << it; + it = erase( devices, it ); + } else if ( writableOnly && hasRootPartition( *it ) ) { cDebug() << Logger::SubEntry << "Removing device with root filesystem (/) on it" << it;