All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] efi_loader: set partition GUID in device path for SIG_TYPE_GUID
@ 2021-07-15 13:31 Alfonso Sánchez-Beato
  2021-07-18  9:07 ` Heinrich Schuchardt
  0 siblings, 1 reply; 2+ messages in thread
From: Alfonso Sánchez-Beato @ 2021-07-15 13:31 UTC (permalink / raw)
  To: u-boot
  Cc: xypron.glpk, agraf, Alfonso Sánchez-Beato, Heinrich Schuchardt

Previously, the GPT device GUID was being used instead of the partition,
which was incorrect.

Signed-off-by: Alfonso Sánchez-Beato <alfonso.sanchez-beato@canonical.com>
Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
---
 lib/efi_loader/efi_device_path.c | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)

diff --git a/lib/efi_loader/efi_device_path.c b/lib/efi_loader/efi_device_path.c
index 76c2f82fe6..a2c19538ad 100644
--- a/lib/efi_loader/efi_device_path.c
+++ b/lib/efi_loader/efi_device_path.c
@@ -16,6 +16,7 @@
 #include <efi_loader.h>
 #include <part.h>
 #include <sandboxblockdev.h>
+#include <uuid.h>
 #include <asm-generic/unaligned.h>
 #include <linux/compat.h> /* U16_MAX */
 
@@ -851,8 +852,10 @@ static void *dp_part_node(void *buf, struct blk_desc *desc, int part)
 			break;
 		case SIG_TYPE_GUID:
 			hddp->signature_type = 2;
-			memcpy(hddp->partition_signature, &desc->guid_sig,
-			       sizeof(hddp->partition_signature));
+			if (uuid_str_to_bin(info.uuid,
+					    hddp->partition_signature, 1))
+				printf("Partition no. %d: invalid guid: %s\n",
+				       part, info.uuid);
 			break;
 		}
 
-- 
2.25.1


^ permalink raw reply related	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2021-07-18  9:07 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-07-15 13:31 [PATCH] efi_loader: set partition GUID in device path for SIG_TYPE_GUID Alfonso Sánchez-Beato
2021-07-18  9:07 ` Heinrich Schuchardt

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.