efi_loader: disk: add EFI_PARTITION_INFO_PROTOCOL support

The UEFI 2.10 specification mentions that this protocol shall be installed
along with EFI_BLOCK_IO_PROTOCOL. It provides cached partition information
for MBR and GPT partition types.

This patch just implements support for GPT partition types. The legacy MBR
partition types is only needed for backward compatibility and can be added
as a follow-up if needed, to make it fully compliant with the EFI spec.

Signed-off-by: Javier Martinez Canillas <javierm@redhat.com>
Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
Signed-off-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
This commit is contained in:
Javier Martinez Canillas
2025-06-19 10:34:01 +02:00
committed by Ilias Apalodimas
parent f517d93842
commit 2fdfb802e3
2 changed files with 57 additions and 2 deletions

View File

@@ -138,4 +138,24 @@ typedef struct _legacy_mbr {
__le16 signature;
} __packed legacy_mbr;
#define EFI_PARTITION_INFO_PROTOCOL_GUID \
EFI_GUID(0x8cf2f62c, 0xbc9b, 0x4821, 0x80, \
0x8d, 0xec, 0x9e, 0xc4, 0x21, 0xa1, 0xa0)
#define EFI_PARTITION_INFO_PROTOCOL_REVISION 0x0001000
#define PARTITION_TYPE_OTHER 0x00
#define PARTITION_TYPE_MBR 0x01
#define PARTITION_TYPE_GPT 0x02
struct efi_partition_info {
u32 revision;
u32 type;
u8 system;
u8 reserved[7];
union {
struct partition mbr;
gpt_entry gpt;
} info;
} __packed;
#endif /* _DISK_PART_EFI_H */