提交 33c1bed2 编写于 作者: V vit9696

OcBootManagementLib: Workaround displaying Preboot due to macOS 11 bug

上级 fdfdc7e0
...@@ -12,6 +12,7 @@ OpenCore Changelog ...@@ -12,6 +12,7 @@ OpenCore Changelog
- Added 32-bit kernel/kext patching/blocking support - Added 32-bit kernel/kext patching/blocking support
- Fixed issues loading 10.7 EfiBoot - Fixed issues loading 10.7 EfiBoot
- Added `Type` to `ReservedMemory` to fulfil hibernation hack needs - Added `Type` to `ReservedMemory` to fulfil hibernation hack needs
- Added workaround to displaying `Preboot` instead of `Macintosh HD`
#### v0.6.1 #### v0.6.1
- Improved recognition of early pressed hotkeys, thx @varahash - Improved recognition of early pressed hotkeys, thx @varahash
......
...@@ -506,7 +506,7 @@ InternalDescribeBootEntry ( ...@@ -506,7 +506,7 @@ InternalDescribeBootEntry (
{ {
EFI_STATUS Status; EFI_STATUS Status;
CHAR16 *BootDirectoryName; CHAR16 *BootDirectoryName;
CHAR16 *RecoveryBootName; CHAR16 *TmpBootName;
EFI_HANDLE Device; EFI_HANDLE Device;
UINT32 BcdSize; UINT32 BcdSize;
EFI_SIMPLE_FILE_SYSTEM_PROTOCOL *FileSystem; EFI_SIMPLE_FILE_SYSTEM_PROTOCOL *FileSystem;
...@@ -579,16 +579,26 @@ InternalDescribeBootEntry ( ...@@ -579,16 +579,26 @@ InternalDescribeBootEntry (
if (BootEntry->Name == NULL) { if (BootEntry->Name == NULL) {
BootEntry->Name = GetVolumeLabel (FileSystem); BootEntry->Name = GetVolumeLabel (FileSystem);
if (BootEntry->Name != NULL if (BootEntry->Name != NULL) {
&& (!StrCmp (BootEntry->Name, L"Recovery HD") if (StrCmp (BootEntry->Name, L"Recovery HD") == 0
|| !StrCmp (BootEntry->Name, L"Recovery"))) { || StrCmp (BootEntry->Name, L"Recovery") == 0) {
if (BootEntry->Type == OC_BOOT_UNKNOWN || BootEntry->Type == OC_BOOT_APPLE_OS) { if (BootEntry->Type == OC_BOOT_UNKNOWN || BootEntry->Type == OC_BOOT_APPLE_OS) {
BootEntry->Type = OC_BOOT_APPLE_RECOVERY; BootEntry->Type = OC_BOOT_APPLE_RECOVERY;
}
TmpBootName = InternalGetAppleRecoveryName (FileSystem, BootDirectoryName);
} else if (StrCmp (BootEntry->Name, L"Preboot") == 0) {
//
// Common Big Sur beta bug failing to create .contentDetails files.
// Workaround it by choosing the default name following Apple BootPicker behaviour.
//
TmpBootName = AllocateCopyPool (sizeof (L"Macintosh HD"), L"Macintosh HD");
} else {
TmpBootName = NULL;
} }
RecoveryBootName = InternalGetAppleRecoveryName (FileSystem, BootDirectoryName);
if (RecoveryBootName != NULL) { if (TmpBootName != NULL) {
FreePool (BootEntry->Name); FreePool (BootEntry->Name);
BootEntry->Name = RecoveryBootName; BootEntry->Name = TmpBootName;
} }
} }
} }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册