public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
From: Rob Clark <robdclark@gmail.com>
To: u-boot@lists.denx.de
Subject: [U-Boot] [PATCH 09/11] efi_loader: Fix disk dp's for pre-DM/legacy devices
Date: Tue, 10 Oct 2017 08:23:05 -0400	[thread overview]
Message-ID: <20171010122309.25313-10-robdclark@gmail.com> (raw)
In-Reply-To: <20171010122309.25313-1-robdclark@gmail.com>

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

  parent reply	other threads:[~2017-10-10 12:23 UTC|newest]

Thread overview: 75+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-10-10 12:22 [U-Boot] [PATCH 00/11] efi_loader: patches for Shell.efi Rob Clark
2017-10-10 12:22 ` [U-Boot] [PATCH 01/11] efi_loader: Initial EFI_DEVICE_PATH_UTILITIES_PROTOCOL Rob Clark
2017-10-11  0:03   ` Heinrich Schuchardt
2017-10-11 14:07   ` Alexander Graf
2017-10-11 20:32     ` Rob Clark
2017-10-12  6:51       ` Heinrich Schuchardt
2017-10-10 12:22 ` [U-Boot] [PATCH 02/11] efi_loader: Initial HII protocols Rob Clark
2017-10-11 14:30   ` Alexander Graf
2017-10-11 22:02     ` Rob Clark
2017-10-12  7:13       ` Alexander Graf
2017-10-12  9:55         ` Rob Clark
2017-10-12  9:59           ` Alexander Graf
2018-09-22 10:34   ` Heinrich Schuchardt
2018-09-23 10:11     ` Alexander Graf
2018-10-03  7:39       ` AKASHI, Takahiro
2018-10-05  8:52         ` AKASHI, Takahiro
2018-10-05  9:49           ` Leif Lindholm
2018-10-05 13:06             ` Alexander Graf
2018-10-09  7:24               ` AKASHI, Takahiro
2018-10-09 17:19                 ` Heinrich Schuchardt
2018-10-10  0:54                   ` AKASHI, Takahiro
2018-10-05 16:24             ` Heinrich Schuchardt
2017-10-10 12:22 ` [U-Boot] [PATCH 03/11] efi_loader: Initial EFI_UNICODE_COLLATION_PROTOCOL Rob Clark
2017-10-11 14:36   ` Alexander Graf
2017-10-11 20:30     ` Rob Clark
2017-10-11 20:47       ` Alexander Graf
2017-10-12 11:54         ` Alexander Graf
2017-10-10 12:23 ` [U-Boot] [PATCH 04/11] efi_loader: SIMPLE_TEXT_INPUT_EX plus wire up objects properly Rob Clark
2017-10-11 14:39   ` Alexander Graf
2018-09-04 14:07   ` [U-Boot] [U-Boot, " Alexander Graf
2017-10-10 12:23 ` [U-Boot] [PATCH 05/11] efi_loader: console support for color attributes Rob Clark
2017-10-10 23:41   ` Heinrich Schuchardt
2017-10-11 14:41   ` Alexander Graf
2017-10-12 15:24   ` [U-Boot] [U-Boot, " Alexander Graf
2017-10-10 12:23 ` [U-Boot] [PATCH 06/11] efi_loader: Decouple EFI input/output from stdin/stdout Rob Clark
2017-10-11 14:45   ` Alexander Graf
2017-10-11 22:07     ` Rob Clark
2017-10-12  7:15       ` Alexander Graf
2017-10-12 12:48         ` Rob Clark
2017-10-12 13:05           ` Heinrich Schuchardt
2017-10-12 13:40             ` Rob Clark
2017-10-12 13:50               ` Alexander Graf
2017-10-12 14:28                 ` Rob Clark
2017-10-12 14:31                   ` Alexander Graf
2017-10-12 16:00                   ` Mark Kettenis
2017-10-12 16:25                     ` Alexander Graf
2017-10-12 22:38                   ` Heinrich Schuchardt
2017-10-12 21:26                     ` Rob Clark
2017-10-12 23:48                       ` Heinrich Schuchardt
2017-10-13  0:41                         ` Rob Clark
2017-10-12 13:11           ` Alexander Graf
2017-10-12 13:42             ` Rob Clark
2017-10-12 13:44           ` Mark Kettenis
2017-10-12 14:24             ` Rob Clark
2017-10-10 12:23 ` [U-Boot] [PATCH 07/11] efi_loader: fix events Rob Clark
2017-10-10 22:40   ` Heinrich Schuchardt
2017-10-11 14:49   ` Alexander Graf
2017-10-11 22:09     ` Rob Clark
2017-10-13  5:24   ` Heinrich Schuchardt
2017-10-13 14:08     ` Rob Clark
2017-10-10 12:23 ` [U-Boot] [PATCH 08/11] efi_loader: implement SetWatchdogTimer Rob Clark
2017-10-11 14:55   ` Alexander Graf
2017-10-10 12:23 ` Rob Clark [this message]
2017-10-11 14:56   ` [U-Boot] [PATCH 09/11] efi_loader: Fix disk dp's for pre-DM/legacy devices Alexander Graf
2017-10-10 12:23 ` [U-Boot] [PATCH 10/11] efi_loader: Add mem-mapped for fallback Rob Clark
2017-10-10 22:31   ` Heinrich Schuchardt
2017-10-11 14:59   ` Alexander Graf
2017-10-11 22:14     ` Rob Clark
2017-10-12 15:24   ` [U-Boot] [U-Boot, " Alexander Graf
2017-10-10 12:23 ` [U-Boot] [PATCH 11/11] efi_loader: exclude openrd devices Rob Clark
2017-10-10 22:28   ` Heinrich Schuchardt
2017-10-10 22:50     ` Rob Clark
2017-10-11  7:07       ` Stefan Roese
2017-10-11  7:22         ` Alexander Graf
2017-10-11  0:24 ` [U-Boot] [PATCH 00/11] efi_loader: patches for Shell.efi Heinrich Schuchardt

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=20171010122309.25313-10-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