[partition] Cut down log-spam while checking for resize
This commit is contained in:
parent
857aaa6ca4
commit
cf1128b719
@ -126,23 +126,22 @@ canBeResized( Partition* candidate, const Logger::Once& o )
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
cDebug() << o << "Checking if" << convenienceName( candidate ) << "can be resized.";
|
|
||||||
if ( !candidate->fileSystem().supportGrow() || !candidate->fileSystem().supportShrink() )
|
if ( !candidate->fileSystem().supportGrow() || !candidate->fileSystem().supportShrink() )
|
||||||
{
|
{
|
||||||
cDebug() << Logger::SubEntry << "NO, filesystem" << candidate->fileSystem().name()
|
cDebug() << o << "Can not resize" << convenienceName( candidate ) << ", filesystem"
|
||||||
<< "does not support resize.";
|
<< candidate->fileSystem().name() << "does not support resize.";
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
if ( isPartitionFreeSpace( candidate ) )
|
if ( isPartitionFreeSpace( candidate ) )
|
||||||
{
|
{
|
||||||
cDebug() << Logger::SubEntry << "NO, partition is free space";
|
cDebug() << o << "Can not resize" << convenienceName( candidate ) << ", partition is free space";
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
if ( candidate->isMounted() )
|
if ( candidate->isMounted() )
|
||||||
{
|
{
|
||||||
cDebug() << Logger::SubEntry << "NO, partition is mounted";
|
cDebug() << o << "Can not resize" << convenienceName( candidate ) << ", partition is mounted";
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -151,14 +150,14 @@ canBeResized( Partition* candidate, const Logger::Once& o )
|
|||||||
PartitionTable* table = dynamic_cast< PartitionTable* >( candidate->parent() );
|
PartitionTable* table = dynamic_cast< PartitionTable* >( candidate->parent() );
|
||||||
if ( !table )
|
if ( !table )
|
||||||
{
|
{
|
||||||
cDebug() << Logger::SubEntry << "NO, no partition table found";
|
cDebug() << o << "Can not resize" << convenienceName( candidate ) << ", no partition table found";
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
if ( table->numPrimaries() >= table->maxPrimaries() )
|
if ( table->numPrimaries() >= table->maxPrimaries() )
|
||||||
{
|
{
|
||||||
cDebug() << Logger::SubEntry << "NO, partition table already has" << table->maxPrimaries()
|
cDebug() << o << "Can not resize" << convenienceName( candidate ) << ", partition table already has"
|
||||||
<< "primary partitions.";
|
<< table->maxPrimaries() << "primary partitions.";
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -167,7 +166,8 @@ canBeResized( Partition* candidate, const Logger::Once& o )
|
|||||||
double requiredStorageGiB = getRequiredStorageGiB( ok );
|
double requiredStorageGiB = getRequiredStorageGiB( ok );
|
||||||
if ( !ok )
|
if ( !ok )
|
||||||
{
|
{
|
||||||
cDebug() << Logger::SubEntry << "NO, requiredStorageGiB is not set correctly.";
|
cDebug() << o << "Can not resize" << convenienceName( candidate )
|
||||||
|
<< ", requiredStorageGiB is not set correctly.";
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -200,24 +200,25 @@ canBeResized( Partition* candidate, const Logger::Once& o )
|
|||||||
bool
|
bool
|
||||||
canBeResized( DeviceModel* dm, const QString& partitionPath, const Logger::Once& o )
|
canBeResized( DeviceModel* dm, const QString& partitionPath, const Logger::Once& o )
|
||||||
{
|
{
|
||||||
cDebug() << o << "Checking if" << partitionPath << "can be resized.";
|
if ( partitionPath.startsWith( "/dev/" ) )
|
||||||
QString partitionWithOs = partitionPath;
|
|
||||||
if ( partitionWithOs.startsWith( "/dev/" ) )
|
|
||||||
{
|
{
|
||||||
for ( int i = 0; i < dm->rowCount(); ++i )
|
for ( int i = 0; i < dm->rowCount(); ++i )
|
||||||
{
|
{
|
||||||
Device* dev = dm->deviceForIndex( dm->index( i ) );
|
Device* dev = dm->deviceForIndex( dm->index( i ) );
|
||||||
Partition* candidate = CalamaresUtils::Partition::findPartitionByPath( { dev }, partitionWithOs );
|
Partition* candidate = CalamaresUtils::Partition::findPartitionByPath( { dev }, partitionPath );
|
||||||
if ( candidate )
|
if ( candidate )
|
||||||
{
|
{
|
||||||
return canBeResized( candidate, o );
|
return canBeResized( candidate, o );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
cDebug() << Logger::SubEntry << "no Partition* found for" << partitionWithOs;
|
cWarning() << "Can not resize" << partitionPath << ", no Partition* found.";
|
||||||
}
|
|
||||||
|
|
||||||
cDebug() << Logger::SubEntry << "Partition" << partitionWithOs << "CANNOT BE RESIZED FOR AUTOINSTALL.";
|
|
||||||
return false;
|
return false;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
cWarning() << "Can not resize" << partitionPath << ", does not start with /dev";
|
||||||
|
return false;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -262,7 +263,8 @@ lookForFstabEntries( const QString& partitionPath )
|
|||||||
const int lineCount = fstabEntries.count();
|
const int lineCount = fstabEntries.count();
|
||||||
std::remove_if(
|
std::remove_if(
|
||||||
fstabEntries.begin(), fstabEntries.end(), []( const FstabEntry& x ) { return !x.isValid(); } );
|
fstabEntries.begin(), fstabEntries.end(), []( const FstabEntry& x ) { return !x.isValid(); } );
|
||||||
cDebug() << Logger::SubEntry << "got" << fstabEntries.count() << "fstab entries from" << lineCount << "lines in" << fstabFile.fileName();
|
cDebug() << Logger::SubEntry << "got" << fstabEntries.count() << "fstab entries from" << lineCount
|
||||||
|
<< "lines in" << fstabFile.fileName();
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
Loading…
Reference in New Issue
Block a user