]> git.ipfire.org Git - thirdparty/u-boot.git/commitdiff
efi_loader: disk: Extend EFI_PARTITION_INFO_PROTOCOL to support MBR
authorJavier Martinez Canillas <javierm@redhat.com>
Thu, 12 Feb 2026 20:45:00 +0000 (21:45 +0100)
committerHeinrich Schuchardt <heinrich.schuchardt@canonical.com>
Sun, 15 Feb 2026 07:43:58 +0000 (08:43 +0100)
The EFI_PARTITION_INFO_PROTOCOL provides detailed information about
partitions. The UEFI specification mentions that both GPT and MBR
partition schemes are supported, but the U-Boot implementation only
supports the former.

This can cause compatibility issues for platforms whose boot ROM only
supports MBR. This change adds support for MBR partition tables to
the protocol, making U-Boot compatible with systems that require a
legacy MBR table.

Signed-off-by: Javier Martinez Canillas <javierm@redhat.com>
Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
lib/efi_loader/efi_disk.c

index 130c4db9606f7f0d74f8911810652ed4b3f0abc2..f8a57539ec61c26f8a981238b6ed0e557eae8cea 100644 (file)
@@ -475,9 +475,12 @@ static efi_status_t efi_disk_add_dev(
 #if CONFIG_IS_ENABLED(DOS_PARTITION)
                case PART_TYPE_DOS:
                        info->type = PARTITION_TYPE_MBR;
-
-                       /* TODO: implement support for MBR partition types */
-                       log_debug("EFI_PARTITION_INFO_PROTOCOL doesn't support MBR\n");
+                       ret = part_get_mbr(desc, part, &info->info.mbr);
+                       if (ret) {
+                               log_debug("get MBR for part %d failed %ld\n",
+                                         part, ret);
+                               goto error;
+                       }
                        break;
 #endif
                default: