uboot-tools/efi_loader-initialise-parti...

44 lines
1.5 KiB
Diff

From patchwork Tue Nov 21 12:24:32 2017
Content-Type: text/plain; charset="utf-8"
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit
Subject: [U-Boot] efi_loader: initialise partition_signature memory
X-Patchwork-Submitter: Jonathan Gray <jsg@jsg.id.au>
X-Patchwork-Id: 839994
Message-Id: <20171121122432.88805-1-jsg@jsg.id.au>
To: u-boot@lists.denx.de
Cc: agraf@suse.de, kettenis@openbsd.org
Date: Tue, 21 Nov 2017 23:24:32 +1100
From: Jonathan Gray <jsg@jsg.id.au>
List-Id: U-Boot discussion <u-boot.lists.denx.de>
Zero partition_signature in the efi_device_path_hard_drive_path
structure when signature_type is zero.
This is required so that efi_dp_match() will work as expected
when doing memcmp() comparisons.
Corrects a problem where the loaded image protocol would not return a
device path with MEDIA_DEVICE causing the OpenBSD bootloader to fail
on rpi_3 and other targets.
Signed-off-by: Jonathan Gray <jsg@jsg.id.au>
---
lib/efi_loader/efi_device_path.c | 3 +++
1 file changed, 3 insertions(+)
diff --git a/lib/efi_loader/efi_device_path.c b/lib/efi_loader/efi_device_path.c
index f6e368e029..8045532a29 100644
--- a/lib/efi_loader/efi_device_path.c
+++ b/lib/efi_loader/efi_device_path.c
@@ -431,6 +431,9 @@ static void *dp_part_fill(void *buf, struct blk_desc *desc, int part)
if (hddp->signature_type != 0)
memcpy(hddp->partition_signature, &desc->guid_sig,
sizeof(hddp->partition_signature));
+ else
+ memset(hddp->partition_signature, 0,
+ sizeof(hddp->partition_signature));
buf = &hddp[1];
}