mirror of
https://github.com/acidanthera/audk.git
synced 2025-07-27 15:44:04 +02:00
MdeModulePkg/PartitionDxe: Merge the discovery of ElTorito into UDF
In order to create all of the children (El Torito standard and UDF) for a CD/DVD media in an entry of the PartitionDriverBindingStart(), this commit merges the discovery of the El Torito feature (PartitionInstallElToritoChildHandles) into function PartitionInstallUdfChildHandles. Cc: Ruiyu Ni <ruiyu.ni@intel.com> Cc: Star Zeng <star.zeng@intel.com> Cc: Eric Dong <eric.dong@intel.com> Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Hao Wu <hao.a.wu@intel.com> Reviewed-by: Paulo Alcantara <pcacjr@zytor.com>
This commit is contained in:
parent
b2662641d5
commit
01a68fd37e
@ -43,7 +43,6 @@ EFI_DRIVER_BINDING_PROTOCOL gPartitionDriverBinding = {
|
|||||||
//
|
//
|
||||||
PARTITION_DETECT_ROUTINE mPartitionDetectRoutineTable[] = {
|
PARTITION_DETECT_ROUTINE mPartitionDetectRoutineTable[] = {
|
||||||
PartitionInstallGptChildHandles,
|
PartitionInstallGptChildHandles,
|
||||||
PartitionInstallElToritoChildHandles,
|
|
||||||
PartitionInstallMbrChildHandles,
|
PartitionInstallMbrChildHandles,
|
||||||
PartitionInstallUdfChildHandles,
|
PartitionInstallUdfChildHandles,
|
||||||
NULL
|
NULL
|
||||||
@ -306,9 +305,9 @@ PartitionDriverBindingStart (
|
|||||||
if (BlockIo->Media->MediaPresent ||
|
if (BlockIo->Media->MediaPresent ||
|
||||||
(BlockIo->Media->RemovableMedia && !BlockIo->Media->LogicalPartition)) {
|
(BlockIo->Media->RemovableMedia && !BlockIo->Media->LogicalPartition)) {
|
||||||
//
|
//
|
||||||
// Try for GPT, then El Torito, then UDF, and then legacy MBR partition
|
// Try for GPT, then legacy MBR partition types, and then UDF and El Torito.
|
||||||
// types. If the media supports a given partition type install child handles
|
// If the media supports a given partition type install child handles to
|
||||||
// to represent the partitions described by the media.
|
// represent the partitions described by the media.
|
||||||
//
|
//
|
||||||
Routine = &mPartitionDetectRoutineTable[0];
|
Routine = &mPartitionDetectRoutineTable[0];
|
||||||
while (*Routine != NULL) {
|
while (*Routine != NULL) {
|
||||||
|
@ -688,8 +688,10 @@ PartitionInstallUdfChildHandles (
|
|||||||
EFI_PARTITION_INFO_PROTOCOL PartitionInfo;
|
EFI_PARTITION_INFO_PROTOCOL PartitionInfo;
|
||||||
EFI_LBA StartingLBA;
|
EFI_LBA StartingLBA;
|
||||||
EFI_LBA EndingLBA;
|
EFI_LBA EndingLBA;
|
||||||
|
BOOLEAN ChildCreated;
|
||||||
|
|
||||||
Media = BlockIo->Media;
|
Media = BlockIo->Media;
|
||||||
|
ChildCreated = FALSE;
|
||||||
|
|
||||||
//
|
//
|
||||||
// Check if UDF logical block size is multiple of underlying device block size
|
// Check if UDF logical block size is multiple of underlying device block size
|
||||||
@ -703,12 +705,30 @@ PartitionInstallUdfChildHandles (
|
|||||||
return EFI_NOT_FOUND;
|
return EFI_NOT_FOUND;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//
|
||||||
|
// Detect El Torito feature first.
|
||||||
|
// And always continue to search for UDF.
|
||||||
|
//
|
||||||
|
Status = PartitionInstallElToritoChildHandles (
|
||||||
|
This,
|
||||||
|
Handle,
|
||||||
|
DiskIo,
|
||||||
|
DiskIo2,
|
||||||
|
BlockIo,
|
||||||
|
BlockIo2,
|
||||||
|
DevicePath
|
||||||
|
);
|
||||||
|
if (!EFI_ERROR (Status)) {
|
||||||
|
DEBUG ((DEBUG_INFO, "PartitionDxe: El Torito standard found on handle 0x%p.\n", Handle));
|
||||||
|
ChildCreated = TRUE;
|
||||||
|
}
|
||||||
|
|
||||||
//
|
//
|
||||||
// Search for an UDF file system on block device
|
// Search for an UDF file system on block device
|
||||||
//
|
//
|
||||||
Status = FindUdfFileSystem (BlockIo, DiskIo, &StartingLBA, &EndingLBA);
|
Status = FindUdfFileSystem (BlockIo, DiskIo, &StartingLBA, &EndingLBA);
|
||||||
if (EFI_ERROR (Status)) {
|
if (EFI_ERROR (Status)) {
|
||||||
return EFI_NOT_FOUND;
|
return (ChildCreated ? EFI_SUCCESS : EFI_NOT_FOUND);
|
||||||
}
|
}
|
||||||
|
|
||||||
//
|
//
|
||||||
@ -735,6 +755,9 @@ PartitionInstallUdfChildHandles (
|
|||||||
EndingLBA,
|
EndingLBA,
|
||||||
Media->BlockSize
|
Media->BlockSize
|
||||||
);
|
);
|
||||||
|
if (EFI_ERROR (Status)) {
|
||||||
|
return (ChildCreated ? EFI_SUCCESS : Status);
|
||||||
|
}
|
||||||
|
|
||||||
return Status;
|
return EFI_SUCCESS;
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user