[partition] Use FlagEsp instead of sgdisk to scan for ESPs.
Address an old FIXME in PartitionCoreModule::scanForEfiSystemPartitions(): Check the FlagEsp on the Partition object (that KPMcore has been supporting since 2.1.0) instead of running sgdisk.
This commit is contained in:
parent
5377003f89
commit
1548fe4810
@ -548,30 +548,15 @@ PartitionCoreModule::scanForEfiSystemPartitions()
|
|||||||
devices.append( device );
|
devices.append( device );
|
||||||
}
|
}
|
||||||
|
|
||||||
//FIXME: Unfortunately right now we have to call sgdisk manually because
|
|
||||||
// the KPM submodule does not expose the ESP flag from libparted.
|
|
||||||
// The following findPartitions call and lambda should be scrapped and
|
|
||||||
// rewritten based on libKPM. -- Teo 5/2015
|
|
||||||
QList< Partition* > efiSystemPartitions =
|
QList< Partition* > efiSystemPartitions =
|
||||||
KPMHelpers::findPartitions( devices,
|
KPMHelpers::findPartitions( devices,
|
||||||
[]( Partition* partition ) -> bool
|
[]( Partition* partition ) -> bool
|
||||||
{
|
{
|
||||||
QProcess process;
|
if ( partition->activeFlags().testFlag( PartitionTable::FlagEsp ) )
|
||||||
process.setProgram( "sgdisk" );
|
|
||||||
process.setArguments( { "-i",
|
|
||||||
QString::number( partition->number() ),
|
|
||||||
partition->devicePath() } );
|
|
||||||
process.setProcessChannelMode( QProcess::MergedChannels );
|
|
||||||
process.start();
|
|
||||||
if ( process.waitForFinished() )
|
|
||||||
{
|
|
||||||
if ( process.readAllStandardOutput()
|
|
||||||
.contains( "C12A7328-F81F-11D2-BA4B-00A0C93EC93B" ) )
|
|
||||||
{
|
{
|
||||||
cDebug() << "Found EFI system partition at" << partition->partitionPath();
|
cDebug() << "Found EFI system partition at" << partition->partitionPath();
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
}
|
|
||||||
return false;
|
return false;
|
||||||
} );
|
} );
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user