[partition] winnow floppy drives

- don't list floppy drives

FIXES #1393
main
Adriaan de Groot 5 years ago
parent a78c368367
commit 948c078e1a

@ -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;

Loading…
Cancel
Save