mirror of https://github.com/acidanthera/audk.git
Originally BDS only creates boot options for removable media, the patch creates boot options for fixed media as well.
Signed-off-by: niruiyu Reviewed-by: li-elvin git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@11707 6f19259b-4bc3-4df7-8a09-765794883524
This commit is contained in:
parent
3d0a23854e
commit
35bc0e9f02
|
@ -1,7 +1,7 @@
|
|||
/** @file
|
||||
BDS Lib functions which relate with create or process the boot option.
|
||||
|
||||
Copyright (c) 2004 - 2010, Intel Corporation. All rights reserved.<BR>
|
||||
Copyright (c) 2004 - 2011, Intel Corporation. All rights reserved.<BR>
|
||||
This program and the accompanying materials
|
||||
are licensed and made available under the terms and conditions of the BSD License
|
||||
which accompanies this distribution. The full text of the license may be found at
|
||||
|
@ -1406,6 +1406,8 @@ BdsLibEnumerateAllBootOption (
|
|||
UINTN NumberBlockIoHandles;
|
||||
EFI_HANDLE *BlockIoHandles;
|
||||
EFI_BLOCK_IO_PROTOCOL *BlkIo;
|
||||
BOOLEAN Removable[2];
|
||||
UINTN RemovableIndex;
|
||||
UINTN Index;
|
||||
UINTN NumOfLoadFileHandles;
|
||||
EFI_HANDLE *LoadFileHandles;
|
||||
|
@ -1428,6 +1430,8 @@ BdsLibEnumerateAllBootOption (
|
|||
EFI_IMAGE_OPTIONAL_HEADER_UNION HdrData;
|
||||
EFI_IMAGE_OPTIONAL_HEADER_PTR_UNION Hdr;
|
||||
|
||||
Removable[0] = FALSE;
|
||||
Removable[1] = TRUE;
|
||||
FloppyNumber = 0;
|
||||
CdromNumber = 0;
|
||||
UsbNumber = 0;
|
||||
|
@ -1480,7 +1484,7 @@ BdsLibEnumerateAllBootOption (
|
|||
BdsDeleteAllInvalidEfiBootOption ();
|
||||
|
||||
//
|
||||
// Parse removable media
|
||||
// Parse removable media followed by fixed media
|
||||
//
|
||||
gBS->LocateHandleBuffer (
|
||||
ByProtocol,
|
||||
|
@ -1490,20 +1494,19 @@ BdsLibEnumerateAllBootOption (
|
|||
&BlockIoHandles
|
||||
);
|
||||
|
||||
for (RemovableIndex = 0; RemovableIndex < 2; RemovableIndex++) {
|
||||
for (Index = 0; Index < NumberBlockIoHandles; Index++) {
|
||||
Status = gBS->HandleProtocol (
|
||||
BlockIoHandles[Index],
|
||||
&gEfiBlockIoProtocolGuid,
|
||||
(VOID **) &BlkIo
|
||||
);
|
||||
if (!EFI_ERROR (Status)) {
|
||||
if (!BlkIo->Media->RemovableMedia) {
|
||||
//
|
||||
// skip the non-removable block devices
|
||||
// skip the fixed block io then the removable block io
|
||||
//
|
||||
if (EFI_ERROR (Status) || (BlkIo->Media->RemovableMedia == Removable[RemovableIndex])) {
|
||||
continue;
|
||||
}
|
||||
}
|
||||
DevicePath = DevicePathFromHandle (BlockIoHandles[Index]);
|
||||
DevicePathType = BdsGetBootTypeFromDevicePath (DevicePath);
|
||||
|
||||
|
@ -1567,6 +1570,7 @@ BdsLibEnumerateAllBootOption (
|
|||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (NumberBlockIoHandles != 0) {
|
||||
FreePool (BlockIoHandles);
|
||||
|
|
Loading…
Reference in New Issue