mirror of
https://github.com/u-boot/u-boot.git
synced 2025-04-30 08:07:59 +00:00
efi_loader: install UEFI System Partition GUID
On the handle for the UEFI System Partition we must install the System Partition GUID (with a NULL interface). Let the efidebug command display the GUID. Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
This commit is contained in:
parent
1bc9fc3483
commit
b9b0ea30c7
2 changed files with 12 additions and 8 deletions
|
@ -16,6 +16,7 @@
|
||||||
#include <log.h>
|
#include <log.h>
|
||||||
#include <malloc.h>
|
#include <malloc.h>
|
||||||
#include <mapmem.h>
|
#include <mapmem.h>
|
||||||
|
#include <part.h>
|
||||||
#include <search.h>
|
#include <search.h>
|
||||||
#include <linux/ctype.h>
|
#include <linux/ctype.h>
|
||||||
|
|
||||||
|
@ -502,6 +503,10 @@ static const struct {
|
||||||
"Device-Tree Fixup",
|
"Device-Tree Fixup",
|
||||||
EFI_DT_FIXUP_PROTOCOL_GUID,
|
EFI_DT_FIXUP_PROTOCOL_GUID,
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
"System Partition",
|
||||||
|
PARTITION_SYSTEM_GUID
|
||||||
|
},
|
||||||
/* Configuration table GUIDs */
|
/* Configuration table GUIDs */
|
||||||
{
|
{
|
||||||
"ACPI table",
|
"ACPI table",
|
||||||
|
|
|
@ -19,6 +19,7 @@
|
||||||
struct efi_system_partition efi_system_partition;
|
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;
|
||||||
|
const efi_guid_t efi_system_partition_guid = PARTITION_SYSTEM_GUID;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* struct efi_disk_obj - EFI disk object
|
* struct efi_disk_obj - EFI disk object
|
||||||
|
@ -362,6 +363,7 @@ static efi_status_t efi_disk_add_dev(
|
||||||
{
|
{
|
||||||
struct efi_disk_obj *diskobj;
|
struct efi_disk_obj *diskobj;
|
||||||
struct efi_object *handle;
|
struct efi_object *handle;
|
||||||
|
const efi_guid_t *guid = NULL;
|
||||||
efi_status_t ret;
|
efi_status_t ret;
|
||||||
|
|
||||||
/* Don't add empty devices */
|
/* Don't add empty devices */
|
||||||
|
@ -400,6 +402,8 @@ static efi_status_t efi_disk_add_dev(
|
||||||
efi_free_pool(node);
|
efi_free_pool(node);
|
||||||
diskobj->offset = part_info->start;
|
diskobj->offset = part_info->start;
|
||||||
diskobj->media.last_block = part_info->size - 1;
|
diskobj->media.last_block = part_info->size - 1;
|
||||||
|
if (part_info->bootable & PART_EFI_SYSTEM_PARTITION)
|
||||||
|
guid = &efi_system_partition_guid;
|
||||||
} else {
|
} else {
|
||||||
diskobj->dp = efi_dp_from_part(desc, part);
|
diskobj->dp = efi_dp_from_part(desc, part);
|
||||||
diskobj->offset = 0;
|
diskobj->offset = 0;
|
||||||
|
@ -417,7 +421,8 @@ static efi_status_t efi_disk_add_dev(
|
||||||
handle = &diskobj->header;
|
handle = &diskobj->header;
|
||||||
ret = EFI_CALL(efi_install_multiple_protocol_interfaces(
|
ret = EFI_CALL(efi_install_multiple_protocol_interfaces(
|
||||||
&handle, &efi_guid_device_path, diskobj->dp,
|
&handle, &efi_guid_device_path, diskobj->dp,
|
||||||
&efi_block_io_guid, &diskobj->ops, NULL));
|
&efi_block_io_guid, &diskobj->ops,
|
||||||
|
guid, NULL, NULL));
|
||||||
if (ret != EFI_SUCCESS)
|
if (ret != EFI_SUCCESS)
|
||||||
return ret;
|
return ret;
|
||||||
|
|
||||||
|
@ -467,13 +472,7 @@ static efi_status_t efi_disk_add_dev(
|
||||||
|
|
||||||
/* Store first EFI system partition */
|
/* Store first EFI system partition */
|
||||||
if (part && !efi_system_partition.if_type) {
|
if (part && !efi_system_partition.if_type) {
|
||||||
int r;
|
if (part_info->bootable & PART_EFI_SYSTEM_PARTITION) {
|
||||||
struct disk_partition 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.if_type = desc->if_type;
|
||||||
efi_system_partition.devnum = desc->devnum;
|
efi_system_partition.devnum = desc->devnum;
|
||||||
efi_system_partition.part = part;
|
efi_system_partition.part = part;
|
||||||
|
|
Loading…
Add table
Reference in a new issue