From: Andreas Reichel <
andreas.r...@siemens.com>
If the user mixes wrong GUID with valid FS in GPT partitions, i.e. an
invalid partitioning (as it happened to a highly experienced colleague),
error searching can be frustrating. In this case, to make things
clearer, explicitely say that the found partition has an unsupported
GUID.
Signed-off-by: Andreas Reichel <
andreas.r...@siemens.com>
---
tools/ebgpart.c | 7 +++++--
1 file changed, 5 insertions(+), 2 deletions(-)
diff --git a/tools/ebgpart.c b/tools/ebgpart.c
index 410472f..c8d2fbd 100644
--- a/tools/ebgpart.c
+++ b/tools/ebgpart.c
@@ -75,12 +75,15 @@ static char *type_to_name(char t)
static bool check_GPT_FAT_entry(int fd, struct EFIpartitionentry *e,
PedFileSystemType *pfst, uint32_t i)
{
- if (strcmp(GPT_PARTITION_GUID_FAT_NTFS, GUID_to_str(e->type_GUID)) !=
+ char *guid_str = GUID_to_str(e->type_GUID);
+ if (strcmp(GPT_PARTITION_GUID_FAT_NTFS, guid_str) !=
0 &&
- strcmp(GPT_PARTITION_GUID_ESP, GUID_to_str(e->type_GUID)) != 0) {
+ strcmp(GPT_PARTITION_GUID_ESP, guid_str) != 0) {
if (asprintf(&pfst->name, "%s", "not supported") == -1) {
goto error_asprintf;
}
+ VERBOSE(stderr, "GPT entry has unsupported GUID: %s\n",
+ guid_str);
return true;
}
VERBOSE(stdout, "GPT Partition #%u is FAT/NTFS.\n", i);
--
2.19.1