[PATCH 4/5] efi_loader: disk: Extend EFI_PARTITION_INFO_PROTOCOL to support MBR
Javier Martinez Canillas
javierm at redhat.com
Wed Jan 21 10:25:36 CET 2026
Heinrich Schuchardt <xypron.glpk at gmx.de> writes:
Hello Heinrich,
Thanks for your feedback.
> On 1/20/26 14:36, Javier Martinez Canillas wrote:
>> 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.
>>
>> To implement this, the existing part_get_info_extended() function,
>> which already traverses DOS partitions, is refactored to optionally
>> retrieve the raw MBR partition record. This provides the necessary
>> data for the EFI subsystem.
>>
>> Signed-off-by: Javier Martinez Canillas <javierm at redhat.com>
>> ---
>>
>> disk/part_dos.c | 63 ++++++++++++++++++++++++---------------
>> include/part.h | 14 +++++++++
>> lib/efi_loader/efi_disk.c | 9 ++++--
>> 3 files changed, 59 insertions(+), 27 deletions(-)
>>
>> diff --git a/disk/part_dos.c b/disk/part_dos.c
>> index 60c3d6773696..5b508483bae7 100644
>> --- a/disk/part_dos.c
>> +++ b/disk/part_dos.c
>> @@ -201,7 +201,9 @@ static void print_partition_extended(struct blk_desc *desc,
>
> Please add a Sphinx style function description describing the usage of
> the parameters.
>
Sure, I didn't add for the new parameter since the function didn't have
a description, but I'll add a preparatory patch in v2 to add that.
[...]
>> +/**
>> + * part_get_mbr() - Get the MBR partition record of a partition
>> + *
>> + * This function reads the MBR partition record for a given block
>> + * device and partition number.
>> + *
>> + * @desc: block device descriptor
>> + * @part: partition number for which to return the partition record
>> + * @mbr: MBR partition record
>> + *
>> + * Return: 0 on success, otherwise error
>> + */
>> +int part_get_mbr(struct blk_desc *desc, int part, dos_partition_t *mbr);
>> +
>> #endif
>>
>
> Please, put the partition library changes into one patch and the EFI
> changes into another.
>
Ok, I'll split these in v2.
> Best regards
>
> Heinrich
>
--
Best regards,
Javier Martinez Canillas
Core Platforms
Red Hat
More information about the U-Boot
mailing list