From: Rob Clark <robdclark@gmail.com>
To: u-boot@lists.denx.de
Subject: [U-Boot] [PATCH] efi_loader: Fix disk dp's for pre-DM/legacy devices
Date: Sun, 8 Oct 2017 11:33:08 -0400 [thread overview]
Message-ID: <20171008153310.25350-1-robdclark@gmail.com> (raw)
This fixes an issue with OpenBSD's bootloader, and I think should also
fix a similar issue with grub2 on legacy devices. In the legacy case
we were creating disk objects for the partitions, but not also the
parent device.
Reported-by: Jonathan Gray <jsg@jsg.id.au>
Signed-off-by: Rob Clark <robdclark@gmail.com>
---
lib/efi_loader/efi_disk.c | 11 +++++++++++
1 file changed, 11 insertions(+)
diff --git a/lib/efi_loader/efi_disk.c b/lib/efi_loader/efi_disk.c
index eb9ce772d1..47b487aa30 100644
--- a/lib/efi_loader/efi_disk.c
+++ b/lib/efi_loader/efi_disk.c
@@ -340,6 +340,8 @@ int efi_disk_register(void)
for (i = 0; i < 4; i++) {
struct blk_desc *desc;
char devname[32] = { 0 }; /* dp->str is u16[32] long */
+ disk_partition_t info;
+ int part = 1;
desc = blk_get_devnum_by_type(if_type, i);
if (!desc)
@@ -349,6 +351,15 @@ int efi_disk_register(void)
snprintf(devname, sizeof(devname), "%s%d",
if_typename, i);
+
+ /* add devices for each partition: */
+ while (!part_get_info(desc, part, &info)) {
+ efi_disk_add_dev(devname, if_typename, desc,
+ i, 0, part);
+ part++;
+ }
+
+ /* ... and add block device: */
efi_disk_add_dev(devname, if_typename, desc, i, 0, 0);
disks++;
--
2.13.6
next reply other threads:[~2017-10-08 15:33 UTC|newest]
Thread overview: 18+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-10-08 15:33 Rob Clark [this message]
2017-10-09 3:33 ` [U-Boot] [PATCH] efi_loader: Fix disk dp's for pre-DM/legacy devices Jonathan Gray
2017-10-09 10:52 ` Rob Clark
2017-10-09 12:25 ` Jonathan Gray
2017-10-09 14:17 ` Rob Clark
2017-10-09 15:35 ` Jonathan Gray
2017-10-09 16:06 ` Rob Clark
2017-10-09 16:22 ` Heinrich Schuchardt
2017-10-09 17:02 ` Rob Clark
2017-10-09 16:41 ` Jonathan Gray
2017-10-09 17:06 ` Rob Clark
2017-10-09 17:48 ` Jonathan Gray
2017-10-09 18:20 ` Rob Clark
2017-10-09 18:36 ` Peter Robinson
2017-11-18 4:25 ` Jonathan Gray
2017-11-21 5:59 ` Jonathan Gray
2017-11-21 12:01 ` Jonathan Gray
2017-10-09 4:43 ` [U-Boot] " Alexander Graf
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20171008153310.25350-1-robdclark@gmail.com \
--to=robdclark@gmail.com \
--cc=u-boot@lists.denx.de \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox