- Timestamp:
- Sep 18, 2019 8:59:08 PM (5 years ago)
- Location:
- trunk/src/VBox/Devices/EFI/FirmwareNew/MdeModulePkg/Library/UefiBootManagerLib
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Devices/EFI/FirmwareNew/MdeModulePkg/Library/UefiBootManagerLib/BmBoot.c
r80721 r80901 994 994 } 995 995 996 #ifdef VBOX 997 /** 998 * Checks which filename to try loading by inspecting what is existing on the provided 999 * simple filesystem protocol provider. 1000 * 1001 * This is required to support booting macOS as it stores the efi OS loader in a non standard location 1002 * and we have to support both styles without rewriting half of the boot manager library. 1003 */ 1004 EFI_STATUS VBoxBmQueryMediaFileNameForSFs(EFI_HANDLE hSFs, CHAR16 **ppwszFileName) 1005 { 1006 EFI_STATUS Status = EFI_SUCCESS; 1007 EFI_SIMPLE_FILE_SYSTEM_PROTOCOL *pSFs = NULL; 1008 EFI_FILE_PROTOCOL *pRoot = NULL; 1009 EFI_FILE_PROTOCOL *pFile = NULL; 1010 1011 *ppwszFileName = EFI_REMOVABLE_MEDIA_FILE_NAME; 1012 1013 Status = gBS->HandleProtocol(hSFs, &gEfiSimpleFileSystemProtocolGuid, &pSFs); 1014 if (!EFI_ERROR(Status)) 1015 { 1016 Status = pSFs->OpenVolume(pSFs, &pRoot); 1017 if (!EFI_ERROR(Status)) 1018 { 1019 Status = pRoot->Open(pRoot, &pFile, VBOX_EFI_APPLE_MEDIA_FILE_NAME, EFI_FILE_MODE_READ, 1020 EFI_FILE_READ_ONLY | EFI_FILE_HIDDEN | EFI_FILE_SYSTEM); 1021 if (!EFI_ERROR(Status)) 1022 { 1023 *ppwszFileName = VBOX_EFI_APPLE_MEDIA_FILE_NAME; 1024 pFile->Close(pFile); 1025 } 1026 1027 pRoot->Close(pRoot); 1028 } 1029 } 1030 1031 return EFI_SUCCESS; 1032 } 1033 #endif 1034 996 1035 /** 997 1036 Expand the media device path which points to a BlockIo or SimpleFileSystem instance … … 1023 1062 UINTN Index; 1024 1063 BOOLEAN GetNext; 1064 #ifdef VBOX 1065 CHAR16 *pwszFilename = NULL; 1066 #endif 1025 1067 1026 1068 GetNext = (BOOLEAN)(FullPath == NULL); 1069 1027 1070 // 1028 1071 // Check whether the device is connected … … 1033 1076 ASSERT (IsDevicePathEnd (TempDevicePath)); 1034 1077 1078 #ifndef VBOX 1035 1079 NextFullPath = FileDevicePath (Handle, EFI_REMOVABLE_MEDIA_FILE_NAME); 1080 #else 1081 Status = VBoxBmQueryMediaFileNameForSFs(Handle, &pwszFilename); 1082 if (!EFI_ERROR(Status)) 1083 NextFullPath = FileDevicePath (Handle, pwszFilename); 1084 else 1085 return NULL; 1086 #endif 1036 1087 // 1037 1088 // For device path pointing to simple file system, it only expands to one full path. … … 1101 1152 // 1102 1153 if ((Size <= TempSize) && (CompareMem (TempDevicePath, DevicePath, Size) == 0)) { 1154 #ifndef VBOX 1103 1155 NextFullPath = FileDevicePath (SimpleFileSystemHandles[Index], EFI_REMOVABLE_MEDIA_FILE_NAME); 1156 #else 1157 Status = VBoxBmQueryMediaFileNameForSFs(SimpleFileSystemHandles[Index], &pwszFilename); 1158 if (!EFI_ERROR(Status)) 1159 NextFullPath = FileDevicePath (SimpleFileSystemHandles[Index], pwszFilename); 1160 else 1161 return NULL; 1162 #endif 1104 1163 if (GetNext) { 1105 1164 break; -
trunk/src/VBox/Devices/EFI/FirmwareNew/MdeModulePkg/Library/UefiBootManagerLib/InternalBm.h
r80721 r80901 82 82 #endif 83 83 84 #ifdef VBOX 85 /* Support for booting Apple macOS. */ 86 # define VBOX_EFI_APPLE_MEDIA_FILE_NAME L"\\System\\Library\\CoreServices\\boot.efi" 87 #endif 88 84 89 typedef enum { 85 90 BmAcpiFloppyBoot,
Note:
See TracChangeset
for help on using the changeset viewer.