diff --git a/MdeModulePkg/Universal/Disk/PartitionDxe/ElTorito.c b/MdeModulePkg/Universal/Disk/PartitionDxe/ElTorito.c
index 2084ee5abe..a7b5434a08 100644
--- a/MdeModulePkg/Universal/Disk/PartitionDxe/ElTorito.c
+++ b/MdeModulePkg/Universal/Disk/PartitionDxe/ElTorito.c
@@ -1,6 +1,7 @@
/** @file
Decode an El Torito formatted CD-ROM
+Copyright (c) 2018 Qualcomm Datacenter Technologies, Inc.
Copyright (c) 2006 - 2017, Intel Corporation. All rights reserved.
This program and the accompanying materials
are licensed and made available under the terms and conditions of the BSD License
@@ -265,7 +266,8 @@ PartitionInstallElToritoChildHandles (
&PartitionInfo,
Catalog->Boot.Lba * (SIZE_2KB / Media->BlockSize),
Catalog->Boot.Lba * (SIZE_2KB / Media->BlockSize) + CdDev.PartitionSize - 1,
- SubBlockSize
+ SubBlockSize,
+ NULL
);
if (!EFI_ERROR (Status)) {
Found = EFI_SUCCESS;
diff --git a/MdeModulePkg/Universal/Disk/PartitionDxe/Gpt.c b/MdeModulePkg/Universal/Disk/PartitionDxe/Gpt.c
index 2cd3e15e8a..fe26a64541 100644
--- a/MdeModulePkg/Universal/Disk/PartitionDxe/Gpt.c
+++ b/MdeModulePkg/Universal/Disk/PartitionDxe/Gpt.c
@@ -13,6 +13,7 @@
PartitionValidGptTable(), PartitionCheckGptEntry() routine will accept disk
partition content and validate the GPT table and GPT entry.
+Copyright (c) 2018 Qualcomm Datacenter Technologies, Inc.
Copyright (c) 2006 - 2017, Intel Corporation. All rights reserved.
This program and the accompanying materials
are licensed and made available under the terms and conditions of the BSD License
@@ -419,7 +420,8 @@ PartitionInstallGptChildHandles (
&PartitionInfo,
Entry->StartingLBA,
Entry->EndingLBA,
- BlockSize
+ BlockSize,
+ &Entry->PartitionTypeGUID
);
}
diff --git a/MdeModulePkg/Universal/Disk/PartitionDxe/Mbr.c b/MdeModulePkg/Universal/Disk/PartitionDxe/Mbr.c
index 55e9d26bae..479745b657 100644
--- a/MdeModulePkg/Universal/Disk/PartitionDxe/Mbr.c
+++ b/MdeModulePkg/Universal/Disk/PartitionDxe/Mbr.c
@@ -11,6 +11,7 @@
always on the first sector of a media. The first sector also contains
the legacy boot strap code.
+Copyright (c) 2018 Qualcomm Datacenter Technologies, Inc.
Copyright (c) 2014, Hewlett-Packard Development Company, L.P.
Copyright (c) 2006 - 2017, Intel Corporation. All rights reserved.
This program and the accompanying materials
@@ -246,7 +247,8 @@ PartitionInstallMbrChildHandles (
&PartitionInfo,
HdDev.PartitionStart,
HdDev.PartitionStart + HdDev.PartitionSize - 1,
- MBR_SIZE
+ MBR_SIZE,
+ ((Mbr->Partition[Index].OSIndicator == EFI_PARTITION) ? &gEfiPartTypeSystemPartGuid: NULL)
);
if (!EFI_ERROR (Status)) {
@@ -317,7 +319,8 @@ PartitionInstallMbrChildHandles (
&PartitionInfo,
HdDev.PartitionStart - ParentHdDev.PartitionStart,
HdDev.PartitionStart - ParentHdDev.PartitionStart + HdDev.PartitionSize - 1,
- MBR_SIZE
+ MBR_SIZE,
+ ((Mbr->Partition[0].OSIndicator == EFI_PARTITION) ? &gEfiPartTypeSystemPartGuid: NULL)
);
if (!EFI_ERROR (Status)) {
Found = EFI_SUCCESS;
diff --git a/MdeModulePkg/Universal/Disk/PartitionDxe/Partition.c b/MdeModulePkg/Universal/Disk/PartitionDxe/Partition.c
index 46c0877cee..71acdcc898 100644
--- a/MdeModulePkg/Universal/Disk/PartitionDxe/Partition.c
+++ b/MdeModulePkg/Universal/Disk/PartitionDxe/Partition.c
@@ -4,6 +4,7 @@
of the raw block devices media. Currently "El Torito CD-ROM", UDF, Legacy
MBR, and GPT partition schemes are supported.
+Copyright (c) 2018 Qualcomm Datacenter Technologies, Inc.
Copyright (c) 2006 - 2018, Intel Corporation. All rights reserved.
This program and the accompanying materials
are licensed and made available under the terms and conditions of the BSD License
@@ -401,6 +402,7 @@ PartitionDriverBindingStop (
BOOLEAN AllChildrenStopped;
PARTITION_PRIVATE_DATA *Private;
EFI_DISK_IO_PROTOCOL *DiskIo;
+ EFI_GUID *TypeGuid;
BlockIo = NULL;
BlockIo2 = NULL;
@@ -493,6 +495,13 @@ PartitionDriverBindingStop (
This->DriverBindingHandle,
ChildHandleBuffer[Index]
);
+
+ if (IsZeroGuid (&Private->TypeGuid)) {
+ TypeGuid = NULL;
+ } else {
+ TypeGuid = &Private->TypeGuid;
+ }
+
//
// All Software protocols have be freed from the handle so remove it.
// Remove the BlockIo Protocol if has.
@@ -516,7 +525,7 @@ PartitionDriverBindingStop (
&Private->BlockIo2,
&gEfiPartitionInfoProtocolGuid,
&Private->PartitionInfo,
- Private->EspGuid,
+ TypeGuid,
NULL,
NULL
);
@@ -530,7 +539,7 @@ PartitionDriverBindingStop (
&Private->BlockIo,
&gEfiPartitionInfoProtocolGuid,
&Private->PartitionInfo,
- Private->EspGuid,
+ TypeGuid,
NULL,
NULL
);
@@ -1104,6 +1113,7 @@ PartitionFlushBlocksEx (
@param[in] Start Start Block.
@param[in] End End Block.
@param[in] BlockSize Child block size.
+ @param[in] TypeGuid Partition GUID Type.
@retval EFI_SUCCESS A child handle was added.
@retval other A child handle was not added.
@@ -1122,7 +1132,8 @@ PartitionInstallChildHandle (
IN EFI_PARTITION_INFO_PROTOCOL *PartitionInfo,
IN EFI_LBA Start,
IN EFI_LBA End,
- IN UINT32 BlockSize
+ IN UINT32 BlockSize,
+ IN EFI_GUID *TypeGuid
)
{
EFI_STATUS Status;
@@ -1216,13 +1227,10 @@ PartitionInstallChildHandle (
//
CopyMem (&Private->PartitionInfo, PartitionInfo, sizeof (EFI_PARTITION_INFO_PROTOCOL));
- if (PartitionInfo->System == 1) {
- Private->EspGuid = &gEfiPartTypeSystemPartGuid;
+ if (TypeGuid != NULL) {
+ CopyGuid(&(Private->TypeGuid), TypeGuid);
} else {
- //
- // If NULL InstallMultipleProtocolInterfaces will ignore it.
- //
- Private->EspGuid = NULL;
+ ZeroMem ((VOID *)&(Private->TypeGuid), sizeof (EFI_GUID));
}
//
@@ -1240,7 +1248,7 @@ PartitionInstallChildHandle (
&Private->BlockIo2,
&gEfiPartitionInfoProtocolGuid,
&Private->PartitionInfo,
- Private->EspGuid,
+ TypeGuid,
NULL,
NULL
);
@@ -1253,7 +1261,7 @@ PartitionInstallChildHandle (
&Private->BlockIo,
&gEfiPartitionInfoProtocolGuid,
&Private->PartitionInfo,
- Private->EspGuid,
+ TypeGuid,
NULL,
NULL
);
diff --git a/MdeModulePkg/Universal/Disk/PartitionDxe/Partition.h b/MdeModulePkg/Universal/Disk/PartitionDxe/Partition.h
index c763c676a9..f1a05207bf 100644
--- a/MdeModulePkg/Universal/Disk/PartitionDxe/Partition.h
+++ b/MdeModulePkg/Universal/Disk/PartitionDxe/Partition.h
@@ -4,6 +4,7 @@
of the raw block devices media. Currently "El Torito CD-ROM", UDF, Legacy
MBR, and GPT partition schemes are supported.
+Copyright (c) 2018 Qualcomm Datacenter Technologies, Inc.
Copyright (c) 2006 - 2017, Intel Corporation. All rights reserved.
This program and the accompanying materials
are licensed and made available under the terms and conditions of the BSD License
@@ -65,7 +66,7 @@ typedef struct {
UINT32 BlockSize;
BOOLEAN InStop;
- EFI_GUID *EspGuid;
+ EFI_GUID TypeGuid;
} PARTITION_PRIVATE_DATA;
@@ -327,6 +328,7 @@ PartitionComponentNameGetControllerName (
@param[in] Start Start Block.
@param[in] End End Block.
@param[in] BlockSize Child block size.
+ @param[in] TypeGuid Parition Type Guid.
@retval EFI_SUCCESS A child handle was added.
@retval other A child handle was not added.
@@ -345,7 +347,8 @@ PartitionInstallChildHandle (
IN EFI_PARTITION_INFO_PROTOCOL *PartitionInfo,
IN EFI_LBA Start,
IN EFI_LBA End,
- IN UINT32 BlockSize
+ IN UINT32 BlockSize,
+ IN EFI_GUID *TypeGuid
);
/**
diff --git a/MdeModulePkg/Universal/Disk/PartitionDxe/Udf.c b/MdeModulePkg/Universal/Disk/PartitionDxe/Udf.c
index 5aac5640f6..83bd174231 100644
--- a/MdeModulePkg/Universal/Disk/PartitionDxe/Udf.c
+++ b/MdeModulePkg/Universal/Disk/PartitionDxe/Udf.c
@@ -1,6 +1,7 @@
/** @file
Scan for an UDF file system on a formatted media.
+ Copyright (c) 2018 Qualcomm Datacenter Technologies, Inc.
Copyright (C) 2014-2017 Paulo Alcantara
This program and the accompanying materials are licensed and made available
@@ -753,7 +754,8 @@ PartitionInstallUdfChildHandles (
&PartitionInfo,
StartingLBA,
EndingLBA,
- Media->BlockSize
+ Media->BlockSize,
+ NULL
);
if (EFI_ERROR (Status)) {
return (ChildCreated ? EFI_SUCCESS : Status);