Skip to contentSkip to conversation

efi_loader: Setup logical_partition media information

PATCH In review Emmanuel Vadot 3 participants 3 messages Dec 11, 2017 – Dec 19, 2017

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 efi_loader: Setup logical_partition media information

When adding a partition, set the logical_partition member in the media structure as mandated by the UEFI spec.

---
 lib/efi_loader/efi_disk.c | 2 ++
 1 file changed, 2 insertions(+)
lib/efi_loader/efi_disk.c +2 -0
index 4e457a841b..d299fc8dea 100644
@@ -258,6 +258,8 @@ static void efi_disk_add_dev(const char *name,
 	diskobj->media.block_size = desc->blksz;
 	diskobj->media.io_align = desc->blksz;
 	diskobj->media.last_block = desc->lba - offset;
+	if (part != 0)
+		diskobj->media.logical_partition = 1;
 	diskobj->ops.media = &diskobj->media;
 	return;
 out_of_memory:
Signature · 1 line
2.15.0
#1 lore raw

PATCH 1/1 efi_loader: Setup logical_partition media information

Quoted 14 lines · Emmanuel Vadot

When adding a partition, set the logical_partition member in the media structure as mandated by the UEFI spec.

---
  lib/efi_loader/efi_disk.c | 2 ++
  1 file changed, 2 insertions(+)
lib/efi_loader/efi_disk.c +0 -0
index 4e457a841b..d299fc8dea 100644

lib/efi_loader/efi_disk.c static void efi_disk_add_dev(const char *name, · line 265

Quoted 8 lines
lib/efi_loader/efi_disk.c +2 -0
@@ -258,6 +258,8 @@ static void efi_disk_add_dev(const char *name,
  	diskobj->media.block_size = desc->blksz;
  	diskobj->media.io_align = desc->blksz;
  	diskobj->media.last_block = desc->lba - offset;
+	if (part != 0)
+		diskobj->media.logical_partition = 1;
  	diskobj->ops.media = &diskobj->media;
  	return;
  out_of_memory:

Setting logical_partition is described in chapter
13.9 Block I/O Protocol of UEFI Spec 2.7.

#2 lore raw
In reply to Emmanuel Vadot
Quoted 5 lines · Emmanuel Vadot

When adding a partition, set the logical_partition member in the media structure as mandated by the UEFI spec.

Applied to u-boot/master, thanks!

Signature · 8 lines
Tom
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: not available
URL: <http://lists.denx.de/pipermail/u-boot/attachments/20171219/b1764842/attachment.sig>