[PATCH] ebgpart: new info message for partition scan to state unsupported GUID

4 views
Skip to first unread message

Andreas J. Reichel

unread,
Oct 18, 2018, 8:07:36 AM10/18/18
to efibootg...@googlegroups.com, Andreas Reichel
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

Andreas J. Reichel

unread,
Oct 24, 2018, 5:12:44 AM10/24/18
to efibootg...@googlegroups.com, Andreas Reichel
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 | 8 +++++---
1 file changed, 5 insertions(+), 3 deletions(-)

diff --git a/tools/ebgpart.c b/tools/ebgpart.c
index 410472f..fc3bf3b 100644
--- a/tools/ebgpart.c
+++ b/tools/ebgpart.c
@@ -75,12 +75,14 @@ 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)) !=
- 0 &&

Jan Kiszka

unread,
Oct 25, 2018, 4:52:23 AM10/25/18
to [ext] Andreas J. Reichel, efibootg...@googlegroups.com
Thanks, applied to next.

Jan

--
Siemens AG, Corporate Technology, CT RDA IOT SES-DE
Corporate Competence Center Embedded Linux
Reply all
Reply to author
Forward
0 new messages