diff --git a/Changelog.md b/Changelog.md index bd46b5f0..d1e87a3d 100644 --- a/Changelog.md +++ b/Changelog.md @@ -1,6 +1,9 @@ OpenCore Changelog ================== +#### v0.5.7 +- Added TimeMachine detection to picker + #### v0.5.6 - Various improvements to builtin text renderer - Fixed locating DMG recovery in APTIO IV firmwares on FAT32 diff --git a/Docs/Configuration.pdf b/Docs/Configuration.pdf index d1ee25a0..3554b3e3 100644 Binary files a/Docs/Configuration.pdf and b/Docs/Configuration.pdf differ diff --git a/Docs/Configuration.tex b/Docs/Configuration.tex index 6d3b1690..3c6c8035 100755 --- a/Docs/Configuration.tex +++ b/Docs/Configuration.tex @@ -2081,6 +2081,7 @@ behaviour that does not go to any other sections \begin{itemize} \tightlist \item Entry is macOS recovery. + \item Entry is macOS Time Machine. \item Entry is explicitly marked as \texttt{Auxiliary}. \item Entry is system (e.g. \texttt{Clean NVRAM}). \end{itemize} diff --git a/Docs/Differences/Differences.pdf b/Docs/Differences/Differences.pdf index 651420b4..ae888ee1 100644 Binary files a/Docs/Differences/Differences.pdf and b/Docs/Differences/Differences.pdf differ diff --git a/Docs/Differences/Differences.tex b/Docs/Differences/Differences.tex index d17f2dee..e44610d6 100644 --- a/Docs/Differences/Differences.tex +++ b/Docs/Differences/Differences.tex @@ -1,7 +1,7 @@ \documentclass[]{article} %DIF LATEXDIFF DIFFERENCE FILE -%DIF DEL PreviousConfiguration.tex Wed Mar 4 15:32:59 2020 -%DIF ADD ../Configuration.tex Wed Mar 4 21:55:23 2020 +%DIF DEL PreviousConfiguration.tex Fri Mar 6 09:43:05 2020 +%DIF ADD ../Configuration.tex Fri Mar 6 23:22:27 2020 \usepackage{lmodern} \usepackage{amssymb,amsmath} @@ -2141,7 +2141,8 @@ behaviour that does not go to any other sections \begin{itemize} \tightlist \item Entry is macOS recovery. - \item Entry is explicitly marked as \texttt{Auxiliary}. + \item Entry is \DIFaddbegin \DIFadd{macOS Time Machine. + }\item \DIFadd{Entry is }\DIFaddend explicitly marked as \texttt{Auxiliary}. \item Entry is system (e.g. \texttt{Clean NVRAM}). \end{itemize} diff --git a/Include/Library/OcBootManagementLib.h b/Include/Library/OcBootManagementLib.h index d09f0c7c..fc4d4c36 100755 --- a/Include/Library/OcBootManagementLib.h +++ b/Include/Library/OcBootManagementLib.h @@ -72,8 +72,9 @@ typedef struct OC_PICKER_CONTEXT_ OC_PICKER_CONTEXT; **/ typedef enum OC_BOOT_ENTRY_TYPE_ { OcBootUnknown, - OcBootApple, + OcBootAppleOs, OcBootAppleRecovery, + OcBootAppleTimeMachine, OcBootWindows, OcBootCustom, OcBootSystem diff --git a/Include/Protocol/OcAudio.h b/Include/Protocol/OcAudio.h index 28b40004..0a6b8cc8 100644 --- a/Include/Protocol/OcAudio.h +++ b/Include/Protocol/OcAudio.h @@ -87,20 +87,21 @@ typedef enum { OcVoiceOverAudioFileLoading = 0x1039, OcVoiceOverAudioFilemacOS = 0x103A, OcVoiceOverAudioFilemacOS_Recovery = 0x103B, - OcVoiceOverAudioFileOtherOS = 0x103C, - OcVoiceOverAudioFilePasswordAccepted = 0x103D, - OcVoiceOverAudioFilePasswordIncorrect = 0x103E, - OcVoiceOverAudioFilePasswordRetryLimit = 0x103F, - OcVoiceOverAudioFileReloading = 0x1040, - OcVoiceOverAudioFileResetNVRAM = 0x1041, - OcVoiceOverAudioFileSelected = 0x1042, - OcVoiceOverAudioFileShowAuxiliary = 0x1043, - OcVoiceOverAudioFileTimeout = 0x1044, - OcVoiceOverAudioFileUEFI_Shell = 0x1045, - OcVoiceOverAudioFileWelcome = 0x1046, - OcVoiceOverAudioFileWindows = 0x1047, + OcVoiceOverAudioFilemacOS_TimeMachine = 0x103C, + OcVoiceOverAudioFileOtherOS = 0x103D, + OcVoiceOverAudioFilePasswordAccepted = 0x103E, + OcVoiceOverAudioFilePasswordIncorrect = 0x103F, + OcVoiceOverAudioFilePasswordRetryLimit = 0x1040, + OcVoiceOverAudioFileReloading = 0x1041, + OcVoiceOverAudioFileResetNVRAM = 0x1042, + OcVoiceOverAudioFileSelected = 0x1043, + OcVoiceOverAudioFileShowAuxiliary = 0x1044, + OcVoiceOverAudioFileTimeout = 0x1045, + OcVoiceOverAudioFileUEFI_Shell = 0x1046, + OcVoiceOverAudioFileWelcome = 0x1047, + OcVoiceOverAudioFileWindows = 0x1048, - OcVoiceOverAudioFileMax = 0x1048, + OcVoiceOverAudioFileMax = 0x1049, } OC_VOICE_OVER_AUDIO_FILE; STATIC_ASSERT (OcVoiceOverAudioFileIndexMax - OcVoiceOverAudioFileIndexBase == 9 + 26, "Invalid index count"); diff --git a/Library/OcBootManagementLib/BootAudio.c b/Library/OcBootManagementLib/BootAudio.c index 0ac53dbe..7051dd35 100644 --- a/Library/OcBootManagementLib/BootAudio.c +++ b/Library/OcBootManagementLib/BootAudio.c @@ -178,10 +178,12 @@ OcPlayAudioEntry ( { OcPlayAudioFile (Context, OcVoiceOverAudioFileIndexBase + Number, FALSE); - if (Entry->Type == OcBootApple) { + if (Entry->Type == OcBootAppleOs) { OcPlayAudioFile (Context, OcVoiceOverAudioFilemacOS, FALSE); } else if (Entry->Type == OcBootAppleRecovery) { OcPlayAudioFile (Context, OcVoiceOverAudioFilemacOS_Recovery, FALSE); + } else if (Entry->Type == OcBootAppleTimeMachine) { + OcPlayAudioFile (Context, OcVoiceOverAudioFilemacOS_TimeMachine, FALSE); } else if (Entry->Type == OcBootWindows) { OcPlayAudioFile (Context, OcVoiceOverAudioFileWindows, FALSE); } else if (StrStr (Entry->Name, OC_MENU_UEFI_SHELL_ENTRY) != NULL) { diff --git a/Library/OcBootManagementLib/BootEntryInfo.c b/Library/OcBootManagementLib/BootEntryInfo.c index 888b2805..2f88bed4 100644 --- a/Library/OcBootManagementLib/BootEntryInfo.c +++ b/Library/OcBootManagementLib/BootEntryInfo.c @@ -301,6 +301,7 @@ InternalSetBootEntryFlags ( FILEPATH_DEVICE_PATH *FilePath; UINTN Len; UINTN Index; + UINTN Index2; BOOLEAN Result; INTN CmpResult; @@ -313,6 +314,21 @@ InternalSetBootEntryFlags ( return; } + STATIC CONST CHAR16 *BootInstanceNames[] = { + L"com.apple.recovery.boot", + L"tmbootpicker.efi" + }; + + STATIC UINTN BootInstanceLengths[] = { + L_STR_LEN (L"com.apple.recovery.boot"), + L_STR_LEN (L"tmbootpicker.efi") + }; + + STATIC UINT32 BootInstanceTypes[] = { + OcBootAppleRecovery, + OcBootAppleTimeMachine + }; + // // TODO: Move this to a new OcIsAppleRecoveryBootDevicePath function. // @@ -328,20 +344,21 @@ InternalSetBootEntryFlags ( BootEntry->IsFolder = (FilePath->PathName[Len - 1] == L'\\'); if (BootEntry->Type == OcBootUnknown) { - Result = OcOverflowSubUN ( - Len, - L_STR_LEN (L"com.apple.recovery.boot"), - &Len - ); - if (!Result) { - for (Index = 0; Index < Len; ++Index) { + CmpResult = -1; + for (Index = 0; Index < ARRAY_SIZE (BootInstanceNames) && CmpResult != 0; ++Index) { + Result = OcOverflowSubUN (Len, BootInstanceLengths[Index], &Len); + if (Result) { + continue; + } + + for (Index2 = 0; Index2 < Len; ++Index2) { CmpResult = CompareMem ( - &FilePath->PathName[Index], - L"com.apple.recovery.boot", - L_STR_SIZE_NT (L"com.apple.recovery.boot") - ); + &FilePath->PathName[Index2], + BootInstanceNames[Index], + BootInstanceLengths[Index] * sizeof (BootInstanceNames[Index][0]) + ); if (CmpResult == 0) { - BootEntry->Type = OcBootAppleRecovery; + BootEntry->Type = BootInstanceTypes[Index]; break; } } @@ -356,7 +373,7 @@ InternalSetBootEntryFlags ( } if (BootEntry->Type == OcBootUnknown && OcIsAppleBootDevicePath (BootEntry->DevicePath)) { - BootEntry->Type = OcBootApple; + BootEntry->Type = OcBootAppleOs; } } @@ -561,9 +578,11 @@ InternalFillValidBootEntries ( InternalSetBootEntryFlags (&Entries[EntryIndex]); // - // This entry can still be legacy HFS non-dmg recovery, ensure that it is not. + // This entry can still be legacy HFS non-dmg recovery or Time Machine, ensure that it is not. // - if (Context->HideAuxiliary && Entries[EntryIndex].Type == OcBootAppleRecovery) { + if (Context->HideAuxiliary + && (Entries[EntryIndex].Type == OcBootAppleRecovery + || Entries[EntryIndex].Type == OcBootAppleTimeMachine)) { ZeroMem (&Entries[EntryIndex], sizeof (Entries[EntryIndex])); FreePool (DevicePath); continue; diff --git a/Library/OcBootManagementLib/BootEntryManagement.c b/Library/OcBootManagementLib/BootEntryManagement.c index a2cd88e3..feca804c 100644 --- a/Library/OcBootManagementLib/BootEntryManagement.c +++ b/Library/OcBootManagementLib/BootEntryManagement.c @@ -110,7 +110,7 @@ OcDescribeBootEntry ( if (BootEntry->Name != NULL && (!StrCmp (BootEntry->Name, L"Recovery HD") || !StrCmp (BootEntry->Name, L"Recovery"))) { - if (BootEntry->Type == OcBootUnknown || BootEntry->Type == OcBootApple) { + if (BootEntry->Type == OcBootUnknown || BootEntry->Type == OcBootAppleOs) { BootEntry->Type = OcBootAppleRecovery; } RecoveryBootName = InternalGetAppleRecoveryName (FileSystem, BootDirectoryName); diff --git a/Library/OcBootManagementLib/DefaultEntryChoice.c b/Library/OcBootManagementLib/DefaultEntryChoice.c index a699e464..eef805d7 100644 --- a/Library/OcBootManagementLib/DefaultEntryChoice.c +++ b/Library/OcBootManagementLib/DefaultEntryChoice.c @@ -763,9 +763,9 @@ OcGetDefaultBootEntry ( } if (Context->PickerCommand == OcPickerBootApple) { - if (BootEntries[BootEntryIndex].Type != OcBootApple) { + if (BootEntries[BootEntryIndex].Type != OcBootAppleOs) { for (Index = 0; Index < NumBootEntries; ++Index) { - if (BootEntries[Index].Type == OcBootApple) { + if (BootEntries[Index].Type == OcBootAppleOs) { BootEntryIndex = (UINT32) Index; DEBUG ((DEBUG_INFO, "OCB: Override default to Apple %u\n", BootEntryIndex)); break; @@ -1217,7 +1217,9 @@ InternalLoadBootEntry ( LoadedImage->LoadOptions = NULL; if (BootEntry->LoadOptions == NULL - && (BootEntry->Type == OcBootApple || BootEntry->Type == OcBootAppleRecovery)) { + && (BootEntry->Type == OcBootAppleOs + || BootEntry->Type == OcBootAppleRecovery + || BootEntry->Type == OcBootAppleTimeMachine)) { Args = Context->AppleBootArgs; ArgsLen = (UINT32)AsciiStrLen (Args); } else { diff --git a/Platform/OpenCore/OpenCoreUefiAudio.c b/Platform/OpenCore/OpenCoreUefiAudio.c index bdc2c376..6e7cdcdb 100644 --- a/Platform/OpenCore/OpenCoreUefiAudio.c +++ b/Platform/OpenCore/OpenCoreUefiAudio.c @@ -140,6 +140,9 @@ OcAudioAcquireFile ( case OcVoiceOverAudioFilemacOS_Recovery: BasePath = "macOS_Recovery"; break; + case OcVoiceOverAudioFilemacOS_TimeMachine: + BasePath = "macOS_TimeMachine"; + break; case OcVoiceOverAudioFileOtherOS: BasePath = "OtherOS"; break;