This is how I setup my environment in order to work with hackintoshes.
- environment directory structure
iasl
MaciASL
acidanthera/WhateverGreen
Hardening
corpnewt/GenSMBIOS
andyvand/FixEDID
smut.c
michalmalik/osx-re-101
xzhih/one-key-hidpi
syscl/Enable-HiDPI-OSX
Benjamin-Dobell/nvidia-update.sh
vulgo/webdriver.sh
syscl/CPUTune
avibrazil/RDM
gfxutl
Hackintool
ProperTree
DarwinDumper
macserial
ACPIDebug.kext
- Clover laptop config.plist and hotpatch
- DSDT patches for HP ProBook/EliteBook/ZBook series laptops
- RehabMan's laptop patch repository
- black-dragon74/OSX-Debug.git
gen_debug.sh
ekalinin/github-markdown-toc
- RehabMan-MaciASL-2018-0507.zip
- RehabMan-patchmatic-2018-0507.zip
mount_efi.sh
MountEFI
hack_tools
- IOJones
- IORegistryExplorer.app v2.1
- where to install kexts
LiluFriend
- where to install kexts January 2019
- create DSL of stock tables
- compile DSL
- string conversion
- LSPCI using WMI (WMIC)
- clover unhide all volumes with F3
- AppleHDA/AppleALC patching
- Debugging
- references
define a HACK
environment variable for all your hackintosh work. Add $HACK/bin
for all the hack binaries.
binaries
$HACK/bin
compiled versions of tools including MaciASL, IOJones, IORegistryExplorer etc$HACK/git
git repositories used
October 2020
follow this and get iasl from acidanthera/MaciASL
cd $HACK/bin
rm acpi*
rm iasl
cp /Bit/macos/bin/MaciASL.app/Contents/MacOS/iasl-stable $HACK/bin/iasl
legacy
goto RehabMan/Intel-iasl and
mkdir -p $HACK/git/Rehabman.git
cd $HACK/git/Rehabman.git
git clone https://github.com/RehabMan/Intel-iasl.git iasl.git
cd iasl.git
make
cd $HACK
mkdir bin && cd bin
cp $HACK/git/Rehabman.git/iasl.git/generate/unix/bin/* $HACK/bin
October 2020
follow this and get MaciASL from acidanthera/MaciASL
mv MaciASL.app $HACK/bin
legacy
check RehabMan/OS-X-MaciASL-patchmatic
and download RehabMan-MaciASL-2018-0507.zip, RehabMan-patchmatic-2018-0507.zip
now get it from acidanthera /MaciASL
mv MaciASL.app $HACK/bin
cd $HACK/git
git clone https://github.com/acidanthera/WhateverGreen.git WhateverGreen.git
check this
cd $HACK/git
git clone https://github.com/kristovatlas/osx-config-check osx-config-check.git
git clone https://github.com/drduh/macOS-Security-and-Privacy-Guide.git macOS-Security-and-Privacy-Guide.git
cd $HACK/git
git clone https://github.com/corpnewt/GenSMBIOS GenSMBIOS.git
cd GenSMBIOS.git
cp GenSMBIOS.command $HACK/bin/GenSMBIOS
chmod +x $HACK/bin/GenSMBIOS
cd $HACK/git
git clone https://github.com/andyvand/FixEDID.git FixEDID.git
cd $HACK/git
mkdir smut.git && cd smut.git
# copy from 'http://newosxbook.com/src.jl?tree=listings&file=smut.c'
wget http://newosxbook.com/code/listings/SMBIOS.h
gcc smut.c -o bios -framework IOKit -framework CoreFoundation
cd $HACK/git
git clone https://github.com/michalmalik/osx-re-101.git osx-re-101.git
This script can simulate macOS HiDPI on a non-retina display, and have a "Native" Scaled in System Preferences. Home page is here
cd $HACK/git
git clone https://github.com/xzhih/one-key-hidpi.git one-key-hidpi.git
Hola, this is an ongoing project targets at enable the support of HiDPI for display with a high resolution under macOS.
cd $HACK/git
git clone https://github.com/syscl/Enable-HiDPI-OSX.git Enable-HiDPI-OSX.git
cd $HACK/git
git clone https://github.com/Benjamin-Dobell/nvidia-update.git nvidia-update.git
cd nvidia-update.git
cp nvidia-update.sh $HACK/bin
cd $HACK/git
git clone https://github.com/vulgo/webdriver.sh.git webdriver.sh.git
cd webdriver.sh.git
cp webdriver $HACK/bin
An open source kernel extension enables dynamic CPU performance tuning at runtime for macOS.
cd $HACK/git
git clone https://github.com/syscl/CPUTune.git CPUTune.git
cd $HACK/git
git clone https://github.com/avibrazil/RDM.git RDM.git
cd RDM.git
make
mv RDM.app $HACK/bin
Download 1.77b.RELEASE.zip
unzip 1.77b.RELEASE.zip
mv gfxutil $HACK/bin
$HACK/bin/gfxutil -f IGPU
$HACK/bin/gfxutil -f HDEF
check code @ headkaze/Hackintool
cp /Downloads
wget https://github.com/headkaze/Hackintool/releases/download/3.4.7/Hackintool.zip
unzip Hackintool.zip
\rm -rf \$HACK/bin/Hackintool.app/
mv Hackintool.app $HACK/bin
open $HACK/bin/Hackintool.app
check code @ corpnewt/ProperTree
Download Hackintool
cd $HACK/git
git clone https://github.com/corpnewt/ProperTree.git ProperTree.git
function proper()
{
$HACK/git/ProperTree.git/ProperTree.command $1
}
Download DarwinDumper_v3.0.4.zip
Chrome consider this a malware, so I passed on it
Download macserial-2.0.4-mac.zip
unzip macserial-2.0.4-mac.zip
mv macserial $HACK/bin
$HACK/bin/macserial
A kernel extension and DSDT patches to enable debug tracing from ACPI code (DSDT) to system.log
you can see what is going on here and download it RehabMan-Debug-2015-1230.zip
mv /Downloads/RehabMan-Debug-2015-1230.zip $HACK/sources/kexts
cd $HACK/git/Rehabman.git
git clone https://github.com/RehabMan/OS-X-Clover-Laptop-Config.git OS-X-Clover-Laptop-Config.git
This project contains config.plist files for common laptops with Intel graphics. (from README.md)
cd $HACK/git/Rehabman.git
git clone https://github.com/RehabMan/HP-ProBook-4x30s-DSDT-Patch.git HP-ProBook-4x30s-DSDT-Patch.git
This set of patches/makefile can be used to patch your HP ProBook/EliteBook/ZBook DSDTs. There are also post install scripts that can be used to create and install the kexts the are required for this laptop series. (from README.md)
cd $HACK/git/Rehabman.git
git clone https://github.com/RehabMan/Laptop-DSDT-Patch.git Laptop-DSDT-Patch.git
This set of patches can be used in DSDT Editor or (preferably) MaciASL to apply some common patches to your laptop for running OS X. These patches are common for Sandy Bridge or Ivy Bridge laptops. (from README.md)
gh-md-toc — is for you if you want to generate TOC for README.md or GitHub's wiki page and don't want to install any additional software.
cd $HACK/bin
curl https://raw.githubusercontent.com/ekalinin/github-markdown-toc/master/gh-md-toc -o gh-md-toc
chmod a+x gh-md-toc
$HACK/bin/gh-md-toc ./README.md
from here
cd ~/Downloads
wget https://bitbucket.org/RehabMan/os-x-maciasl-patchmatic/downloads/RehabMan-MaciASL-2018-0507.zip
unzip RehabMan-MaciASL-2018-0507.zip
mv /Downloads/MaciASL.app $HACK/bin
from here
cd ~/Downloads
wget https://bitbucket.org/RehabMan/os-x-maciasl-patchmatic/downloads/RehabMan-patchmatic-2018-0507.zip
unzip RehabMan-patchmatic-2018-0507.zip
mv /Downloads/patchmatic $HACK/bin
cd ~/Downloads
wget https://raw.githubusercontent.com/RehabMan/hack-tools/master/mount_efi.sh
# make edits to support a second argument
mv /Downloads/mount_efi.sh $HACK/bin
cd $HACK/git
git clone https://github.com/corpnewt/MountEFI MountEFI.git
cd MountEFI.git
cp MountEFI.command $HACK/bin
cp -R Scripts $HACK/bin/
chmod +x $HACK/bin/MountEFI.command
tools for various reasons:
mount_efi.sh
_install_subs.sh
update_lilufriend.sh
create_lilufriend.sh
template_kexts/LiluFriendLiteTemplate.kext
template_kexts/LiluFriendTemplate.kext
mkdir -p $HACK/git/Rehabman.git
cd $HACK/git/Rehabman.git
git clone https://github.com/RehabMan/hack-tools.git hack-tools.git
cd hack-tools.git
# make edits to mount_efi.sh to support second argument
# make edits to _install_sub.sh
# make edits to update_lilufriend.sh
# make edits to create_lilufriend.sh
# make edits to template_kexts/LiluFriendLiteTemplate.kext
# make edits to template_kexts/LiluFriendTemplate.kext
cp mount_efi.sh $HACK/bin
cp _install_subs.sh $HACK/bin
cp update_lilufriend.sh $HACK/bin
cp create_lilufriend.sh $HACK/bin
cp -r template_kexts $HACK/bin
from here
unzip it in $HACK/bin
Interim (IORegistryExplorer.app_v3+ is broken; it can't open files it creates) IORegistryExplorer.app_v2.1; extracted from the Snow Leopard Retail Install Disc_v10.6.3
download from here
unzip it in $HACK/bin
According to the second post paragraph titled Installing Kexts and this sakoula's post:
The kernelcache is an optimised and pre-linked version of the kernel with its extensions (kexts), which is then stored in /System/Library/PrelinkedKernels/prelinkedkernel, which is pointed to from its more traditional location of /System/Library/Caches/com.apple.kext.caches/Startup/kernelcache (definition from here).
According to this article Rehabman says:
Yes. Some kexts don't work well when injected (some don't work at all). It is also next to impossible to verify that the set of kexts a user has in EFI are compatible with each other. The output of kextcache provides excellent diagnostics of user mistakes/mismatches.
I tend to use injection early in the development process especially if I'm testing across multiple versions (recently tested the NUC8 with 4 different macOS versions, tweaking things here and there, and it was handy to have everything on USB, and injecting kexts from there as I was updating them, and testing with each of the 4 versions of macOS).
Then when I finalize, I install everything to /L/E.
So always place your kexts in /L/E
On the clover installation on the hard disk have all the configuration plus the bare minimum in kexts/Other directory in order to boot the installer or recovery plus SystemParameters/InjectKexts="Detect"
in order to avoid clover injecting the kexts if already in the kernel cache.
A backup USB stick needs the exact same configuration as the hard disk.
With SystemParameters/InjectKexts="Detect"
kexts in EFI/Clover/kexts
are not injected when FakeSMC.kext
or VirtualSMC.kext
is in kernal cache.
Because FakeSMC.kext
is always a "kext you need", you will always install it to the system volume, which will put it in kernel cache. Kernel cache, of course, will not have FakeSMC.kext
when booting the installer or recovery, so in these cases the kexts in EFI/Clover/kexts
will be injected as you would expect.
After putting kexts in /L/E
then run chown -R root:wheel ACPIBatteryManager.kext AppleALC.kext CPUFriend.kext CPUFriendDataProvider.kext CodecCommander.kext HibernationFixup.kext Lilu.kext NullEthernet.kext SATA-unsupported.kext USBPorts.kext VirtualSMC.kext VoodooPS2Controller.kext WhateverGreen.kext
, chmod -r 755 ACPIBatteryManager.kext AppleALC.kext CPUFriend.kext CPUFriendDataProvider.kext CodecCommander.kext HibernationFixup.kext Lilu.kext NullEthernet.kext SATA-unsupported.kext USBPorts.kext VirtualSMC.kext VoodooPS2Controller.kext WhateverGreen.kext
and sudo kextcache -i /
In order to have all the kexts installed in /L/E like Rehabman is writing you need for Lilu kexts and especially for CPUFriend Data provider LiluFriend:
It's highly recommended to let the bootloader inject CPUFriend, otherwise you'll need LiluFriend to ensure CPUFriend will work properly. Also, theoretically both ACPI_SMC_PlatformPlugin.kext and X86PlatformPlugin.kext should be untouched. You'd better use the original ones. (Well, CPUFriend will hook configResourceCallback(unsigned int, int, void const*, unsigned int, void*) in either ACPI_SMC_PlatformPlugin or X86PlatformPlugin, which parses IOKit personalities from Resources, so no problem to use a modified one if you do not really care for the signature, which will be restored in an upcoming system upgrade anyway) reference
Hi. For now, yes. I haven't found a better solution yet.Installing everything to /L/E uses Apple's native way, otherwise no. Clover's kext injection can be just for necessary and convenience. (installer/recovery)Also, it's simply wrong to leave lots of kexts outside kernel cache (Using the current way to inject kexts). A kernel cache should be the right eventual place where all kexts should go into. reference
LiluFriend.kext/Contents/Info.plist
:
<key>OSBundleLibraries</key>
<dict>
<key>com.apple.kpi.bsd</key>
<string>12.0.0</string>
<key>com.apple.kpi.iokit</key>
<string>12.0.0</string>
<key>com.apple.kpi.libkern</key>
<string>12.0.0</string>
<key>com.apple.kpi.mach</key>
<string>12.0.0</string>
<key>com.apple.kpi.unsupported</key>
<string>12.0.0</string>
<key>as.vit9696.Lilu</key>
<string>1.2.0</string>
<key>org.vanilla.driver.CPUFriend</key>
<string>1.0</string>
<key>org.vanilla.driver.CPUFriendDataProvider</key>
<string>1.0.0</string>
<key>as.vit9696.AppleALC</key>
<string>1.0</string>
<key>as.vit9696.WhateverGreen</key>
<string>1.0</string>
</dict>
added in CPUFriendDataProvider.kext/Contents/Info.plist
in order for kextcache -i
not to have an warning
<key>OSBundleCompatibleVersion</key>
<string>1.0.0</string>
based on the post the procedure to install is:
It has to contain references to each Lilu plugin (and Lilu itself) in its OSBundleLibraries dictionary, so yes, any change to the set of Lilu kexts installed results in a change to the LiluFriend (or LiluFriendLite) Info.plist. This is why I install all kexts first (with a cache rebuild), then generate LiluFriendLite, then install it, then rebuild cache again. It is quick and easy with the create_lilufriend.sh script.
Proccess you need to follow for LiluFriend:
- move all kexts except
LiluFriend.kext
to/L/E
- rebuild caches with
sudo kextcache -i /
- copy
LiluFriend.kext
to/L/E
- rebuild caches again
sudo kextcache -i /
Note: In order to construct the LiluFriend.kext
and install it you can use RehabMan/hack-tools which are installed in $HACK/bin
. Check the scripts there si a LiluFriend.kext
and a codeless LiluFriendLite.kext
by Rehabman. The procedure of the script is:
- move all kexts except
LiluFriend.kext
orLiluFriendLite.kext
to/L/E
- rebuild caches with
sudo kextcache -i /
- run
$HACK/bin/create_lilufriend.sh
to generate on the running directoryLiluFriend.kext
orLiluFriendLite.kext
- inspect
LiluFriend.kext/Contents/Info.plist
andLiluFriendLite.kext/Contents/Info.plist
- copy
LiluFriend.kext
orLiluFriendLite.kext
to/L/E
- rebuild caches again
sudo kextcache -i /
It turns out that various kexts do not work always from the system location (/L/E
). From the kernel logs I have seen that LiluFriend does not load (10.13.6). Also based on this it seems that VoodooI2C do no work from the system locations unless you disable some kexts that they be loaded. So I decided to inject everything from clover 'Other' directory and remove the Detect from clover Inject kexts
check this also XXX
https://www.tonymacx86.com/threads/guide-lenovo-z50-70-z40-70-g50-70-g40-70-using-clover-uefi.261787/page-4#post-1830517
It has to contain references to each Lilu plugin (and Lilu itself) in its OSBundleLibraries dictionary, so yes, any change to the set of Lilu kexts installed results in a change to the LiluFriend (or LiluFriendLite) Info.plist. This is why I install all kexts first (with a cache rebuild), then generate LiluFriendLite, then install it, then rebuild cache again. It is quick and easy with the create_lilufriend.sh script.
get the ACPI tables by hitting F4 in clover on a fat32 stick or on the default EFI partition. Tables will be saved in CLOVER/ACPI/origin
. Hit F2 in clover to save the preboot file in CLOVER/misc/preboot.log
.
create DSL files for both stock ACPI.air.bios.a06
refs.txt
External(_GPE.MMTB, MethodObj, 0)
External(_SB.PCI0.LPCB.H_EC.ECWT, MethodObj, 2)
External(_SB.PCI0.LPCB.H_EC.ECRD, MethodObj, 1)
External(_SB.PCI0.LPCB.H_EC.ECMD, MethodObj, 1)
External(_SB.PCI0.PEG0.PEGP.SGPO, MethodObj, 2)
External(_SB.PCI0.GFX0.DD02._BCM, MethodObj, 1)
External(_SB.PCI0.SAT0.SDSM, MethodObj, 4)
External(_GPE.VHOV, MethodObj, 3)
External(_SB.PCI0.XHC.RHUB.TPLD, MethodObj, 2)
cd ACPI.air.bios.a06/
../bin/iasl -da -dl -fe refs.txt DSDT.aml SSDT*.aml >iasl.output.txt 2>&1
cd ..
mkdir patches.air
cp ACPI.air.bios.a06/*dsl patches.air/
I always use ACPI 6.1 (it is referenced in patchmatic repo)
../bin/iasl -ve DSDT.dsl
../bin/iasl -p SSDT-USBX -ve SSDT-USBX.dsl
../bin/iasl -p SSDT-XHC -ve SSDT-XHC.dsl
for config.plist
you always use base64 format. Useful commands:
echo -n GFX0 | openssl base64 # R0ZYMA==
echo R0ZYMA== | openssl base64 -d # GFX0
for clover configurator
you always use hex format. Useful commands:
echo -n GFX0|xxd -g 100 -p # 47465830
echo 47465830 | xxd -r -g 100 -p # GFX0
$ echo -n GFX0|xxd
00000000: 4746 5830 GFX0
$ echo -n GFX0|xxd -b
00000000: 01000111 01000110 01011000 00110000 GFX0
$ echo -n "00000000: 4746 5830" | xxd -r
GFX0
gwmi win32_pnpentity | where{$_.deviceid -match "PCI"} | select name,deviceid
to unhide hidden entries in clover press F3
also check this for preboot partitions
references
- COMPLETE APPLEHDA PATCHING GUIDE
- AppleHDA Patching Guide
- A Beginner's Guide: How to Patch AppleHDA for Laptops
- https://www.tonymacx86.com/threads/solved-balance-control-mute-headphone-applealc.214360/page-2
- Use-AppleALC-sound-card-to-drive-the-correct-posture-of-AppleHDA
- DarwinDumper
- nm and xxd
- log show problem
- Visualizing the Mac Startup Process
- Enabling ACPI Debugging
- Debugging sleep issues
- Modify DSDT for LPCB IONameMatch
- How To Fix NO Audio and Mic After Wake on Mac OS X
log show --debug --info --start "2018-08-18 23:00:00" | grep -E 'kernel:|loginwindow:|sakoula'
log show --predicate 'process == "kernel" AND (eventMessage CONTAINS "AppleALC" OR eventMessage CONTAINS "Lilu")' --style syslog --source
log show --predicate 'process == "kernel"' --style syslog --source
log show --debug --info --start "2018-08-19 10:00:00" | grep -E 'sakoula'
log stream --source --level debug | grep -E 'kernel:|loginwindow:|ACPIDebug:'
log stream --source --level debug | grep -E 'kernel:|loginwindow:|ACPIDebug:'
log show --source --debug --info --start "2018-08-19 10:00:00" | grep -E 'kernel:|loginwindow:|ACPIDebug:'
log show --source --start "2018-08-19 10:00:00" | grep -E 'kernel:|loginwindow:|ACPIDebug:'
log show --source --start "2018-08-19 10:00:00" | grep -E 'ACPIDebug:'
log show --source --debug --info --last boot | grep -E 'kernel:|loginwindow:|ACPIDebug:'
log show --source --debug --info --last 1m | grep -E 'kernel:|loginwindow:|ACPIDebug:'
log show --source --debug --info --last 2h | grep -E 'kernel:|loginwindow:|ACPIDebug:'
log show --source --debug --info --last 2d | grep -E 'kernel:|loginwindow:|ACPIDebug:'
log show --debug --info --start "2018-08-22 09:38:00" | grep -E 'kernel:|loginwindow:|ACPIDebug:'
log show --predicate 'process == "kernel" AND (eventMessage CONTAINS "AppleALC" OR eventMessage CONTAINS "Lilu")' --style syslog --source
log show --predicate 'process == "kernel"' --style syslog --source
- [Guide] XiaoMi Mi Notebook Air 13"
- XiaoMi NoteBook Pro for macOS Mojave & High Sierra
- Xiaomi-Notebook-Air-6200u
- XiaoMi NoteBook Air for macOS High Sierra & Sierra
- Successfull Xiaomi Notebook Air 6200u
- Hackintosh-Installer-University
- [Guide] HP Pavilion 15-AB216TX Mojave SOS
- DSDT Patching for Dummies - SnowLeo with 100% vanilla /S/L/E
- T450-Hackintosh/ALC3232/tools/
- HP ProBook/EliteBook/Zbook using Clover UEFI hotpatch
- Guide DELL Inspiron 7560 High Sierra installation
- Sleep by lid close & Wake by lid openening?
- Rehabmans CodecCommander.
- How to make a SSDT for HD530 Sleep/Wake problem with Pike's code?
- Debugging sleep issues check posts by ClaudesTech
- Device management namespace objects
- A Guide on Fixing Sleep Issues
- [How-To] make a legacy kext
- (GUIDE) Getting your Busratio
- [How To] Tips for Finding Vendor and Device ID's
- Create Custom Entries to Hide Preboot and Recovery APFS Volumes, Fusion Drive Installation with Clover Configurator
- [HOWTO] Show PCI Cards on System Profiler - using EFI strings
- Setting the preferred sleep mode [hibernation or deep sleep (S4) / RAM sleep (S3)]
- [How To] Remotely Run Windows From a DS
- ([HowTo] Change your Machine Name in System Profiler)
- _REG (Region)
- ae_bad_parameter
- No handler for Region RAM EmbeddedControl
- [Bug 192501] New: Xiaomi Air 13 ACPI errors in dmesg
- ACPI Error: AE_BAD_PARAMETER (setup works fine)
- ACPI for Developers
- ACPI-Introduction
- ACPI for Developers
- the_mystery_of_darkwake_and_its_relation_to_power
- important-darkwake-0-flag-can-break-auto-sleep-in-10-8-1.69714
- [GUIDE] EDID injection
- HOW TO FIX BLACK SCREEN IN HIGH SIERRA
- Mac-frequently-used-to-the-command
- Use HIDPI to solve the problem of sleeping wake up black screen, flower screen and connecting the external monitor with the correct posture
- An order teaches you how to confirm your model and how to open HWP
- macOS installation tutorial and millet Pro installation process record
- Ubuntu to install USB disk using dd command under MacOS
- User Builds
- WiFi
- Use AppleALC sound card to spoof the correct posture of AppleHDA
- OS X 10.11.4 wants IMEI, not HECI
- WhatEverGreen Support Topic
- HP EliteDesk 800 G2 / HP ProDesk 600 G2 - SUCCESS
- AppleLife
- https://www.tonymacx86.com/threads/hp-elitedesk-800-g2-hp-prodesk-600-g2-success.261452/page-7#post-1862658
- [GUIDE/Workaround] Using Intel HD530 with Dual Monitors
- Black Screen with MacPro 6,1 or iMac 15 or iMac 17 System Definition
- AppleGraphicsPowerManagement.sh
- [GUIDE] Fix Skylake HDMI/DP Output
- AppleIntelSKLGraphicsFramebuffer.kext mods…
- Intel-FB-Patcher-tutorial
- [Guide] Alternative to the minStolenSize patch with 32mb DVMT-prealloc
- base64tohex
- miguel41
- HOW TO FIX BLACK SCREEN IN HIGH SIERRA
- real-world-systems
- See battery percentage in Terminal and GeekTool
- The I/O Registry Explorer
- Grabbing Serials and MAC Addresses