From 257667f2f1b6ea6f06c522d5484093a580ba51d8 Mon Sep 17 00:00:00 2001 From: jief666 Date: Mon, 7 Sep 2020 17:44:24 +0300 Subject: [PATCH] Get version for installer. OcLog initialisation. --- rEFIt_UEFI/Platform/Settings.cpp | 8 ++++++++ rEFIt_UEFI/entry_scan/loader.cpp | 5 ----- rEFIt_UEFI/refit/main.cpp | 26 +++++++++++++++++++++----- 3 files changed, 29 insertions(+), 10 deletions(-) diff --git a/rEFIt_UEFI/Platform/Settings.cpp b/rEFIt_UEFI/Platform/Settings.cpp index b58ac8db5..81ddeaf4e 100644 --- a/rEFIt_UEFI/Platform/Settings.cpp +++ b/rEFIt_UEFI/Platform/Settings.cpp @@ -6106,6 +6106,14 @@ XString8 GetOSVersion(IN LOADER_ENTRY *Entry) } } + if ( OSVersion.isEmpty() ) + { + if ( FileExists(Entry->Volume->RootDir, SWPrintf("\\%ls\\com.apple.installer\\BridgeVersion.plist", Entry->APFSTargetUUID.wc_str()).wc_str()) ) { + OSVersion = "11.0"_XS8; + // TODO sa far, is there is a BridgeVersion.plist, it's version 11.0. Has to be improved with next releases. + } + } + // 1st stage - 2 // Check for plist - createinstallmedia/NetInstall if (OSVersion.isEmpty()) { diff --git a/rEFIt_UEFI/entry_scan/loader.cpp b/rEFIt_UEFI/entry_scan/loader.cpp index 0a7798eef..9a4ad4a7a 100644 --- a/rEFIt_UEFI/entry_scan/loader.cpp +++ b/rEFIt_UEFI/entry_scan/loader.cpp @@ -1286,11 +1286,6 @@ STATIC VOID LinuxScan(REFIT_VOLUME *Volume, UINT8 KernelScan, UINT8 Type, XStrin } -//constants -//const XStringW APFSFVBootPath = L"\\00000000-0000-0000-0000-000000000000\\System\\Library\\CoreServices\\boot.efi"_XSW; -//const XStringW APFSRecBootPath = L"\\00000000-0000-0000-0000-000000000000\\boot.efi"_XSW; -//const XStringW APFSInstallBootPath = L"\\00000000-0000-0000-0000-000000000000\\com.apple.installer\\boot.efi"_XSW; - #define Paper 1 #define Rock 2 #define Scissor 4 diff --git a/rEFIt_UEFI/refit/main.cpp b/rEFIt_UEFI/refit/main.cpp index da6aef7ab..2a5ee614f 100644 --- a/rEFIt_UEFI/refit/main.cpp +++ b/rEFIt_UEFI/refit/main.cpp @@ -1045,6 +1045,14 @@ VOID OcLoadBooterUefiSupport ( IN OC_GLOBAL_CONFIG *Config ); + +UINT64 +InternalCalculateARTFrequencyIntel ( + OUT UINT64 *CPUFrequency, + OUT UINT64 *TscAdjustPtr OPTIONAL, + IN BOOLEAN Recalculate + ); + } // extern "C" #define OC_STRING_ASSIGN(ocString, value) do { \ @@ -1202,14 +1210,17 @@ VOID LOADER_ENTRY::StartLoader11() // // Assume no protocol AptioMemoryFix is installed. // } // -// + + UINT64 CPUFrequencyFromART; + InternalCalculateARTFrequencyIntel(&CPUFrequencyFromART, NULL, 1); + EFI_LOADED_IMAGE* OcLoadedImage; Status = gBS->HandleProtocol(gImageHandle, &gEfiLoadedImageProtocolGuid, (VOID **) &OcLoadedImage); EFI_SIMPLE_FILE_SYSTEM_PROTOCOL* FileSystem = LocateFileSystem(OcLoadedImage->DeviceHandle, OcLoadedImage->FilePath); Status = OcStorageInitFromFs(&mOpenCoreStorage, FileSystem, L"EFI\\CLOVER", NULL); OcConfigureLogProtocol ( - 127, + 9, 0, 2151678018, 2147483648, @@ -2506,6 +2517,10 @@ RefitMain (IN EFI_HANDLE ImageHandle, ConsoleInHandle = SystemTable->ConsoleInHandle; +#ifdef DEBUG_ON_SERIAL_PORT + SerialPortInitialize(); +#endif + { EFI_LOADED_IMAGE* LoadedImage; Status = gBS->HandleProtocol(gImageHandle, &gEfiLoadedImageProtocolGuid, (VOID **) &LoadedImage); @@ -2525,14 +2540,16 @@ RefitMain (IN EFI_HANDLE ImageHandle, construct_globals_objects(gImageHandle); // do this after SelfLoadedImage is initialized - +// UINT64 CPUFrequencyFromART; +// InternalCalculateARTFrequencyIntel(&CPUFrequencyFromART, NULL, 1); +// // EFI_LOADED_IMAGE* OcLoadedImage; // Status = gBS->HandleProtocol(gImageHandle, &gEfiLoadedImageProtocolGuid, (VOID **) &OcLoadedImage); // EFI_SIMPLE_FILE_SYSTEM_PROTOCOL* FileSystem = LocateFileSystem(OcLoadedImage->DeviceHandle, OcLoadedImage->FilePath); // Status = OcStorageInitFromFs(&mOpenCoreStorage, FileSystem, L"EFI\\CLOVER", NULL); // // OcConfigureLogProtocol ( -// 127, +// 9, // 0, // 2151678018, // 2147483648, @@ -2541,7 +2558,6 @@ RefitMain (IN EFI_HANDLE ImageHandle, // ); // DEBUG ((DEBUG_INFO, "OC: Log initialized...\n")); // OcAppleDebugLogInstallProtocol(0); -// OcLoadBooterUefiSupport(&mOpenCoreConfiguration);