} else { patchWiFiBTBCM4352("{$fixLogPath}/fix.log", "EE", "yes"); } break; case "AR9285AR9287WiFiPatch": if ($fixToSLE == "on") { patchWiFiAR9285AndAR9287("{$fixLogPath}/fix.log", "SLE", "yes"); } else { patchWiFiAR9285AndAR9287("{$fixLogPath}/fix.log", "EE", "yes"); } break; case "VGA_HDMI_Intel_HD3000_Patch": if ($fixToSLE == "on") { patchAppleIntelSNBGraphicsFB("{$fixLogPath}/fix.log", "SLE", "yes"); } else { patchAppleIntelSNBGraphicsFB("{$fixLogPath}/fix.log", "EE", "yes"); } break; } if (is_file("{$fixLogPath}/patchSuccess.txt")) { echo "<img src=\"icons/big/success.png\" style=\"width:80px;height:80px;position:relative;left:49%;top:50%;margin:15px 0 0 -35px;\">"; echo "<b><center> Patch finished.</b><br><br><b> You can now reboot the sysem to see the patch in action.</center></b>"; echo "<br></ul>"; } else { echo "<img src=\"icons/big/fail.png\" style=\"width:80px;height:80px;position:relative;left:49%;top:50%;margin:15px 0 0 -35px;\">"; echo "<b><center> Patch failed.</b><br><br><b> Check the log for the reason.</center></b>"; echo "<br></ul>"; echo "<b>Log:</b>\n"; echo "<pre>"; if (is_file("{$fixLogPath}/fix.log")) { include "{$fixLogPath}/fix.log";
function applyFixes() { //Get vars from config.inc.php global $workPath, $rootPath, $slePath, $modelNamePath, $os, $eePath; global $sysType, $modeldb, $modelRowID, $modelID; global $edpDBase; global $cpufixdb; // model path $modelDirPath = "{$workPath}/model-data/{$modelNamePath}"; //Get our class(s) global $svnLoad; //kextpack svn path $svnpackPath = "{$workPath}/svnpacks"; writeToLog("{$workPath}/logs/build/build.log", " Applying fixes and patches...... <br>"); // // Apply power management related fixes // $mdata = $edpDBase->getModelDataFromID($sysType, $modelID); $array = explode(',', $mdata['pmfixes']); $i = 0; // iterating through all the id's while ($cpufixdb[$i] != "") { // Get foldername from ID $cpufixdata = $edpDBase->getKextpackDataFromID("pmfixes", "{$i}"); $foldername = $cpufixdata[foldername]; $name = $cpufixdata[edpid]; // Checking if we need to patch AppleIntelCPUPowerManagement.kext if ($modeldb[$modelRowID]['applecpupwr'] == "on" && $i == "1") { patchAppleIntelCPUPowerManagement("{$workPath}/logs/build/build.log", "EE", "no"); } else { if ($modeldb[$modelRowID]['emupstates'] == "on" && $i == "3") { $svnLoad->PrepareKextpackDownload("PowerMgmt", "VoodooPState", "{$foldername}"); } else { if ($foldername != "" && $modeldb[$modelRowID][$cpufixdata[edpid]] == "on") { if (!is_dir("{$svnpackPath}/PowerMgmt")) { system_call("mkdir {$svnpackPath}/PowerMgmt"); } $svnLoad->PrepareKextpackDownload("PowerMgmt", "{$foldername}", "{$foldername}"); //remove PStateMenu if installed before if (file_exists("/Library/LaunchAgents/PStateMenu.plist")) { system_call("rm -rf /Library/LaunchAgents/PStateMenu.plist"); } } } } $i++; } // Reset vars $name = ""; $fname = ""; // // Apply Generic fixes // $data = $modeldb[$modelRowID]['fixes']; $array = explode(',', $data); foreach ($array as $id) { //Getting names from ID $fixdata = $edpDBase->getKextpackDataFromID("sysfixes", "{$id}"); $categ = $fixdata[category]; $fname = $fixdata[foldername]; $name = $fixdata[name]; if ($id == "2") { patchAHCI(); } else { if ($id == "8") { patchAppleIntelSNBGraphicsFB("{$workPath}/logs/build/build.log", "EE", "no"); } else { if ($fname != "") { if ($id == "1") { writeToLog("{$workPath}/logs/build/build.log", " Applying ACPI fix for Battery read and Coolbook...<br>"); } else { if ($id == "5") { writeToLog("{$workPath}/logs/build/build.log", " Preparing to download patched IOATAFamily fix for IDE disks...<br>"); } else { if ($id == "9") { writeToLog("{$workPath}/logs/build/build.log", " Preparing to download {$name} fix for Apple store access...<br>"); } else { writeToLog("{$workPath}/logs/build/build.log", " Preparing to download {$name} fix...<br>"); } } } if (!is_dir("{$svnpackPath}/{$categ}")) { system_call("mkdir {$svnpackPath}/{$categ}"); } $svnLoad->PrepareKextpackDownload("{$categ}", "{$fname}", "{$name}"); } } } } // Reset vars $name = ""; $fname = ""; }