[partition] Handle partition flag FlagEsp post KPMCore 3.3.0

This commit is contained in:
Adriaan de Groot 2019-03-20 16:37:50 +01:00
parent 2a2795c54c
commit 68f29ebf20
3 changed files with 4 additions and 2 deletions

View File

@ -36,9 +36,11 @@ class PartitionRole;
#ifdef WITH_KPMCOREGT33
#define KPM_PARTITION_FLAG(x) PartitionTable::Flag::x
#define KPM_PARTITION_STATE(x) Partition::State::x
#define KPM_PARTITION_FLAG_ESP PartitionTable::Flag::Boot
#else
#define KPM_PARTITION_FLAG(x) PartitionTable::Flag##x
#define KPM_PARTITION_STATE(x) Partition::State##x
#define KPM_PARTITION_FLAG_ESP PartitionTable::FlagEsp
#endif
/**

View File

@ -407,7 +407,7 @@ isEfiBootable( const Partition* candidate )
auto flags = PartitionInfo::flags( candidate );
/* If bit 17 is set, old-style Esp flag, it's OK */
if ( flags.testFlag( PartitionTable::FlagEsp ) )
if ( flags.testFlag( KPM_PARTITION_FLAG_ESP ) )
return true;
/* Otherwise, if it's a GPT table, Boot (bit 0) is the same as Esp */

View File

@ -133,7 +133,7 @@ doAutopartition( PartitionCoreModule* core, Device* dev, Choices::AutoPartitionO
);
PartitionInfo::setFormat( efiPartition, true );
PartitionInfo::setMountPoint( efiPartition, o.efiPartitionMountPoint );
core->createPartition( dev, efiPartition, PartitionTable::FlagEsp );
core->createPartition( dev, efiPartition, KPM_PARTITION_FLAG_ESP );
firstFreeSector = lastSector + 1;
}
else