From 092529da45c67088c3469f1c0d37e07460bb1b48 Mon Sep 17 00:00:00 2001 From: Adriaan de Groot Date: Mon, 19 Feb 2018 10:25:00 -0500 Subject: [PATCH] [partition] WIP: EFI partition search - Add some logging (not even sure it compiles) because my openSUSE Krypton Secureboot-enabled VM says "no EFI system partitions found". --- src/modules/partition/core/PartUtils.cpp | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/modules/partition/core/PartUtils.cpp b/src/modules/partition/core/PartUtils.cpp index 775fcee66..1582dcda3 100644 --- a/src/modules/partition/core/PartUtils.cpp +++ b/src/modules/partition/core/PartUtils.cpp @@ -343,21 +343,27 @@ isEfiSystem() bool isEfiBootable( const Partition* candidate ) { + cDebug() << "Check EFI bootable" << candidate->partitionPath() << candidate->devicePath(); + cDebug() << " .. flags" << candidate->activeFlags(); + /* 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(); + cDebug() << " .. moved towards root" << (void *)root; + } // Strange case: no root found, no partition table node? if ( !root ) return false; const PartitionTable* table = dynamic_cast( root ); + cDebug() << " .. partition table" << (void *)table << "type" << ( table ? table->type() : PartitionTable::TableType::unknownTableType ); return table && ( table->type() == PartitionTable::TableType::gpt ) && candidate->activeFlags().testFlag( PartitionTable::FlagBoot ); }