Get version for installer.

OcLog initialisation.
This commit is contained in:
jief666 2020-09-07 17:44:24 +03:00
parent 51e3315e3c
commit 257667f2f1
3 changed files with 29 additions and 10 deletions

View File

@ -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()) {

View File

@ -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

View File

@ -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);