// create log directory if not found if (!is_dir("{$logsPath}")) { system_call("mkdir {$logsPath}"); } if (!is_dir("{$fixLogPath}")) { system_call("mkdir {$fixLogPath}"); } echo "<div class='pageitem_bottom'\">"; echo "<ul class='pageitem'>"; $fixToSLE = $_POST['fixToSLE']; switch ($row[foldername]) { case "AppleIntelCPUPowerManagement": if ($fixToSLE == "on") { patchAppleIntelCPUPowerManagement("{$fixLogPath}/fix.log", "SLE", "yes"); } else { patchAppleIntelCPUPowerManagement("{$fixLogPath}/fix.log", "EE", "yes"); } break; case "BCM4352WiFiPatches": if ($fixToSLE == "on") { patchWiFiBTBCM4352("{$fixLogPath}/fix.log", "SLE", "yes"); } 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"); }
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 = ""; }