Skip to content

Commit

Permalink
add CpuTscSync, AirportBrcmFixup, and BrcmPatchRAM to the kext update…
Browse files Browse the repository at this point in the history
… list
  • Loading branch information
dropdb220 committed Nov 7, 2021
1 parent d9c200f commit 0b3cb30
Show file tree
Hide file tree
Showing 3 changed files with 201 additions and 93 deletions.
54 changes: 37 additions & 17 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,19 @@ OpenCore Updater doesn't update all kexts, but it will update the ones that are
* IntelBluetoothFirmware
* IntelBluetoothInjector
* NVMeFix
* CpuTscSync
* AirportBrcmFixup
* BrcmPatchRAM kexts
* BlueToolFixup
* BrcmBluetoothInjector
* BrcmBluetoothInjectorLegacy
* BrcmFirmwareData
* BrcmFirmwareRepo
* BrcmNonPatchRAM
* BrcmNonPatchRAM2
* BrcmPatchRAM
* BrcmPatchRAM2
* BrcmPatchRAM3

all other kexts (including USBInjectAll, XHCI-Unsupported, VoodooRMI, etc.) will not be updated. However, there might be a newer version of those kexts. If this is the case, you should update them manually.

Expand All @@ -91,29 +104,36 @@ However, when updating, Bootstrap.efi will be removed, but the boot entry will n
If you want to update to 0.6.6, you need to manually remove the boot entry. You can do this by following the steps below:

1. Open /EFI/OC/config.plist
2. Set Misc - Security - BootProtect to None
3. Set Misc - Security - AllowNvramReset to True
4. Reboot and from the OpenCore boot picker, select `Reset NVRAM`
5. When your computer reboots, enter BIOS settings and confirm that `UEFI OS` (which is the BOOTx64.efi of OpenCore) is at the top of the boot menu. If it's not, you need to move the boot entry to the top of the boot menu.
6. Save and reboot to macOS.
7. Run OpenCore Updater again.
8. Now, the warning will not appear.
1. Set Misc - Security - BootProtect to None
1. Set Misc - Security - AllowNvramReset to True
1. Reboot and from the OpenCore boot picker, select `Reset NVRAM`
1. When your computer reboots, enter BIOS settings and confirm that `UEFI OS` (which is the BOOTx64.efi of OpenCore) is at the top of the boot menu. If it's not, you need to move the boot entry to the top of the boot menu.
1. Save and reboot to macOS.
1. Run OpenCore Updater again.
1. Now, the warning will not appear.

## How to build

