mirror of
https://xff.cz/git/u-boot/
synced 2025-09-01 08:42:12 +02:00
efi_loader: identify EFI system partition
In subsequent patches UEFI variables shalled be stored on the EFI system partition. Hence we need to identify the EFI system partition. Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
This commit is contained in:
@@ -47,6 +47,13 @@ static inline void *guidcpy(void *dst, const void *src)
|
|||||||
/* Root node */
|
/* Root node */
|
||||||
extern efi_handle_t efi_root;
|
extern efi_handle_t efi_root;
|
||||||
|
|
||||||
|
/* EFI system partition */
|
||||||
|
extern struct efi_system_partition {
|
||||||
|
enum if_type if_type;
|
||||||
|
int devnum;
|
||||||
|
u8 part;
|
||||||
|
} efi_system_partition;
|
||||||
|
|
||||||
int __efi_entry_check(void);
|
int __efi_entry_check(void);
|
||||||
int __efi_exit_check(void);
|
int __efi_exit_check(void);
|
||||||
const char *__efi_nesting(void);
|
const char *__efi_nesting(void);
|
||||||
|
@@ -13,6 +13,8 @@
|
|||||||
#include <part.h>
|
#include <part.h>
|
||||||
#include <malloc.h>
|
#include <malloc.h>
|
||||||
|
|
||||||
|
struct efi_system_partition efi_system_partition;
|
||||||
|
|
||||||
const efi_guid_t efi_block_io_guid = EFI_BLOCK_IO_PROTOCOL_GUID;
|
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;
|
diskobj->ops.media = &diskobj->media;
|
||||||
if (disk)
|
if (disk)
|
||||||
*disk = diskobj;
|
*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;
|
return EFI_SUCCESS;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user