[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,29 +548,14 @@ PartitionCoreModule::scanForEfiSystemPartitions()
|
||||
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 =
|
||||
KPMHelpers::findPartitions( devices,
|
||||
[]( Partition* partition ) -> bool
|
||||
{
|
||||
QProcess process;
|
||||
process.setProgram( "sgdisk" );
|
||||
process.setArguments( { "-i",
|
||||
QString::number( partition->number() ),
|
||||
partition->devicePath() } );
|
||||
process.setProcessChannelMode( QProcess::MergedChannels );
|
||||
process.start();
|
||||
if ( process.waitForFinished() )
|
||||
if ( partition->activeFlags().testFlag( PartitionTable::FlagEsp ) )
|
||||
{
|
||||
if ( process.readAllStandardOutput()
|
||||
.contains( "C12A7328-F81F-11D2-BA4B-00A0C93EC93B" ) )
|
||||
{
|
||||
cDebug() << "Found EFI system partition at" << partition->partitionPath();
|
||||
return true;
|
||||
}
|
||||
cDebug() << "Found EFI system partition at" << partition->partitionPath();
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
} );
|
||||
|
Loading…
Reference in New Issue
Block a user