summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorTom Rini <trini@konsulko.com>2020-04-30 15:11:06 -0400
committerTom Rini <trini@konsulko.com>2020-04-30 15:11:06 -0400
commit78021b63373de32335bd204471d6cb7c7e18bc52 (patch)
tree2595e84a2a15ad82f99c298259ff3c2b4b31c0d9 /lib
parent9f0a6df3a57469061582c6b27fc869829681beca (diff)
parentf9f5f92bc54b035223e447bc5740544efd0569d9 (diff)
downloadu-boot-78021b63373de32335bd204471d6cb7c7e18bc52.tar.gz
u-boot-78021b63373de32335bd204471d6cb7c7e18bc52.tar.bz2
u-boot-78021b63373de32335bd204471d6cb7c7e18bc52.zip
Merge tag 'efi-2020-07-rc2' of https://gitlab.denx.de/u-boot/custodians/u-boot-efi
Pull request for UEFI sub-system for efi-2020-07-rc2 This pull request contains bug fixes needed due to the merged changes for EFI secure boot. Patches are supplied to identify EFI system partitions.
Diffstat (limited to 'lib')
-rw-r--r--lib/efi_loader/efi_disk.c20
1 files changed, 20 insertions, 0 deletions
diff --git a/lib/efi_loader/efi_disk.c b/lib/efi_loader/efi_disk.c
index fd8fe17567..fd3df80b0b 100644
--- a/lib/efi_loader/efi_disk.c
+++ b/lib/efi_loader/efi_disk.c
@@ -13,6 +13,8 @@
#include <part.h>
#include <malloc.h>
+struct efi_system_partition efi_system_partition;
+
const efi_guid_t efi_block_io_guid = EFI_BLOCK_IO_PROTOCOL_GUID;
/**
@@ -418,6 +420,24 @@ static efi_status_t efi_disk_add_dev(
diskobj->ops.media = &diskobj->media;
if (disk)
*disk = diskobj;
+
+ /* Store first EFI system partition */
+ if (part && !efi_system_partition.if_type) {
+ int r;
+ disk_partition_t info;
+
+ r = part_get_info(desc, part, &info);
+ if (r)
+ return EFI_DEVICE_ERROR;
+ if (info.bootable & PART_EFI_SYSTEM_PARTITION) {
+ efi_system_partition.if_type = desc->if_type;
+ efi_system_partition.devnum = desc->devnum;
+ efi_system_partition.part = part;
+ EFI_PRINT("EFI system partition: %s %d:%d\n",
+ blk_get_if_type_name(desc->if_type),
+ desc->devnum, part);
+ }
+ }
return EFI_SUCCESS;
}