public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
* [U-Boot] [PATCH] efi_loader: disk: install file system protocol to a whole disk
@ 2019-08-22  8:06 AKASHI Takahiro
  2019-08-22  9:11 ` Mark Kettenis
  0 siblings, 1 reply; 7+ messages in thread
From: AKASHI Takahiro @ 2019-08-22  8:06 UTC (permalink / raw)
  To: u-boot

Currently, a whole disk without any partitions is not associated
with EFI_SIMPLE_FILE_SYSTEM_PROTOCOL. So even if it houses FAT
file system, there is a chance that we may not be able to access
it, particularly, when accesses are to be attempted after searching
that protocol against a device handle.

With this patch, EFI_SIMPLE_FILE_SYSTEM_PROTOCOL is installed
to such a disk if part_get_info() shows there is not partition
table installed on it.

Signed-off-by: AKASHI Takahiro <takahiro.akashi@linaro.org>
---
 lib/efi_loader/efi_disk.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/lib/efi_loader/efi_disk.c b/lib/efi_loader/efi_disk.c
index 7a6b06821a47..548fe667e6f8 100644
--- a/lib/efi_loader/efi_disk.c
+++ b/lib/efi_loader/efi_disk.c
@@ -239,6 +239,7 @@ static efi_status_t efi_disk_add_dev(
 				struct efi_disk_obj **disk)
 {
 	struct efi_disk_obj *diskobj;
+	disk_partition_t info;
 	efi_status_t ret;
 
 	/* Don't add empty devices */
@@ -270,7 +271,8 @@ static efi_status_t efi_disk_add_dev(
 			       diskobj->dp);
 	if (ret != EFI_SUCCESS)
 		return ret;
-	if (part >= 1) {
+	/* partitions or whole disk without partitions */
+	if (part >= 1 || part_get_info(desc, part, &info)) {
 		diskobj->volume = efi_simple_file_system(desc, part,
 							 diskobj->dp);
 		ret = efi_add_protocol(&diskobj->header,
-- 
2.21.0

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

end of thread, other threads:[~2019-09-12  0:22 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2019-08-22  8:06 [U-Boot] [PATCH] efi_loader: disk: install file system protocol to a whole disk AKASHI Takahiro
2019-08-22  9:11 ` Mark Kettenis
2019-08-22 10:52   ` Heinrich Schuchardt
2019-08-23  0:04     ` AKASHI Takahiro
2019-09-11  6:16       ` AKASHI Takahiro
2019-09-11 17:31         ` Heinrich Schuchardt
2019-09-12  0:22           ` AKASHI Takahiro

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox