[libcalamares] Introduce new function getPartitionTable

This commit is contained in:
Gaël PORTAY 2020-10-28 10:11:57 -04:00
parent c963d8905f
commit bf9c9a64f1
3 changed files with 20 additions and 14 deletions

View file

@ -454,20 +454,7 @@ isEfiBootable( const Partition* candidate )
}
/* Otherwise, if it's a GPT table, Boot (bit 0) is the same as Esp */
const PartitionNode* root = candidate;
while ( root && !root->isRoot() )
{
root = root->parent();
}
// Strange case: no root found, no partition table node?
if ( !root )
{
cWarning() << "No root of partition table found.";
return false;
}
const PartitionTable* table = dynamic_cast< const PartitionTable* >( root );
const PartitionTable* table = CalamaresUtils::Partition::getPartitionTable( candidate );
if ( !table )
{
cWarning() << "Root of partition table is not a PartitionTable object";