|
|
|
@ -340,4 +340,26 @@ isEfiSystem()
|
|
|
|
|
return QDir( "/sys/firmware/efi/efivars" ).exists();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
bool
|
|
|
|
|
isEfiBootable( const Partition* candidate )
|
|
|
|
|
{
|
|
|
|
|
/* If bit 17 is set, old-style Esp flag, it's OK */
|
|
|
|
|
if ( candidate->activeFlags().testFlag( PartitionTable::FlagEsp ) )
|
|
|
|
|
return true;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/* 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 )
|
|
|
|
|
return false;
|
|
|
|
|
|
|
|
|
|
const PartitionTable* table = dynamic_cast<const PartitionTable*>( root );
|
|
|
|
|
return table && ( table->type() == PartitionTable::TableType::gpt ) &&
|
|
|
|
|
candidate->activeFlags().testFlag( PartitionTable::FlagBoot );
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
} // nmamespace PartUtils
|
|
|
|
|