mirror of https://github.com/acidanthera/audk.git
1. Add usb LUD support in BDS
2. Enhance the orignal enumeration logic to check whether a internal shell boot option is valid. git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@5522 6f19259b-4bc3-4df7-8a09-765794883524
This commit is contained in:
parent
49f977a048
commit
a475bfa225
|
@ -182,6 +182,11 @@ BdsLibBootViaBootOption (
|
||||||
//
|
//
|
||||||
InitializeListHead (&TempBootLists);
|
InitializeListHead (&TempBootLists);
|
||||||
BdsLibRegisterNewOption (&TempBootLists, DevicePath, L"EFI Internal Shell", L"BootOrder");
|
BdsLibRegisterNewOption (&TempBootLists, DevicePath, L"EFI Internal Shell", L"BootOrder");
|
||||||
|
//
|
||||||
|
// free the temporary device path created by BdsLibUpdateFvFileDevicePath()
|
||||||
|
//
|
||||||
|
gBS->FreePool (DevicePath);
|
||||||
|
DevicePath = Option->DevicePath;
|
||||||
}
|
}
|
||||||
|
|
||||||
//
|
//
|
||||||
|
@ -1515,11 +1520,21 @@ BdsGetBootTypeFromDevicePath (
|
||||||
break;
|
break;
|
||||||
case MESSAGING_DEVICE_PATH:
|
case MESSAGING_DEVICE_PATH:
|
||||||
//
|
//
|
||||||
// if the device path not only point to driver device, it is not a messaging device path.
|
// Get the last device path node
|
||||||
//
|
//
|
||||||
LastDeviceNode = NextDevicePathNode (TempDevicePath);
|
LastDeviceNode = NextDevicePathNode (TempDevicePath);
|
||||||
|
if (DevicePathSubType(LastDeviceNode) == MSG_DEVICE_LOGICAL_UNIT_DP) {
|
||||||
|
//
|
||||||
|
// if the next node type is Device Logical Unit, which specify the Logical Unit Number (LUN),
|
||||||
|
// skit it
|
||||||
|
//
|
||||||
|
LastDeviceNode = NextDevicePathNode (LastDeviceNode);
|
||||||
|
}
|
||||||
|
//
|
||||||
|
// if the device path not only point to driver device, it is not a messaging device path,
|
||||||
|
//
|
||||||
if (!IsDevicePathEndType (LastDeviceNode)) {
|
if (!IsDevicePathEndType (LastDeviceNode)) {
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (DevicePathSubType(TempDevicePath) == MSG_ATAPI_DP) {
|
if (DevicePathSubType(TempDevicePath) == MSG_ATAPI_DP) {
|
||||||
|
@ -1615,13 +1630,24 @@ BdsLibIsValidEFIBootOptDevicePath (
|
||||||
}
|
}
|
||||||
|
|
||||||
//
|
//
|
||||||
// If the boot option point to a internal Shell, it is a valid EFI boot option,
|
// Check if it's a valid boot option for internal Shell
|
||||||
// and assume it is ready to boot now
|
|
||||||
//
|
//
|
||||||
if (EfiGetNameGuidFromFwVolDevicePathNode ((MEDIA_FW_VOL_FILEPATH_DEVICE_PATH *) LastDeviceNode) != NULL) {
|
if (EfiGetNameGuidFromFwVolDevicePathNode ((MEDIA_FW_VOL_FILEPATH_DEVICE_PATH *) LastDeviceNode) != NULL) {
|
||||||
return TRUE;
|
//
|
||||||
|
// If the boot option point to Internal FV shell, make sure it is valid
|
||||||
|
//
|
||||||
|
TempDevicePath = DevPath;
|
||||||
|
Status = BdsLibUpdateFvFileDevicePath (&TempDevicePath, &gEfiShellFileGuid);
|
||||||
|
if (Status == EFI_ALREADY_STARTED) {
|
||||||
|
return TRUE;
|
||||||
|
} else {
|
||||||
|
if (Status == EFI_SUCCESS) {
|
||||||
|
gBS->FreePool (TempDevicePath);
|
||||||
|
}
|
||||||
|
return FALSE;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
//
|
//
|
||||||
// If the boot option point to a blockIO device, no matter whether or not it is a removeable device, it is a valid EFI boot option
|
// If the boot option point to a blockIO device, no matter whether or not it is a removeable device, it is a valid EFI boot option
|
||||||
//
|
//
|
||||||
|
@ -1825,6 +1851,7 @@ BdsLibUpdateFvFileDevicePath (
|
||||||
// Second, if fail to find, try to enumerate all FV
|
// Second, if fail to find, try to enumerate all FV
|
||||||
//
|
//
|
||||||
if (!FindFvFile) {
|
if (!FindFvFile) {
|
||||||
|
FvHandleBuffer = NULL;
|
||||||
gBS->LocateHandleBuffer (
|
gBS->LocateHandleBuffer (
|
||||||
ByProtocol,
|
ByProtocol,
|
||||||
&gEfiFirmwareVolume2ProtocolGuid,
|
&gEfiFirmwareVolume2ProtocolGuid,
|
||||||
|
@ -1858,6 +1885,9 @@ BdsLibUpdateFvFileDevicePath (
|
||||||
FoundFvHandle = FvHandleBuffer[Index];
|
FoundFvHandle = FvHandleBuffer[Index];
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
if (FvHandleBuffer !=NULL ) {
|
||||||
|
FreePool (FvHandleBuffer);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (FindFvFile) {
|
if (FindFvFile) {
|
||||||
|
|
Loading…
Reference in New Issue