Preserve backward compatibility

This commit is contained in:
jief 2019-12-11 14:22:21 +01:00
parent ffb691c078
commit d1abb9167c
2 changed files with 25 additions and 25 deletions

View File

@ -467,23 +467,20 @@ EFI_STATUS LoadKexts(IN LOADER_ENTRY *Entry)
}
// Add kext from 10.{version}.x
// Add kext from 10.{version}
{
CHAR16 UniOSVersionDotX[16];
UnicodeSPrint(UniOSVersionDotX, sizeof(UniOSVersionDotX), L"%a.x", ShortOSVersion);
CHAR16 OSShortVersionDotXKextsDir[1024];
UnicodeSPrint(OSShortVersionDotXKextsDir, sizeof(OSShortVersionDotXKextsDir), L"%s\\kexts\\%s", OEMPath, UniOSVersionDotX);
AddKexts(Entry, OSShortVersionDotXKextsDir, UniOSVersionDotX, archCpuType);
CHAR16 OSShortVersionKextsDir[1024];
UnicodeSPrint(OSShortVersionKextsDir, sizeof(OSShortVersionKextsDir), L"%s\\kexts\\%s", OEMPath, UniShortOSVersion);
AddKexts(Entry, OSShortVersionKextsDir, UniShortOSVersion, archCpuType);
CHAR16 DirName[256];
if (OSTYPE_IS_OSX_INSTALLER(Entry->LoaderType)) {
UnicodeSPrint(DirName, sizeof(DirName), L"%s_install", UniOSVersionDotX);
UnicodeSPrint(DirName, sizeof(DirName), L"%s_install", UniShortOSVersion);
} else {
if (OSTYPE_IS_OSX_RECOVERY(Entry->LoaderType)) {
UnicodeSPrint(DirName, sizeof(DirName), L"%s_recovery", UniOSVersionDotX);
UnicodeSPrint(DirName, sizeof(DirName), L"%s_recovery", UniShortOSVersion);
}else{
UnicodeSPrint(DirName, sizeof(DirName), L"%s_normal", UniOSVersionDotX);
UnicodeSPrint(DirName, sizeof(DirName), L"%s_normal", UniShortOSVersion);
}
}
CHAR16 DirPath[1024];
@ -492,11 +489,15 @@ EFI_STATUS LoadKexts(IN LOADER_ENTRY *Entry)
}
// Add kext from :
// 10.{version} if NO minor version
// 10.{version}.0 if NO minor version
// 10.{version}.{minor version} if minor version is > 0
{
CHAR16 OSVersionKextsDirName[256];
UnicodeSPrint(OSVersionKextsDirName, sizeof(OSVersionKextsDirName), L"%a", Entry->OSVersion);
if ( AsciiStrCmp(ShortOSVersion, Entry->OSVersion) == 0 ) {
UnicodeSPrint(OSVersionKextsDirName, sizeof(OSVersionKextsDirName), L"%a.0", Entry->OSVersion);
}else{
UnicodeSPrint(OSVersionKextsDirName, sizeof(OSVersionKextsDirName), L"%a", Entry->OSVersion);
}
CHAR16 DirPath[1024];
UnicodeSPrint(DirPath, sizeof(DirPath), L"%s\\kexts\\%s", OEMPath, OSVersionKextsDirName);

View File

@ -4716,39 +4716,38 @@ LOADER_ENTRY *SubMenuKextInjectMgmt(LOADER_ENTRY *Entry)
AddMenuEntry(SubScreen, SubMenuKextBlockInjection(DirName));
}
// Add kext from 10.{version}.x
// Add kext from 10.{version}
{
CHAR16 DirName[256];
UnicodeSPrint(DirName, sizeof(DirName), L"%a.x", ShortOSVersion);
UnicodeSPrint(DirName, sizeof(DirName), L"%a", ShortOSVersion);
AddMenuEntry(SubScreen, SubMenuKextBlockInjection(DirName));
if (OSTYPE_IS_OSX_INSTALLER(Entry->LoaderType)) {
UnicodeSPrint(DirName, sizeof(DirName), L"%a.x_install",
ShortOSVersion);
UnicodeSPrint(DirName, sizeof(DirName), L"%a_install", ShortOSVersion);
}
else {
if (OSTYPE_IS_OSX_RECOVERY(Entry->LoaderType)) {
UnicodeSPrint(DirName, sizeof(DirName), L"%a.x_recovery",
ShortOSVersion);
UnicodeSPrint(DirName, sizeof(DirName), L"%a_recovery", ShortOSVersion);
}
else {
UnicodeSPrint(DirName, sizeof(DirName), L"%a.x_normal",
ShortOSVersion);
UnicodeSPrint(DirName, sizeof(DirName), L"%a_normal", ShortOSVersion);
}
}
AddMenuEntry(SubScreen, SubMenuKextBlockInjection(DirName));
}
// Add kext from :
// 10.{version} if NO minor version
// 10.{version}.0 if NO minor version
// 10.{version}.{minor version} if minor version is > 0
{
{
CHAR16 OSVersionKextsDirName[256];
UnicodeSPrint(OSVersionKextsDirName,
sizeof(OSVersionKextsDirName), L"%a", Entry->OSVersion);
AddMenuEntry(SubScreen,
SubMenuKextBlockInjection(OSVersionKextsDirName));
if ( AsciiStrCmp(ShortOSVersion, Entry->OSVersion) == 0 ) {
UnicodeSPrint(OSVersionKextsDirName, sizeof(OSVersionKextsDirName), L"%a.0", Entry->OSVersion);
}else{
UnicodeSPrint(OSVersionKextsDirName, sizeof(OSVersionKextsDirName), L"%a", Entry->OSVersion);
}
AddMenuEntry(SubScreen, SubMenuKextBlockInjection(OSVersionKextsDirName));
}
CHAR16 DirName[256];