From 336b8c758aa6974fcccde3a2d93a14a6c86746b3 Mon Sep 17 00:00:00 2001 From: Adriaan de Groot Date: Wed, 16 May 2018 07:28:30 -0400 Subject: [PATCH] [partition] Consider the future flags when checking EFI bootability - If we're changing the flags to enable EFI boot, then that's enough to satisfy the (future) EFI bootability check. This is for issue #622 as well. Fixes #884. --- src/modules/partition/core/PartUtils.cpp | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/modules/partition/core/PartUtils.cpp b/src/modules/partition/core/PartUtils.cpp index 775fcee66..2c2944997 100644 --- a/src/modules/partition/core/PartUtils.cpp +++ b/src/modules/partition/core/PartUtils.cpp @@ -22,6 +22,7 @@ #include "core/DeviceModel.h" #include "core/KPMHelpers.h" +#include "core/PartitionInfo.h" #include "core/PartitionIterator.h" #include @@ -343,8 +344,10 @@ isEfiSystem() bool isEfiBootable( const Partition* candidate ) { + auto flags = PartitionInfo::flags( candidate ); + /* If bit 17 is set, old-style Esp flag, it's OK */ - if ( candidate->activeFlags().testFlag( PartitionTable::FlagEsp ) ) + if ( flags.testFlag( PartitionTable::FlagEsp ) ) return true; @@ -359,7 +362,7 @@ isEfiBootable( const Partition* candidate ) const PartitionTable* table = dynamic_cast( root ); return table && ( table->type() == PartitionTable::TableType::gpt ) && - candidate->activeFlags().testFlag( PartitionTable::FlagBoot ); + flags.testFlag( PartitionTable::FlagBoot ); } } // nmamespace PartUtils