[Guide] Lenovo G50-70/G40-70 using Clover UEFI (10.11)

Discussion in 'El Capitan Laptop Guides' started by the-braveknight, Aug 27, 2016.

  1. the-braveknight

    the-braveknight Moderator

    Joined:
    Nov 24, 2015
    Messages:
    746
    Mobo:
    Lenovo Z50-70 (Clover)
    CPU:
    Intel Core i7-4510U
    Graphics:
    Intel HD Graphics 4400 (1920x1080)
    Mac:
    MacBook Pro
    Mobile Phone:
    iOS
    Aug 27, 2016 at 8:16 PM #1
    the-braveknight

    the-braveknight Moderator

    Joined:
    Nov 24, 2015
    Messages:
    746
    Mobo:
    Lenovo Z50-70 (Clover)
    CPU:
    Intel Core i7-4510U
    Graphics:
    Intel HD Graphics 4400 (1920x1080)
    Mac:
    MacBook Pro
    Mobile Phone:
    iOS
    Overview

    The purpose of this guide is to provide a step-by-step guide to installing El Capitan/Yosemite on the Lenovo G50-70 laptops. Please note I do not have this laptop, but since it is very similar to my Z50-70 laptop, I decided to provide this guide.


    Note: This guide is completely based on RehabMan's guides and scripts, I take no credits for this guide, I only modified his scripts and tools to match the G50-70.


    The laptop BIOS implements a WiFi whitelist, which must be defeated in order to install an OS X compatible WiFi card.

    What you need

    - Lenovo G50-70 or G40-70
    - OS X El Capitan or Yosemite downloaded from the Mac App Store
    - 8GB USB stick
    - Broadcom BCM94352Z for native WiFi/BT


    BIOS settings

    To start, set BIOS to Windows defaults.

    Then insure:
    - UEFI boot is enabled
    - secure boot is disabled
    - enable Legacy Boot (but UEFI first) and you may experience less boot time glitches

    Note: If your laptop has a discrete graphics card (AMD), keep it enabled in BIOS. It will be disabled automatically by SSDT-AMD.aml when running OS X.


    Preparing USB and initial Installation

    - Use the 'createinstallmedia' approach. It works well, and there is little chance for pilot error. This method also gives you an OS X recovery partition. Follow RehabMan's guide here > [Guide] Booting the OS X Installers on LAPTOPS with Clover.

    - Definitely copy RealtekRTL8111.kext to Clover/kexts/Other as having network support during post-install is helpful. The rest of this guide depends on it. An alternate is to copy FakePCIID.kext and FakePCIID_Broadcom_WiFi.kext to Clover/kexts/Other. This will enable WiFi, provided you have the BCM94352Z WiFi card already installed.

    Note: FakePCIID.kext and FakePCIID_Broadcom_WiFi.kext are available here: https://github.com/RehabMan/OS-X-Fake-PCI-ID

    - Some of the G50-70 laptops have ELAN touchpad so RehabMan's VoodoPS2Controller.kext might not work. An alternate is to download ELAN kext from the G50 repo.

    - GenericUSBXHCI.kext is not necessary with this laptop since AppleUSBXHCI.kext appears to work well natively. Also, GenericUSBXHCI.kext does not work on 10.11 so it should not be used.

    - Use the config_install.plist from the G50 repo: https://github.com/the-braveknight/Lenovo-G50-DSDT-Patch/raw/master/config_install.plist


    Post Installation

    - Downlad Clover UEFI from here : Clover UEFI Bootloader
    - Install Clover UEFI to your internal SSD/HDD and make sure you click 'Customize' and select:
    - Install for UEFI booting only
    - Install Clover in the ESP
    - Dirvers64UEFI > OsxAptioFixDrv-64

    - Copy HFSPlus.efi to drivers64UEFI folder.

    Installation of the tools and patching is easy provided the scripts and tools at the repository: http://github.com/the-braveknight/Lenovo-G50-DSDT-Patch

    To start, the developer tools must be installed. Run Terminal, and type:
    Code (Text):

    git
     
    You will be prompted to install the developer tools. Since you have internet working, you can choose to have it download and install them automatically. Do that before continuing.
    After the developer tools are installed, we need to make a copy of the project on github.

    In Terminal:
    Code (Text):

    mkdir ~/Projects
    cd ~/Projects
    git clone https://github.com/the-braveknight/Lenovo-G50-DSDT-Patch.git g50.git
     
    Now it is time to install some more tools and all the kexts that are required...
    To download the kexts & tools, in Terminal:
    Code (Text):

    cd ~/Projects/g50.git
    ./download.sh
     
    To install:
    Code (Text):

    ./install_downloads.sh
     
    Or if you have an ELAN trackpad:
    Code (Text):

    ./install_downloads.sh elan
     


    The download.sh script will automatically gather the latest version of all tools (patchmatic, iasl, MaciASL) and all the kexts (IntelBacklight.kext, ACPIBatteryManager.kext, etc) from bitbucket. The install_downloads.sh will automatically install them to the proper locations.

    If you wish, you can reboot to verify a few more items are working (many only partially).

    To finish the setup, we need a correctly patched DSDT/SSDT.

    With the current project, no patched DSDT/SSDTs are used. Instead I use Clover hotpatches and a group of small SSDTs.

    In Terminal:
    Code (Text):

    cd ~/Projects/g50.git
    make
    make install
     
    The 'make' causes the patched files to be compiled (with iasl), the results placed in ./build.

    Finally, 'make install', mounts the EFI partition, and copies the built files where they can be loaded by Clover (to EFI/Clover/ACPI/patched).


    10.12 Notes

    Most changes for 10.12 are already done in the project or have been fixed by Apple in 10.12.1+.

    The SysPrefs->Displays problem though must be fixed by injecting a patched EDID with Clover, I created a script for that (patch_edid.sh), you should run the script only if you're affected by this issue (SysPrefs->Displays fails to load), you should check before running the script.

    To use the script, in Terminal:
    Code (Text):

    cd ~/Projects/g50.git
    ./patch_edid.sh
     

    Power Management

    Use the ssdtPRgen.sh script by Pike R. Alpha: https://github.com/Piker-Alpha/ssdtPRGen.sh

    Instructions for using it are provided in the README.

    The generated SSDT.aml should be placed on the EFI partition at /EFI/Clover/ACPI/patched/SSDT.aml.

    Based on the current instructions at the README, what follows is a synopsis...

    To prepare, you only need to do the first two commands:

    In Terminal:
    Code (Text):

    cd ~/Projects/g50.git
    curl -o ./ssdtPRGen.sh https://raw.githubusercontent.com/Piker-Alpha/ssdtPRGen.sh/master/ssdtPRGen.sh
    chmod +x ./ssdtPRGen.sh
     
    Then you can run the script:
    Code (Text):

    ./ssdtPRGen.sh
     
    When it asks if you want to copy to /Extra just respond 'n'. Same for opening ssdt.dsl... respond 'n'.

    The results are at ~/Library/ssdtPRgen/SSDT.aml.

    Copy that file to EFI partition, /EFI/Clover/ACPI/patched/SSDT.aml

    Code (Text):

    cd ~/Projects/g50.git
    sudo ./mount_efi.sh /
    cp ~/Library/ssdtPRgen/ssdt.aml /Volumes/EFI/EFI/Clover/ACPI/patched/SSDT.aml
     
    Also, be aware that hibernation (suspend to disk or S4 sleep) is not supported on hackintosh.

    You should disable it:
    Code (Text):

    sudo pmset -a hibernatemode 0
    sudo rm /var/vm/sleepimage
    sudo mkdir /var/vm/sleepimage
     
    Always check your hibernatemode after updates and disable it. System updates tend to re-enable it, although the trick above (making sleepimage a directory) tends to help.

    Final config.plist
    Up to now, you've been using the same config.plist we were using for installation. After all the APCI files are in place (previous two steps), you're ready to use the final config.plist from the g50 repo.

    First, mount the EFI partition:
    Code (Text):

    cd ~/Projects/g50.git
    sudo ./mount_efi.sh /
     
    Then copy the file:
    Code (Text):

    cd ~/Projects/g50.git
    cp config.plist /Volumes/EFI/EFI/Clover/config.plist
     

    After copying the config.plist from the repo to EFI/Clover/config.plist, you should customize the SMBIOS so you have a unique serial. You can use Clover Configurator to do this (use google to find/download it). DO NOT use Clover Configurator to edit your actual config.plist. Instead edit a "dummy" config.plist to create the SMBIOS data and then use copy/paste with a plist editor (I use Xcode) to copy the SMBIOS section into my active config.plist. Clover Configurator is too buggy and cannot be trusted with edits to your real config.plist. This guide uses MacBookPro11,1. Do not use any other model identifier.

    Repeat: DO NOT edit your config.plist with Clover Configurator. Clover Configurator will erase important settings from the config.plist, and as a result, it will not work.


    Do not stop reading

    Although most of the post-install tasks are done, continue to read this guide. It it has important information you should know about.

    Be sure to visit "Known Problems", especially the instructions in the "Audio:" section. Typically, even after completing all the above tasks, audio will not work on the first reboot. You must follow the specific instructions in that section in order to get the audio kexts in cache.

    In the case of a problem, don't bother asking about with without all files requested in "Problem Reporting".


    BIOS mods for compatible WiFi installation

    The laptop BIOS implements a WiFi whitelist, which must be defeated in order to install an OS X compatible WiFi card.

    See this guide for more info: http://www.tonymacx86.com/el-capita...ovo-g50-70-z50-70-bios-whitelist-removal.html


    WiFi using BCM94352Z

    The ./download.sh and ./install_downloads.sh script have both been updated to install the necessary kexts for BCM94352Z.


    Updates to the patch repositories

    From time to time, updates may become available to the project repository. In the event of such updates, you may want to update your copies, and re-patch DSDT/SSDT with the updates.

    Since you're using git, it is easy...

    In Terminal:
    Code (Text):

    cd ~/Projects/g50.git
    git pull
    ./download.sh
    ./install_downloads.sh
    ./update_config.sh
    make
    make install
     


    What works

    - UEFI booting via Clover
    - built-in keyboard (with special function keys)
    - built-in trackpad (basic gestures)
    - HDMI video/audio with hotplug
    - AirPlay mirroring to AppleTV
    - native WiFi via BCM94352Z
    - Bluetooth (with handoff) using BCM94352Z
    - native USB3 with AppleUSBXHCI (USB2 works also)
    - native audio with AppleHDA, including headphone
    - built-in mic
    - built-in camera
    - native power management
    - battery status
    - backlight controls with smooth transitions, save/restore across restart
    - accelerated graphics for HD4400 including OpenCL
    - wired Ethernet
    - Mac App Store working
    - screen works without flicker
    - Messages/FaceTime (working on 10.10.3 even though I didn't run through the guide: http://www.tonymacx86.com/general-help/110471-how-fix-imessage.html)

    Known Problems

    Find My Mac/Locking: Find My Mac does not work properly. Don't lock your mac because it's difficult (or impossible) to unlock again.

    Slow WiFi after sleep/wake cycle: Disable "Wake for network access" in SysPrefs->Energy Saver.

    Audio: After installing new/updated kexts or after the initial installation, you may lose audio.

    To fix:
    - reboot without caches (hit space at Clover, select without caches)
    - rebuild cache
    Code (Text):

    sudo touch /System/Library/Extensions && sudo kextcache -u /
     
    - reboot normally (if needed, two times)

    Audio: External mic via combo headphone/mic jack is not working.

    CPU Frequency: Clover identifies the CPU speed (as shown in "About this Mac") incorrectly. On my system (2.0Ghz Core i7-4510u), it shows 2.59Ghz. This appears to be cosmetic. You can fix it by overriding Clover logic with config.plist/CPU/FrequencyMHz. You will see how my setting is commented in the config.plist. Set it as appropriate for your own CPU.


    Other post-install tasks

    Trackpad: Be sure to visit the options in SysPrefs->Trackpad and change them to your liking.

    Bluetooth: If you get the Bluetooth Setup Assistant popup, go to SysPrefs->Bluetooth->Advanced, uncheck the boxes.

    Problem Reporting

    Download patchmatic: https://bitbucket.org/RehabMan/os-x-maciasl-patchmatic/downloads/RehabMan-patchmatic-2015-0107.zip
    Extract the 'patchmatic' binary from the ZIP. Copy it to /usr/bin, such that you have the binary at /usr/bin/patchmatic.

    In terminal,
    Code (Text):

    if [ -d ~/Downloads/RehabMan ]; then rm -R ~/Downloads/RehabMan; fi
    mkdir ~/Downloads/RehabMan
    cd ~/Downloads/RehabMan
    patchmatic -extract
     
    Note: It is easier if you use copy/paste instead of typing the commands manually.

    Post contents of Downloads/RehabMan directory (as ZIP).

    Also, post ioreg: http://www.tonymacx86.com/audio/58368-guide-how-make-copy-ioreg.html. Please, use the IORegistryExplorer v2.1 attached to the post! DO NOT reply with an ioreg from any other version of IORegistryExplorer.app.

    And output from:
    Code (Text):

    kextstat|grep -y acpiplat
    kextstat|grep -y appleintelcpu
    kextstat|grep -y applelpc
    kextstat|grep -y applehda
     
    Also, post EFI/Clover folder (press F4 at main Clover screen before collecting). Please eliminate 'themes' directory, especially if you have an overabundance of themes installed.

    Also post output of:
    Code (Text):

    sudo touch /System/Library/Extensions && sudo kextcache -u /
     
    Credits

    RehabMan for his repos, tools, guides, and scripts.
     
    Last edited: Mar 2, 2017
  2. GeorgeNew

    GeorgeNew

    Joined:
    May 3, 2016
    Messages:
    9
    Oct 15, 2016 at 10:32 AM #2
    GeorgeNew

    GeorgeNew

    Joined:
    May 3, 2016
    Messages:
    9
    Hi there!

    Thank you for the really good guide, it works like a charm in my El Capitan Lenovo G50-70!

    In my new Lenovo G50, I decided to try Sierra from scratch (no problems during installation)

    BUT I have mistakenly used the

    ./install_downloads.sh

    instead of

    ./install_downloads.sh elan

    and my trackpad is not recognized, function keys (brightness, audio) are set to F14, F15, which don't exist in my keyboard...

    and when I run ./install_downloads.sh elan, on top, obviously I get errors for 17 kexts failed !

    Is there a way to uninstall the package with wrong kexts or point me to which exactly kexts I have to uninstall and reinstall for the ELAN trackpad and keyboard to function properly?

    best regards
    George
     
  3. the-braveknight

    the-braveknight Moderator

    Joined:
    Nov 24, 2015
    Messages:
    746
    Mobo:
    Lenovo Z50-70 (Clover)
    CPU:
    Intel Core i7-4510U
    Graphics:
    Intel HD Graphics 4400 (1920x1080)
    Mac:
    MacBook Pro
    Mobile Phone:
    iOS
    Oct 15, 2016 at 12:39 PM #3
    the-braveknight

    the-braveknight Moderator

    Joined:
    Nov 24, 2015
    Messages:
    746
    Mobo:
    Lenovo Z50-70 (Clover)
    CPU:
    Intel Core i7-4510U
    Graphics:
    Intel HD Graphics 4400 (1920x1080)
    Mac:
    MacBook Pro
    Mobile Phone:
    iOS
    "./install_downloads.sh elan" already uninstalls the Synaptics kext (VoodooPS2) and installs the ELAN kext, you might want to run "./download.sh" then "./install_downloads.sh elan" if you have an ELAN trackpad.
     
  4. GeorgeNew

    GeorgeNew

    Joined:
    May 3, 2016
    Messages:
    9
    Oct 15, 2016 at 2:38 PM #4
    GeorgeNew

    GeorgeNew

    Joined:
    May 3, 2016
    Messages:
    9

    Thanx!

    It appears that although trackpad and keyboard work gebearlly fine, apart the Volume Control Shortcuts, the trackpad itself is not recognised inside Settings->Trackpad.

    Weird, cause on my other lenovo G50 with El Capitan trackpad options appear fine inside settings. Could be a Sierra issue? I will check on my El Capitan Kext for Trackpad and try to use them as a test.

    Best
    George
     
    the-braveknight likes this.
  5. RehabMan

    RehabMan Moderator

    Joined:
    May 3, 2012
    Messages:
    143,684
    Mobo:
    Intel DH67BL
    CPU:
    Core i7-2600K
    Graphics:
    Intel HD 3000
    Mac:
    MacBook Air
    Mobile Phone:
    iOS
    Oct 15, 2016 at 2:40 PM #5
    RehabMan

    RehabMan Moderator

    Joined:
    May 3, 2012
    Messages:
    143,684
    Mobo:
    Intel DH67BL
    CPU:
    Core i7-2600K
    Graphics:
    Intel HD 3000
    Mac:
    MacBook Air
    Mobile Phone:
    iOS
    Something you should have already read...

    https://www.tonymacx86.com/threads/readme-common-some-unsolved-problems-in-10-12-sierra.202316/
     
  6. GeorgeNew

    GeorgeNew

    Joined:
    May 3, 2016
    Messages:
    9
    Oct 15, 2016 at 2:51 PM #6
    GeorgeNew

    GeorgeNew

    Joined:
    May 3, 2016
    Messages:
    9
    the-braveknight likes this.
  7. daigosx

    daigosx

    Joined:
    Nov 16, 2015
    Messages:
    66
    Mobo:
    Lenovo G50-70 (Clover)
    CPU:
    Intel Core i5-4210U
    Graphics:
    Intel HD Graphics 4400 (1366x768)
    Mobile Phone:
    Android
    Oct 26, 2016 at 10:03 AM #7
    daigosx

    daigosx

    Joined:
    Nov 16, 2015
    Messages:
    66
    Mobo:
    Lenovo G50-70 (Clover)
    CPU:
    Intel Core i5-4210U
    Graphics:
    Intel HD Graphics 4400 (1366x768)
    Mobile Phone:
    Android
    Great guide. I was looking at your Z50 repo to build a G50 one and found you already did it.
    I'd be gad to help if you need :)
     
  8. daigosx

    daigosx

    Joined:
    Nov 16, 2015
    Messages:
    66
    Mobo:
    Lenovo G50-70 (Clover)
    CPU:
    Intel Core i5-4210U
    Graphics:
    Intel HD Graphics 4400 (1366x768)
    Mobile Phone:
    Android
    Oct 26, 2016 at 10:20 AM #8
    daigosx

    daigosx

    Joined:
    Nov 16, 2015
    Messages:
    66
    Mobo:
    Lenovo G50-70 (Clover)
    CPU:
    Intel Core i5-4210U
    Graphics:
    Intel HD Graphics 4400 (1366x768)
    Mobile Phone:
    Android
    @the-braveknight I see you added wifi patches for 10.12 in your repo, did you tried Sierra on G50? Would you recommend the update?
    Also I noticed you patch the DSDT into Clover plist, does it means there's no need for patched DSDT at all?
     
  9. the-braveknight

    the-braveknight Moderator

    Joined:
    Nov 24, 2015
    Messages:
    746
    Mobo:
    Lenovo Z50-70 (Clover)
    CPU:
    Intel Core i7-4510U
    Graphics:
    Intel HD Graphics 4400 (1920x1080)
    Mac:
    MacBook Pro
    Mobile Phone:
    iOS
    Oct 26, 2016 at 11:58 AM #9
    the-braveknight

    the-braveknight Moderator

    Joined:
    Nov 24, 2015
    Messages:
    746
    Mobo:
    Lenovo Z50-70 (Clover)
    CPU:
    Intel Core i7-4510U
    Graphics:
    Intel HD Graphics 4400 (1920x1080)
    Mac:
    MacBook Pro
    Mobile Phone:
    iOS
    I don't use Sierra as my main OS and I don't recommend you do that just yet... Sierra is full of problems... it's also worth mentioning that I do not have a G50-70 laptop, I built this repo based on my experiences helping G50-70 users.
     
    Last edited: Oct 26, 2016
  10. the-braveknight

    the-braveknight Moderator

    Joined:
    Nov 24, 2015
    Messages:
    746
    Mobo:
    Lenovo Z50-70 (Clover)
    CPU:
    Intel Core i7-4510U
    Graphics:
    Intel HD Graphics 4400 (1920x1080)
    Mac:
    MacBook Pro
    Mobile Phone:
    iOS
    Oct 26, 2016 at 12:00 PM #10
    the-braveknight

    the-braveknight Moderator

    Joined:
    Nov 24, 2015
    Messages:
    746
    Mobo:
    Lenovo Z50-70 (Clover)
    CPU:
    Intel Core i7-4510U
    Graphics:
    Intel HD Graphics 4400 (1920x1080)
    Mac:
    MacBook Pro
    Mobile Phone:
    iOS
    I'd be happy to add anything you suggest to the repo. :)
     
    daigosx likes this.

Share This Page