Contribute
Register

[Guide] Lenovo Legion Y520/Y720 using Clover UEFI

Status
Not open for further replies.
Joined
Oct 8, 2014
Messages
22
Motherboard
Lenovo legion y520 (Clover)
CPU
i7-7700HQ
Graphics
HD630, 1920x1080
Mac
  1. MacBook Pro
Mobile Phone
  1. iOS
This guide is outdated for the latest guide supporting Mojave follow this link:
https://www.tonymacx86.com/threads/guide-lenovo-legion-y520-y720-using-clover-uefi.261009/

Overview

The purpose of this guide is to provide a step-by-step guide to installing High Sierra or Sierra (10.12.6 only) on the Legion Y520/Y720 laptops.

My machine is a Y520 with Broadcom BCM94352Z.

Note: Unlike most Lenovo laptops this laptop doesn't have a WiFi whitelist.

Note: This guide will probably work with the Y920 too.


What you need

- macOS High Sierra, or Sierra downloaded from the Mac App Store.
- 8GB USB stick.


BIOS settings

Insure that:
- 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 (Nvidia), keep it enabled in BIOS. It will be disabled automatically by SSDT-Y520.aml when running macOS.


Preparing USB and initial Installation

This guide for creating USB and installing using Clover UEFI works well for this laptop: http://www.tonymacx86.com/el-capita...de-booting-os-x-installer-laptops-clover.html

Special notes:

- Use the 'createinstallmedia' approach. It works well, and there is little chance for pilot error. > [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 a compatible WiFi card already installed.

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

- Use the config_install.plist from the Lenovo repo: https://github.com/abdulilah99/Lenovo-Y520-macOS. Make sure to rename it back to config.plist.


Post Installation

Install Clover UEFI as described in the guide linked by the previous section (post #2). After installing Clover, and configuring it correctly (config.plist, kexts, etc) you should be able to boot from the HDD/SSD.

But there are still many issues and devices that won't work correctly. For that, we need to patch DSDT, provide a proper config.plist, and install the kexts that are required.

Since you have RealtekRTL8111.kext already injected by Clover, you should have internet access simply by using an Ethernet cable to your router. Plug it in and make sure you have internet access before continuing. Or if you're using FakePCIID_Broadcom_WiFi.kext, you can connect to your WiFi router before continuing.

Installation of the tools and patching is easy provided the scripts and tools at the repository: https://github.com/abdulilah99/Lenovo-Y520-macOS.

To start, the developer tools must be installed. Run Terminal, and type:

Code:
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:
mkdir ~/Projects
cd ~/Projects
git clone https://github.com/abdulilah99/Lenovo-Y520-macOS legion.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:
cd ~/Projects/legion.git
./Y520.sh --download-requirements

To install:

Code:
./Y520.sh --install-downloads

The '--download-requirements' argument will automatically gather the latest version of all tools (patchmatic, iasl, MaciASL) and all the kexts (FakeSMC.kext, ACPIBatteryManager.kext, etc) from bitbucket, and the needed hotpatch SSDTs from RehabMan's repo. The '--install-downloads' argument will automatically install the kexts & tools 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 ACPI.

In Terminal:

Code:
cd ~/Projects/legion.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).


Power Management

Everything required for CPU/IGPU power management is already installed with the steps above.
There is no longer any need to use the ssdtPRgen.sh script.

Also, be aware that hibernation (suspend to disk or S4 sleep) is not supported on hackintosh.

You should disable it:

Code:
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 ACPI files are in place (previous two steps), you're ready to use the final config.plist from the repo.

Code:
cd ~/Projects/legion.git
./Y520.sh --install-config

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 MacBookPro14,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".


WiFi using BCM94352Z (DW1560)

The repo scripts already install the necessary kexts for BCM94352Z.


Updates to the patch repositories

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

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

In Terminal:

Code:
cd ~/Projects/legion.git
./Y520.sh --update
./Y520.sh --download-requirements
./Y520.sh --install-downloads
./Y520.sh --update-config
make clean
make
make install


What works

- UEFI booting via Clover
- built-in keyboard (with special function keys)
- built-in trackpad (basic gestures)
- native WiFi via BCM94352Z
- Bluetooth (with handoff) using BCM94352Z
- native USB3
- 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 HD630
- wired Ethernet
- Mac App Store working
- screen works without flicker


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.

USB Type-C: I haven’t tested it yet, I will update the USB port configuration as soon as I do.

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

To fix:
- reboot without caches (hit space at Clover then select without caches or add -f to boot args)
- rebuild cache

Code:
sudo kextcache -i /

- reboot normally (if needed, two times)


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.


Updating to High Sierra

As you probably already know, High Sierra has a new file system called APFS. Boot drives on SSDs will automatically be converted to APFS if you start the High Sierra installer in the default way (eg. running /Applications/Install macOS High Sierra.app).

If you intend to use APFS, don't forget to add apfs.efi to EFI/CLOVER/drivers64UEFI. Without apfs.efi in drivers64UEFI, Clover will not recognize APFS boot volumes. You can find apfs.efi at /usr/standalone/i386/apfs.efi inside of "/Applications/Install macOS High Sierra.app/Contents/SharedSupport/BaseBinaries.dmg".

But you can avoid converting to APFS if you want to stick with HFS+. To do so, don't use the Install macOS High Sierra.app to start the installer. Use 'startosinstall' instead:

Code:
/Applications/"Install macOS High Sierra.app"/Contents/Resources/startosinstall --converttoapfs NO


Problem Reporting

Post all the PR files requested in the FAQ (Which you can find here: https://www.tonymacx86.com/threads/faq-read-first-laptop-frequent-questions.164990/ )

Or you can automatically generate them using the tool made by @black.dragon74
Full details are here:
https://www.tonymacx86.com/threads/tool-generate-proper-problem-reporting-files.235953/

Credits

@the-braveknight for writing macos-tools scripts, patching AppleHDA.
@RehabMan for his repos, tools, guides, and scripts.
 
Last edited:
I have doubt, why not just use kext from https://github.com/acidanthera/AppleALC/releases and use layout 28 for Y520?


Anyway thanks for guide, this is more complete than my in progress noob guide

Also for the wifi card did you swap it? Cause mine came with a atheros wifi card.
 
I have doubt, why not just use kext from https://github.com/acidanthera/AppleALC/releases and use layout 28 for Y520?
You can use that kext if you want, but in the guide I am using a better solution made by @the-braveknight specifically for the Y520 which also supports auto switching for input devices.
Also for the wifi card did you swap it? Cause mine came with a atheros wifi card.
Yeah I swapped it with a BCM94352Z (DW1560) card.
 
To fix:
- reboot without caches (hit space at Clover then select without caches or add -f to boot args)
- rebuild cache

Code (Text):
sudo kextcache -i /
- reboot normally (if needed, two times)


---I am stuck at this step, the new clover doesnt have this boot without caches option?
I rebuilt cache and rebooted multiple times, but there is audio..
Any other way to clear cache?
 
To fix:
- reboot without caches (hit space at Clover then select without caches or add -f to boot args)
- rebuild cache

Code (Text):
sudo kextcache -i /
- reboot normally (if needed, two times)


---I am stuck at this step, the new clover doesnt have this boot without caches option?
I rebuilt cache and rebooted multiple times, but there is audio..
Any other way to clear cache?
What is the issue you’re trying to fix? Could you boot with the repo’s config.plist? I see no PR files attached.
 
In your guide, you have no fix for DVMT-prealloc (igpu) ?
 
I am trying to fix audio. I am using config.plist from repo.
 

Attachments

  • debug_22137.zip
    1.9 MB · Views: 280
In your guide, you have no fix for DVMT-prealloc (igpu) ?
I have a fix for DVMT-prealloc it is in the config.plist>KernelAndKextPatches>KextsToPatch>Item 0
And you should use the latest clover rather than RehabMan's version of it
because RehabMan’s clover hasn't been updated in a while.
 
I am trying to fix audio. I am using config.plist from repo.
You have a few problems. I see both elan and Voodoo PS2 kexts installed. You should either install RehabMan's VoodooPS2Controller.kext (installed by repo scripts), OR ApplePS2SmartTouchPad.kext because they're mutually exclusive.
Also, I see no FakePCIID_Intel_HDMI_Audio.kext, it is required, thus installed by repo scripts. Also remove junk kexts like AtherosWifiInjector.kext, SmoothMouse.kext. You shouldnt install third party kexts until you have a fully working setup.
 
Is there any problem if I use rehabman's clover fork ?
 
Status
Not open for further replies.
Back
Top