1. Install [Node.js](https://nodejs.org/en/download/). Version 16 (Currently LTS) is recommended.
### After updating, OpenCore Configurator cannot read config.plist

2. Clone or download the source code.
This is not a bug of OpenCore Updater. It's a bug of OpenCore Configurator. It occurs because:

3. Open the terminal and type: `npm i -g yarn` to install yarn.
1. When updating, OpenCore Updater reads config.plist, parse it as JavaScript object, make necessary changes, build it as plist again, and write it back to config.plist.
1. OpenCore Updater uses [plist](https://npmjs.com/package/plist) NPM module to read and write config.plist.
1. The plist module writes empty data as `<data/>` and empty string as `<string/>`.
1. However, due to a bug in OpenCore Configurator, it thinks that `<data/>` and `<data></data>` are different. They are actually the same.
1. Therefore, OpenCore Configurator cannot read config.plist.

4. Type `yarn` to install the dependencies.
However, since many people are using OpenCore Configurator, I will fix this bug soon.

5. To open the app for development, type `yarn start`.
## How to build

6. Type `yarn build` to build the app. You need a Mac or Hackintosh to build the app.
1. Install [Node.js](https://nodejs.org/en/download/). Version 16 (Currently LTS) is recommended.

7. You can find the DMG file in the `out` directory. This app can run on both Intel Mac (Including Hackintosh) and Apple Silicon Mac.
1. Clone or download the source code.
1. Open the terminal and type: `npm i -g yarn` to install yarn.
1. Type `yarn` to install the dependencies.
1. To open the app for development, type `yarn start`.
1. Type `yarn build` to build the app. You need a Mac or Hackintosh to build the app.
1. You can find the DMG file in the `out` directory. This app can run on both Intel Mac (Including Hackintosh) and Apple Silicon Mac.

## Credits

Expand Down Expand Up @@ -143,7 +163,7 @@ And many people who contributed to the project.

Copyright (c) 2021 mswgen. All rights reserved.

Licensed under the [MIT license](./LICENSE). Please see the LICENSE file for more information.
Licensed under the MIT license. Please see the [LICENSE](./LICENSE) file for more information.

OpenCore and the OpenCore logo are trademarks of Acidanthera.

Expand Down
76 changes: 76 additions & 0 deletions src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -144,6 +144,29 @@ electron.ipcMain.on('download-kexts', (evt, kexts) => {
if (kexts.includes('IntelBluetoothFirmware.kext')) {
cp.execSync(`cd ~; mkdir -p .oc-update/${PID}; cd .oc-update/${PID}; curl -L -s -o IntelBluetoothFirmware-2.0.1.zip https://github.com/OpenIntelWireless/IntelBluetoothFirmware/releases/download/v2.0.1/IntelBluetoothFirmware-v2.0.1.zip; mkdir IntelBluetoothFirmware-2.0.1; cd IntelBluetoothFirmware-2.0.1; unzip ../IntelBluetoothFirmware-2.0.1.zip`);
}
if (kexts.includes('CpuTscSync.kext')) {
cp.execSync(`cd ~; mkdir -p .oc-update/${PID}; cd .oc-update/${PID}; curl -L -s -o CpuTscSync-1.0.5-RELEASE.zip https://github.com/acidanthera/CpuTscSync/releases/download/1.0.5/CpuTscSync-1.0.5-RELEASE.zip; mkdir CpuTscSync-1.0.5-RELEASE; cd CpuTscSync-1.0.5-RELEASE; unzip ../CpuTscSync-1.0.5-RELEASE.zip`);
}
if (kexts.includes('AirportBrcmFixup.kext')) {
cp.execSync(`cd ~; mkdir -p .oc-update/${PID}; cd .oc-update/${PID}; curl -L -s -o AirportBrcmFixup-2.1.3-RELEASE.zip https://github.com/acidanthera/AirportBrcmFixup/releases/download/2.1.3/AirportBrcmFixup-2.1.3-RELEASE.zip; mkdir AirportBrcmFixup-2.1.3-RELEASE; cd AirportBrcmFixup-2.1.3-RELEASE; unzip ../AirportBrcmFixup-2.1.3-RELEASE.zip`);
}
/*
if kexts include one of these - check all of them together
BlueToolFixup.kext
BrcmBluetoothInjector.kext
BrcmBluetoothInjectorLegacy.kext
BrcmFirmwareData.kext
BrcmFirmwareRepo.kext
BrcmNonPatchRAM.kext
BrcmNonPatchRAM2.kext
BrcmPatchRAM.kext
BrcmPatchRAM2.kext
BrcmPatchRAM3.kext
*/
if (kexts.includes('BlueToolFixup.kext') || kexts.includes('BrcmBluetoothInjector.kext') || kexts.includes('BrcmBluetoothInjectorLegacy.kext') || kexts.includes('BrcmFirmwareData.kext') || kexts.includes('BrcmFirmwareRepo.kext') || kexts.includes('BrcmNonPatchRAM.kext') || kexts.includes('BrcmNonPatchRAM2.kext') || kexts.includes('BrcmPatchRAM.kext') || kexts.includes('BrcmPatchRAM2.kext') || kexts.includes('BrcmPatchRAM3.kext')) {
cp.execSync(`cd ~; mkdir -p .oc-update/${PID}; cd .oc-update/${PID}; curl -L -s -o BrcmPatchRAM-2.6.1-RELEASE.zip https://github.com/acidanthera/BrcmPatchRAM/releases/download/2.6.1/BrcmPatchRAM-2.6.1-RELEASE.zip; mkdir BrcmPatchRAM-2.6.1-RELEASE; cd BrcmPatchRAM-2.6.1-RELEASE; unzip ../BrcmPatchRAM-2.6.1-RELEASE.zip`);
}
evt.returnValue = 'success';
});
electron.ipcMain.on('download-bindata', evt => {
Expand Down Expand Up @@ -254,6 +277,59 @@ electron.ipcMain.on('swap-files', (evt, dir, kexts) => {
if (kexts.includes('IntelBluetoothInjector.kext')) {
cp.execSync(`cp -r "${os.homedir()}/.oc-update/${PID}/IntelBluetoothFirmware-2.0.1/IntelBluetoothFirmware-v2.0.1/IntelBluetoothInjector.kext" "${dir}/OC/Kexts"`);
}
// CpuTscSync.kext -> replace with CpuTscSync-1.0.5-RELEASE/CpuTscSync.kext
if (kexts.includes('CpuTscSync.kext')) {
cp.execSync(`cp -r "${os.homedir()}/.oc-update/${PID}/CpuTscSync-1.0.5-RELEASE/CpuTscSync.kext" "${dir}/OC/Kexts"`);
}
// AirportBrcmFixup.kext -> replace with AirportBrcmFixup-2.3.1-RELEASE/AirportBrcmFixup.kext
if (kexts.includes('AirportBrcmFixup.kext')) {
cp.execSync(`cp -r "${os.homedir()}/.oc-update/${PID}/AirportBrcmFixup-2.3.1-RELEASE/AirportBrcmFixup.kext" "${dir}/OC/Kexts"`);
}
/*
if one of these kexts are installed: replace it with the appropriate kext in BrcmPatchRAM-2.6.1-RELEASE
these kexts include:
BlueToolFixup.kext
BrcmBluetoothInjector.kext
BrcmBluetoothInjectorLegacy.kext
BrcmFirmwareData.kext
BrcmFirmwareRepo.kext
BrcmNonPatchRAM.kext
BrcmNonPatchRAM2.kext
BrcmPatchRAM.kext
BrcmPatchRAM2.kext
BrcmPatchRAM3.kext
*/
if (kexts.includes('BlueToolFixup.kext')) {
cp.execSync(`cp -r "${os.homedir()}/.oc-update/${PID}/BrcmPatchRAM-2.6.1-RELEASE/BlueToolFixup.kext" "${dir}/OC/Kexts"`);
}
if (kexts.includes('BrcmBluetoothInjector.kext')) {
cp.execSync(`cp -r "${os.homedir()}/.oc-update/${PID}/BrcmPatchRAM-2.6.1-RELEASE/BrcmBluetoothInjector.kext" "${dir}/OC/Kexts"`);
}
if (kexts.includes('BrcmBluetoothInjectorLegacy.kext')) {
cp.execSync(`cp -r "${os.homedir()}/.oc-update/${PID}/BrcmPatchRAM-2.6.1-RELEASE/BrcmBluetoothInjectorLegacy.kext" "${dir}/OC/Kexts"`);
}
if (kexts.includes('BrcmFirmwareData.kext')) {
cp.execSync(`cp -r "${os.homedir()}/.oc-update/${PID}/BrcmPatchRAM-2.6.1-RELEASE/BrcmFirmwareData.kext" "${dir}/OC/Kexts"`);
}
if (kexts.includes('BrcmFirmwareRepo.kext')) {
cp.execSync(`cp -r "${os.homedir()}/.oc-update/${PID}/BrcmPatchRAM-2.6.1-RELEASE/BrcmFirmwareRepo.kext" "${dir}/OC/Kexts"`);
}
if (kexts.includes('BrcmNonPatchRAM.kext')) {
cp.execSync(`cp -r "${os.homedir()}/.oc-update/${PID}/BrcmPatchRAM-2.6.1-RELEASE/BrcmNonPatchRAM.kext" "${dir}/OC/Kexts"`);
}
if (kexts.includes('BrcmNonPatchRAM2.kext')) {
cp.execSync(`cp -r "${os.homedir()}/.oc-update/${PID}/BrcmPatchRAM-2.6.1-RELEASE/BrcmNonPatchRAM2.kext" "${dir}/OC/Kexts"`);
}
if (kexts.includes('BrcmPatchRAM.kext')) {
cp.execSync(`cp -r "${os.homedir()}/.oc-update/${PID}/BrcmPatchRAM-2.6.1-RELEASE/BrcmPatchRAM.kext" "${dir}/OC/Kexts"`);
}
if (kexts.includes('BrcmPatchRAM2.kext')) {
cp.execSync(`cp -r "${os.homedir()}/.oc-update/${PID}/BrcmPatchRAM-2.6.1-RELEASE/BrcmPatchRAM2.kext" "${dir}/OC/Kexts"`);
}
if (kexts.includes('BrcmPatchRAM3.kext')) {
cp.execSync(`cp -r "${os.homedir()}/.oc-update/${PID}/BrcmPatchRAM-2.6.1-RELEASE/BrcmPatchRAM3.kext" "${dir}/OC/Kexts"`);
}
evt.returnValue = 'success'
});
electron.ipcMain.on('update-config-plist', (evt, efidir, ocver) => {
Expand Down
164 changes: 88 additions & 76 deletions src/renderer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,18 +5,18 @@ async function sleep(ms: number) {
}
function afterOcverSelection(ocver: string, efidir: string) {
const kexts = ipc.sendSync('kextinfo', `${efidir}/OC/Kexts`);
document.querySelector<HTMLElement>('#get-started')!.style.display = 'none';
document.querySelector<HTMLElement>('#efiinfo')!.style.display = 'block';
const ocverNum = Number(ocver.split('.').join(''));
document.querySelector('#oc-version')!.innerHTML = ocver;
document.querySelector('#using-kexts')!.innerHTML = kexts.join('<br>');
if (ocverNum < 75) {
document.querySelector('#is-outdated')!.innerHTML = 'Your OpenCore is outdated.';
document.querySelector<HTMLElement>('#update')!.style.display = 'block';
document.querySelector('#update')?.addEventListener('click', async () => {
if (ocverNum < 66) {
if (ipc.sendSync('check-bootstrap', efidir)) {
if (!confirm (`Warning: Bootstrap.efi detected
document.querySelector<HTMLElement>('#get-started')!.style.display = 'none';
document.querySelector<HTMLElement>('#efiinfo')!.style.display = 'block';
const ocverNum = Number(ocver.split('.').join(''));
document.querySelector('#oc-version')!.innerHTML = ocver;
document.querySelector('#using-kexts')!.innerHTML = kexts.join('<br>');
if (ocverNum < 75) {
document.querySelector('#is-outdated')!.innerHTML = 'Your OpenCore is outdated.';
document.querySelector<HTMLElement>('#update')!.style.display = 'block';
document.querySelector('#update')?.addEventListener('click', async () => {
if (ocverNum < 66) {
if (ipc.sendSync('check-bootstrap', efidir)) {
if (!confirm(`Warning: Bootstrap.efi detected
You're using Bootstrap.efi. Bootstrap.efi was replaced by LauncherOption from 0.6.6.
To update, Bootstrap.efi must be disabled and NVRAM should be reset.
To do this, open config.plist and
Expand All @@ -26,71 +26,83 @@ To do this, open config.plist and
4. reboot to macOS and run this app again
If you already did this, you may proceed, otherwise, you must quit this app, do the steps above, and re-run this app.
Do you want to contnue?`)) ipc.send('quit');
}
}
document.querySelector<HTMLElement>('#efiinfo')!.style.display = 'none';
document.querySelector<HTMLElement>('#update-in-progress')!.style.display = 'block';
await sleep(1000);
ipc.sendSync('download-oc');
document.querySelector('#progress')!.innerHTML = '2/7. Downloading kexts...'
await sleep(1000);
ipc.sendSync('download-kexts', kexts);
document.querySelector('#progress')!.innerHTML = '3/7. Downloading binary data...'
await sleep(1000);
ipc.sendSync('download-bindata');
document.querySelector('#progress')!.innerHTML = '4/7. Creating backup...'
await sleep(1000);
ipc.sendSync('create-backup', efidir);
document.querySelector('#progress')!.innerHTML = '5/7. Swapping files...'
await sleep(1000);
ipc.sendSync('swap-files', efidir, kexts);
document.querySelector('#progress')!.innerHTML = '6/7. Updating config.plist...'
await sleep(1000);
const vaultResult = ipc.sendSync('update-config-plist', efidir, ocverNum);
document.querySelector('#progress')!.innerHTML = '7/7. Cleaning up...'
await sleep(1000);
const backupLoc = ipc.sendSync('finish', efidir, ocverNum);
const kextsNotUpdated = kexts.filter((x: string) => !([
'VirtualSMC.kext',
'SMCProcessor.kext',
'SMCSuperIO.kext',
'SMCBatteryManager.kext',
'SMCLightSensor.kext',
'SMCDellSensors.kext',
'Lilu.kext',
'WhateverGreen.kext',
'AppleALC.kext',
'AppleALCU.kext',
'VoodooPS2Controller.kext',
'VoodooI2C.kext',
'VoodooI2CHID.kext',
'VoodooI2CSynaptics.kext',
'VoodooI2CELAN.kext',
'VoodooI2CFTE.kext',
'VoodooI2CAtmelMXT.kext',
'ECEnabler.kext',
'BrightnessKeys.kext',
'IntelMausi.kext',
'RealtekRTL8111.kext',
'itlwm.kext',
'AirportItlwm.kext',
'IntelBluetoothFirmware.kext',
'IntelBluetoothInjector.kext',
'NVMeFix.kext'
].includes(x)))
if (kextsNotUpdated.length > 0) {
document.querySelector('#kexts-not-updated')!.innerHTML = kextsNotUpdated.join('<br>');
} else {
document.querySelector<HTMLElement>('#kexts-not-updated-exists')!.style.display = 'none';
}
document.querySelector('#backup-location')!.innerHTML = backupLoc;
if (vaultResult == 'vault-disabled') {
document.querySelector<HTMLElement>('#vault-removed')!.style.display = 'block';
}
document.querySelector<HTMLElement>('#update-in-progress')!.style.display = 'none';
document.querySelector<HTMLElement>('#success')!.style.display = 'block';
});
}
}
document.querySelector<HTMLElement>('#efiinfo')!.style.display = 'none';
document.querySelector<HTMLElement>('#update-in-progress')!.style.display = 'block';
await sleep(1000);
ipc.sendSync('download-oc');
document.querySelector('#progress')!.innerHTML = '2/7. Downloading kexts...'
await sleep(1000);
ipc.sendSync('download-kexts', kexts);
document.querySelector('#progress')!.innerHTML = '3/7. Downloading binary data...'
await sleep(1000);
ipc.sendSync('download-bindata');
document.querySelector('#progress')!.innerHTML = '4/7. Creating backup...'
await sleep(1000);
ipc.sendSync('create-backup', efidir);
document.querySelector('#progress')!.innerHTML = '5/7. Swapping files...'
await sleep(1000);
ipc.sendSync('swap-files', efidir, kexts);
document.querySelector('#progress')!.innerHTML = '6/7. Updating config.plist...'
await sleep(1000);
const vaultResult = ipc.sendSync('update-config-plist', efidir, ocverNum);
document.querySelector('#progress')!.innerHTML = '7/7. Cleaning up...'
await sleep(1000);
const backupLoc = ipc.sendSync('finish', efidir, ocverNum);
const kextsNotUpdated = kexts.filter((x: string) => !([
'VirtualSMC.kext',
'SMCProcessor.kext',
'SMCSuperIO.kext',
'SMCBatteryManager.kext',
'SMCLightSensor.kext',
'SMCDellSensors.kext',
'Lilu.kext',
'WhateverGreen.kext',
'AppleALC.kext',
'AppleALCU.kext',
'VoodooPS2Controller.kext',
'VoodooI2C.kext',
'VoodooI2CHID.kext',
'VoodooI2CSynaptics.kext',
'VoodooI2CELAN.kext',
'VoodooI2CFTE.kext',
'VoodooI2CAtmelMXT.kext',
'ECEnabler.kext',
'BrightnessKeys.kext',
'IntelMausi.kext',
'RealtekRTL8111.kext',
'itlwm.kext',
'AirportItlwm.kext',
'IntelBluetoothFirmware.kext',
'IntelBluetoothInjector.kext',
'NVMeFix.kext',
'CpuTscSync.kext',
'AirportBrcmFixup.kext',
'BlueToolFixup.kext',
'BrcmBluetoothInjector.kext',
'BrcmBluetoothInjectorLegacy.kext',
'BrcmFirmwareData.kext',
'BrcmFirmwareRepo.kext',
'BrcmNonPatchRAM.kext',
'BrcmNonPatchRAM2.kext',
'BrcmPatchRAM.kext',
'BrcmPatchRAM2.kext',
'BrcmPatchRAM3.kext'
].includes(x)))
if (kextsNotUpdated.length > 0) {
document.querySelector('#kexts-not-updated')!.innerHTML = kextsNotUpdated.join('<br>');
} else {
document.querySelector<HTMLElement>('#kexts-not-updated-exists')!.style.display = 'none';
}
document.querySelector('#backup-location')!.innerHTML = backupLoc;
if (vaultResult == 'vault-disabled') {
document.querySelector<HTMLElement>('#vault-removed')!.style.display = 'block';
}
document.querySelector<HTMLElement>('#update-in-progress')!.style.display = 'none';
document.querySelector<HTMLElement>('#success')!.style.display = 'block';
});
}
}
window.addEventListener('load', async () => {
ipc = (window as any).electron.ipcRenderer;
Expand Down

0 comments on commit 0b3cb30

Please sign in to comment.