Merge pull request #62 from Florin9doi/p11_kexts_path

Fix kext injection for minor versions
This commit is contained in:
Sergey 2019-12-23 15:48:50 +03:00 committed by GitHub
commit d058be8f04
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 60 additions and 68 deletions

View File

@ -463,16 +463,13 @@ EFI_STATUS LoadKexts(IN LOADER_ENTRY *Entry)
if (OSTYPE_IS_OSX_INSTALLER(Entry->LoaderType)) { if (OSTYPE_IS_OSX_INSTALLER(Entry->LoaderType)) {
DirName = PoolPrint(L"10_install"); DirName = PoolPrint(L"10_install");
// UnicodeSPrint(DirName, sizeof(DirName), L"10_install"); // UnicodeSPrint(DirName, sizeof(DirName), L"10_install");
} else { } else if (OSTYPE_IS_OSX_RECOVERY(Entry->LoaderType)) {
if (OSTYPE_IS_OSX_RECOVERY(Entry->LoaderType)) {
DirName = PoolPrint(L"10_recovery"); DirName = PoolPrint(L"10_recovery");
// UnicodeSPrint(DirName, sizeof(DirName), L"10_recovery"); // UnicodeSPrint(DirName, sizeof(DirName), L"10_recovery");
} else { } else {
DirName = PoolPrint(L"10_normal"); DirName = PoolPrint(L"10_normal");
// UnicodeSPrint(DirName, sizeof(DirName), L"10_normal"); // UnicodeSPrint(DirName, sizeof(DirName), L"10_normal");
} }
}
DirPath = PoolPrint(L"%s\\kexts\\%s", OEMPath, DirName); DirPath = PoolPrint(L"%s\\kexts\\%s", OEMPath, DirName);
// UnicodeSPrint(DirPath, sizeof(DirPath), L"%s\\kexts\\%s", OEMPath, DirName); // UnicodeSPrint(DirPath, sizeof(DirPath), L"%s\\kexts\\%s", OEMPath, DirName);
AddKexts(Entry, DirPath, DirName, archCpuType); AddKexts(Entry, DirPath, DirName, archCpuType);
@ -490,32 +487,29 @@ EFI_STATUS LoadKexts(IN LOADER_ENTRY *Entry)
if (OSTYPE_IS_OSX_INSTALLER(Entry->LoaderType)) { if (OSTYPE_IS_OSX_INSTALLER(Entry->LoaderType)) {
DirName = PoolPrint(L"%s_install", UniShortOSVersion); DirName = PoolPrint(L"%s_install", UniShortOSVersion);
// UnicodeSPrint(DirName, sizeof(DirName), L"%s_install", UniShortOSVersion); // UnicodeSPrint(DirName, sizeof(DirName), L"%s_install", UniShortOSVersion);
} else { } else if (OSTYPE_IS_OSX_RECOVERY(Entry->LoaderType)) {
if (OSTYPE_IS_OSX_RECOVERY(Entry->LoaderType)) {
DirName = PoolPrint(L"%s_recovery", UniShortOSVersion); DirName = PoolPrint(L"%s_recovery", UniShortOSVersion);
// UnicodeSPrint(DirName, sizeof(DirName), L"%s_recovery", UniShortOSVersion); // UnicodeSPrint(DirName, sizeof(DirName), L"%s_recovery", UniShortOSVersion);
} else { } else {
DirName = PoolPrint(L"%s_normal", UniShortOSVersion); DirName = PoolPrint(L"%s_normal", UniShortOSVersion);
// UnicodeSPrint(DirName, sizeof(DirName), L"%s_normal", UniShortOSVersion); // UnicodeSPrint(DirName, sizeof(DirName), L"%s_normal", UniShortOSVersion);
} }
}
DirPath = PoolPrint(L"%s\\kexts\\%s", OEMPath, DirName); DirPath = PoolPrint(L"%s\\kexts\\%s", OEMPath, DirName);
// UnicodeSPrint(DirPath, sizeof(DirPath), L"%s\\kexts\\%s", OEMPath, DirName); // UnicodeSPrint(DirPath, sizeof(DirPath), L"%s\\kexts\\%s", OEMPath, DirName);
AddKexts(Entry, DirPath, DirName, archCpuType); AddKexts(Entry, DirPath, DirName, archCpuType);
FreePool(DirPath); FreePool(DirPath);
FreePool(DirName); FreePool(DirName);
// Add kext from : // Add kext from :
// 10.{version}.0 if NO minor version // 10.{version}.0 if NO minor version
// 10.{version}.{minor version} if minor version is > 0 // 10.{version}.{minor version} if minor version is > 0
if ( AsciiStrCmp(ShortOSVersion, Entry->OSVersion) == 0 ) { if ( AsciiStrCmp(ShortOSVersion, Entry->OSVersion) == 0 ) {
OSVersionKextsDirName = PoolPrint(L"%a.0", Entry->OSVersion); OSVersionKextsDirName = PoolPrint(L"%a.0", Entry->OSVersion);
// UnicodeSPrint(OSVersionKextsDirName, sizeof(OSVersionKextsDirName), L"%a.0", Entry->OSVersion); // UnicodeSPrint(OSVersionKextsDirName, sizeof(OSVersionKextsDirName), L"%a.0", Entry->OSVersion);
} else { } else {
OSVersionKextsDirName = PoolPrint(L"%a.0", Entry->OSVersion); OSVersionKextsDirName = PoolPrint(L"%a", Entry->OSVersion);
// UnicodeSPrint(OSVersionKextsDirName, sizeof(OSVersionKextsDirName), L"%a", Entry->OSVersion); // UnicodeSPrint(OSVersionKextsDirName, sizeof(OSVersionKextsDirName), L"%a", Entry->OSVersion);
} }
@ -523,25 +517,23 @@ EFI_STATUS LoadKexts(IN LOADER_ENTRY *Entry)
// UnicodeSPrint(DirPath, sizeof(DirPath), L"%s\\kexts\\%s", OEMPath, OSVersionKextsDirName); // UnicodeSPrint(DirPath, sizeof(DirPath), L"%s\\kexts\\%s", OEMPath, OSVersionKextsDirName);
AddKexts(Entry, DirPath, OSVersionKextsDirName, archCpuType); AddKexts(Entry, DirPath, OSVersionKextsDirName, archCpuType);
FreePool(DirPath); FreePool(DirPath);
FreePool(OSVersionKextsDirName);
if ( OSTYPE_IS_OSX_INSTALLER(Entry->LoaderType)) { if ( OSTYPE_IS_OSX_INSTALLER(Entry->LoaderType)) {
DirName = PoolPrint(L"%s_install", OSVersionKextsDirName); DirName = PoolPrint(L"%s_install", OSVersionKextsDirName);
// UnicodeSPrint(DirName, sizeof(DirName), L"%s_install", OSVersionKextsDirName); // UnicodeSPrint(DirName, sizeof(DirName), L"%s_install", OSVersionKextsDirName);
}else{ } else if (OSTYPE_IS_OSX_RECOVERY(Entry->LoaderType)) {
if (OSTYPE_IS_OSX_RECOVERY(Entry->LoaderType)) {
DirName = PoolPrint(L"%s_recovery", OSVersionKextsDirName); DirName = PoolPrint(L"%s_recovery", OSVersionKextsDirName);
// UnicodeSPrint(DirName, sizeof(DirName), L"%s_recovery", OSVersionKextsDirName); // UnicodeSPrint(DirName, sizeof(DirName), L"%s_recovery", OSVersionKextsDirName);
} else { } else {
DirName = PoolPrint(L"%s_normal", OSVersionKextsDirName); DirName = PoolPrint(L"%s_normal", OSVersionKextsDirName);
// UnicodeSPrint(DirName, sizeof(DirName), L"%s_normal", OSVersionKextsDirName); // UnicodeSPrint(DirName, sizeof(DirName), L"%s_normal", OSVersionKextsDirName);
} }
}
DirPath = PoolPrint(L"%s\\kexts\\%s", OEMPath, DirName); DirPath = PoolPrint(L"%s\\kexts\\%s", OEMPath, DirName);
// UnicodeSPrint(DirPath, sizeof(DirPath), L"%s\\kexts\\%s", OEMPath, DirName); // UnicodeSPrint(DirPath, sizeof(DirPath), L"%s\\kexts\\%s", OEMPath, DirName);
AddKexts(Entry, DirPath, DirName, archCpuType); AddKexts(Entry, DirPath, DirName, archCpuType);
FreePool(DirPath); FreePool(DirPath);
FreePool(DirName); FreePool(DirName);
FreePool(OSVersionKextsDirName);
} }