Skip to content

Commit

Permalink
a separate folder for OpenRuntime-v12 for possibility to start old Cl…
Browse files Browse the repository at this point in the history
…over with OpenRuntime-v11

Signed-off-by: SergeySlice <[email protected]>
  • Loading branch information
SergeySlice committed Nov 1, 2021
1 parent 24adc10 commit 57b9355
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 10 deletions.
2 changes: 1 addition & 1 deletion OpenCorePkg
33 changes: 24 additions & 9 deletions rEFIt_UEFI/refit/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -605,11 +605,12 @@ static XStringW getDriversPath()
} else {
return L"drivers64"_XSW; //backward compatibility
}
} else
if (FileExists(&self.getCloverDir(), L"drivers\\UEFI")) {
return L"drivers\\UEFI"_XSW;
} else if (FileExists(&self.getCloverDir(), L"drivers\\5142")) {
return L"drivers\\5142"_XSW;
} else if (FileExists(&self.getCloverDir(), L"drivers\\UEFI")) {
return L"drivers\\UEFI"_XSW;
} else {
return L"drivers64UEFI"_XSW;
return L"drivers64UEFI"_XSW;
}
#else
return L"drivers32"_XSW;
Expand Down Expand Up @@ -1814,7 +1815,7 @@ static void ScanDriverDir(IN CONST CHAR16 *Path, OUT EFI_HANDLE **DriversToConne
DriversArrSize = 0;
DriversArrNum = 0;
DriversArr = NULL;
OpenRuntimeEfiName.setEmpty();
// OpenRuntimeEfiName.setEmpty();

//only one driver with highest priority will obtain status "Loaded"
DirIterOpen(&self.getCloverDir(), Path, &DirIter);
Expand Down Expand Up @@ -1857,18 +1858,27 @@ static void ScanDriverDir(IN CONST CHAR16 *Path, OUT EFI_HANDLE **DriversToConne
if ( LStringW(DirEntry->FileName).containsIC("AptioMemoryFix") ) {
continue;
}

if ( LStringW(DirEntry->FileName).containsIC("OpenRuntime") ) {
if (!OpenRuntimeEfiName.isEmpty()) {
DBG(" - OpenRuntime already detected\n");
continue;
}
if ( LStringW(DirEntry->FileName).isEqualIC("OpenRuntime-v12.efi") && LString8(OPEN_CORE_VERSION).isEqual("0.7.5") ) {
OpenRuntimeEfiName.takeValueFrom(DirEntry->FileName);
DBG(" - OpenRuntime-v12 for 075 taken from %ls\n", getDriversPath().wc_str());
}else
if ( LStringW(DirEntry->FileName).isEqualIC("OpenRuntime-v12.efi") && LString8(OPEN_CORE_VERSION).isEqual("0.7.3") ) {
OpenRuntimeEfiName.takeValueFrom(DirEntry->FileName);
DBG(" - OpenRuntime-v12 for 073 taken from %ls\n", getDriversPath().wc_str());
}else
if ( LStringW(DirEntry->FileName).isEqualIC("OpenRuntime-v11.efi") && LString8(OPEN_CORE_VERSION).isEqual("0.6.5") ) {
OpenRuntimeEfiName.takeValueFrom(DirEntry->FileName);
DBG(" - OpenRuntime-v11 for 065 taken from %ls\n", getDriversPath().wc_str());
}else
if ( LStringW(DirEntry->FileName).isEqualIC("OpenRuntime-v11.efi") && LString8(OPEN_CORE_VERSION).isEqual("0.6.1") ) {
OpenRuntimeEfiName.takeValueFrom(DirEntry->FileName);
DBG(" - OpenRuntime-v11 for 061 taken from %ls\n", getDriversPath().wc_str());
}else
if ( OpenRuntimeEfiName.isEmpty() ) {
OpenRuntimeEfiName.takeValueFrom(DirEntry->FileName);
Expand Down Expand Up @@ -2231,11 +2241,16 @@ static void LoadDrivers(void)
} else {
ScanDriverDir(L"drivers64", &DriversToConnect, &DriversToConnectNum);
}
} else
if (FileExists(&self.getCloverDir(), L"drivers\\UEFI")) {
ScanDriverDir(L"drivers\\UEFI", &DriversToConnect, &DriversToConnectNum);
} else {
ScanDriverDir(L"drivers64UEFI", &DriversToConnect, &DriversToConnectNum);
OpenRuntimeEfiName.setEmpty();
if (FileExists(&self.getCloverDir(), L"drivers\\5142")) {
ScanDriverDir(L"drivers\\5142", &DriversToConnect, &DriversToConnectNum);
}
if (FileExists(&self.getCloverDir(), L"drivers\\UEFI")) {
ScanDriverDir(L"drivers\\UEFI", &DriversToConnect, &DriversToConnectNum);
} else {
ScanDriverDir(L"drivers64UEFI", &DriversToConnect, &DriversToConnectNum);
}
}
#else
ScanDriverDir(L"drivers32", &DriversToConnect, &DriversToConnectNum);
Expand Down

0 comments on commit 57b9355

Please sign in to comment.