Guide for Installing OS X Yosemite

Embed Size (px)

DESCRIPTION

Guide for Installing OS X Yosemite

Citation preview

  • Guide for Installing OS X Yosemite on Lenovo Ideapad Y510p

    Before Reading On:

    This guide is an incomplete project and I will still refine it through the time

    This guide is intended to help the very newbies having Lenovo Y510p to taste some Yosemite

    This is not a definite guide and you have to adapt according to the situation you have

    For every step there might be other ways to do it better (or worst)

    The experts and advanced users may not agree with some of the steps mentioned here. This is what I had to do to get it working for my

    liking but comments and suggestions are very welcome indeed.

    The work introduced here is gathered and collected from many, many, sources. My contribution is the least of all and I will try to give

    credit where it belongs as much as I remember. For any work I forgot to give credit I apologise for not remembering the source.

    Whoever is going to use part or all of this guide, please backup everything you are going to tinker with first.

    Change-Log

    Spoiler

    1. Introduction

    This guide intends to help installing OS X 10.10 Yosemite on Lenovo IdeaPad Y510p. There are many ways to

    install OS X on this machine but I will focus only on vanilla installation. So no myHack, no niresh, no iAtkos, no U-

    Beast, no what so ever with all respect to the developers behind these tools and distributions.

    Lenovo Y510P released with different configurations and is adjustable. My model have the built-in Hard Disk Drive

    (SSHD 1TB+8GB Cache SSD integrated) in addition to second Nvidia graphics card in the caddy. In Windows with

    the second Nvidia present we see no trace of Intel card which means the first Nvidia (the built-in not the external)

    is apparently attached to the display in a configuration that I do not know. However, to get the two Nvidia cards

    to work in OS X we have to know for sure how to disable the Intel card so the built-in Nvidia would be the main

    card for display. I do not know how to do that and there is not any guide for doing it anywhere so the only option

    for now is to skip Nvidia all together. So, the extra graphics card must be removed and the switchable

    card should (to prevent other problems) be disabled via BIOS or by DSDT/SSDT patches.

    Also, since Lenovo Y510P comes preloaded with Windows 8 (8.1), I will keep that installed and install Yosemite

    alongside it in a dual boot configuration. This means Im using the HDD and not adding any SSD for the moment.

    For those who have added SSD to their laptop I think they can manage with slice modifications to this guide

    (basically, anything related to HDD and Windows can be ignored).

    As my HDD is partitioned for Windows and Data that Im not willing to lose, I wont repartition the disk. So I have

    to install OS X keeping my Windows and Data partitions there. We know that Lenovo Y510P have Windows 8.1

    installed in UEFI mode so we have two options to install OS X which Ill go with the second of them:

    Install OS X in Legacy mode and enabling booting from Legacy in BIOS. In this case, theres not any boot

    loader that can boot both EFI and Legacy BIOS at the same time and only default will be loaded unless I

    press F12 once Lenovo logo show up to select what to boot from.

    Install OS X in EFI mode. Here we can use Clover EFI boot loader to be able to boot either OS since both

    would be installed in EFI.

    A problem that we might have for such type of configuration (both Windows and OS X in EFI on the same HDD) is

    that OS X needs bigger EFI partition than that created by Windows (assuming Windows is installed first). In this

    case, OS X installer will refuse to format the partition we prepared for OS X installation. We have to sort this

    problem out before trying to install OS X at all.

    This guide is split into several parts. First we create a space to install OS X in. Next we modify the size of EFI

    partition to remedy the mentioned problem. We then prepare a USB installer for OS X and use it to install. Finally

    we do some post-installation fixes to have more juice from the system.

    2. Preparing a Partition for OS X Yosemite

  • There are many ways to do this, the easiest is to use Disk Management in Windows to shrink the last partition and

    create a new one in the space. Any other partitioning tool can be used for that matter.

    My HDD was partitioned to have EFI partition, MS reserved partition, MS recovery partition, Windows partition,

    and Data partition. I used Disk Management in Windows to shrink Data partition and free some space, then

    formatted that partition labelling it Yosemite. The size of that partition is optional but I suggest to have it no less

    than 50GB to allow space for apps to be installed later on OS X. The label is optional too, we just need to keep

    record of that label so we dont accidentally ruin any important partition later.

    Once we have the partition formatted (either fat32, exFat, or NTFS), we can proceed to the next step.

    3. Increasing EFI Partition Size

    As I said above, theres a problem when trying to format the created partition for OS X while trying to install it. OS

    X will fail to format the created partition (we labelled it Yosemite) as HFS+ because of small EFI partition size

    since OS X requires big enough EFI partition. So before attempting to install OS X, well have to increase the size

    of that partition.

    A default install of Windows 8.1 creates ~300MB Recovery partition, ~100MB EFI partition, and 128MB MSR

    (Microsoft Reserved) partition. This process (originally by RehabMan and slightly modified by me) removes the

    mentioned partitions and creates bigger EFI:

    Spoiler

    1. Boot Windows installer USB (you should have one ready of course)

    2. Press Shift+F10 for recovery command line

    3. Type: diskpart

    4. Type: list disk (verify disk 0)

    5. Type: select disk 0

    6. Type: list part (you should see all partitions)

    7. Type: select part 2 (part 2 is EFI part)

    8. Type: assign

    9. Type: list vol (to find out the drive letter assigned to EFI and Windows partitions, lets assume they were

    E: and C: respectively)

    10. press Shift+F10 for another command prompt

    11. Type: robocopy e:\efi c:\efi.bak /mir

    12. Switch back to original command prompt (the one running diskpart)

    13. Type: select part 1

    14. Type: delete part override

    15. Type: select part 2

    16. Type: delete part override

    17. Type: select part 3

    18. Type: delete part override

    19. Type: create part efi size=528 (the space left by removing all three partitions Recovery, EFI, and MSR)

    20. Type: format quick fs=fat32 label="EFI"

    21. Type: assign

    22. Type: list vol (to find out new drive letter, assume it is F: )

    23. Switch back to other command prompt window (the one just running cmd)

    24. Type: robocopy c:\efi.bak f:\EFI /mir

    25. Type: exit

    26. Switch to original command prompt (the one running diskpart)

    27. Type: exit

    28. Type: exit

    29. Hit: Alt+F4 at the Windows installer to quit

    Steps from 1 to 12 create backup of EFI partition contents so we can restore the contents after creating a bigger

    EFI and have Windows bootable. Then 13-18 it removes all three partitions Recovery, EFI, and MSR. Step 19

    creates a new EFI partition with arbitrary size (put 528 which is the sum of previous EFI, Recovery, and MSR

  • sizes). Step 20 format and label the new EFI partition, and finally step 24 restores EFI partition contents from the

    backup we created earlier.

    At this point, I verify that Windows still boots and it should. Now I have 4 main partitions EFI, Windows, Data, and

    Yosemite.

    4. Preparing OS X Yosemite USB Installer

    I will use virtual installation of OS X on windows to create the USB installer. If you have a working OS X

    somewhere else you could use that too. The USB should be no less than 8GB and you should have

    downloaded Yosemite Installer App from AppStore, ShowHiddenFiles app, Clover EFI boot loader, CloverConfigurator,

    HFSPlus.efi, FakeSMC.kext, and VoodooPS2Controller.kext. All these are available in Downloads section near the end of the thread.

    The following are the steps to create the USB installer:

    Plug the USB in and mount it in OS X.

    Open Disk Utility, select the USB from the list, click on Partition tab, choose 1 partition in Partition Layout,

    click options button, choose GUID Partition Table, and click Apply. You can format the created partition in

    the USB as Mac OS Extended and label it as Yosemite Installer. Selecting GUID scheme creates a hidden

    EFI partition on the USB so the USB actually contains 2 partitions with only 1 visible.

    Run ShowHiddenFiles app and click Show Special Files

    Go to Applications folder and right click the Yosemite Installer App > Show package Contents > Contents >

    SharedSupport > and mount InstallESD.dmg. This will mount a disk labelled OS X Install ESD.

    From the new window appeared, right click BaseSystem.dmg and choose Open. The image will be mounted

    as OS X Base System.

    Go back to Disk Utility and Restore the disk OS X Base System to our created USB partition Yosemite

    Installer. Close Disk Utility once it is done, we are not going to need it anymore.

    On the desktop there will be 2 disks with the label OS X Base System. One of them is mounted from

    BaseSystem.dmg and the other belongs to our USB which is the larger one. Rename the larger one to

    Yosemite Installer.

    Now open the disk labelled OS X Install ESD on desktop and copy both files BaseSystem.chunklist and

    BaseSystem.dmg to the root of Yosemite Installer. Also copy the folder Packages to Yosemite Installer

    > System > Installation after removing the link with the same name there.

    Start installing Clover on the USB (the partition Yosemite Installer) with these options:

    Install for UEFI booting only.

    Install Clover in the ESP.

    Themes > BootCamp (or whatever)

    Drivers64UEFI > EmuVariableUefi-64, OsxAptioFixDrv-64, PartitionDxe-64

    Once you are done, you will find a disk labelled EFI belongs to the USB (the hidden one now visible). Open that,

    EFI > EFI > Clover, and using any plist editor (PlistEdit Pro is prefect) or CloverConfigurator app, edit config.plist

    with the following and save the file before closing it:

    ACPI > DSDT > Fixes > Remove All

    ACPI > DSDT > DropTables > Remove All

    ACPI > SSDT > Generate > CStates > false

    ACPI > SSDT > Generate > PStates > false

    Boot > Arguments > -v dart=0 darkwake=0 nv_disable=1 kext-dev-mode=1

    Devices > FakeID > IntelGFX > 0x0

    Graphics > Inject > Intel > true

    Graphics > ig-platform-id > 0x0a260006 (you can try others)

    SMBIOS > (set it to MacBookPro11,2)

    Replace VBoxHFS.efi with downloaded HFSPlus.efi in the folder Drivers64UEFI.

    Copy the two kexts downloaded (FakeSMC.kext and VoodooPS2Controller.kext) into Kexts > 10.10 (or into

    Kexts > other).

    Now the USB installer is ready for prime time.

  • 5. Installing OS X Yosemite

    In this section we shall use the USB to install OS X Yosemite but first lets edit couple of settings in BIOS.

    Shutdown the computer and press the novo key (on the right) and select to enter BIOS. From there, disable

    discrete graphics card (Nvidia) and disable secured booting. Exit saving changes and press F12 once Lenovo logo

    appears.

    Select the USB from the Boot menu that will appear.

    Clover will load in seconds, select Boot from Yosemite Installer and hit enter.

    In a minute or two the installer will be ready. Format the partition prepared earlier as Mac OS Extended

    (Journaled) and install OS X Yosemite. The computer will restart after installation is finished.

    Boot again from the USB and this time select to boot from Yosemite entry.

    The installed Yosemite will run and you should have touchpad and keyboard working. Use them to finish the

    first time initialisation and creating the account.

    Install Clover almost the same why you did while creating the USB installer but with small changes to be

    made:

    Tick Install all RC scripts on target volume.

    Tick Install Clover Preference Pane.

    Also edit config.plist to reflect these:

    Boot > Arguments > slide=0 dart=0 darkwake=0 nv_disable=1 -gux_defer_usb2 kext-dev-mode=1

    Devices > FakeID > IntelGFX > 0x04128086

    SMBIOS > (set it to iMac14,2)

    Restart and boot from USB, select Clover Boot Options, and choose Add Clover boot options for all

    entries.

    Restart without USB and Clover will boot off the EFI partition and you can boot straight into Yosemite.

    6. Post Installation

    Once logged in, you will have a working system with full resolution 1920x1080 but with glitches and only 7MB

    (check Apple-Menu > About This Mac) which makes the experience awful. Also no Sound, no Wi-Fi, no Brightness

    Control, no Battery Management, no Sleep, and more.

    Follow these steps to fix most of the issues and have a better working system.

    6.1 Graphics

    First of all, you should read this thread carefully to get the updated information. Apple removed support for Intel

    Mobile HD4600 and to make it work we have to fake OS X to pretend it is another graphics card and this can

    be achieved in several ways. The most recent and clean method to use is OS-X-Fake-PCI-ID by RehabMan and this

    will be the only method covered here. The steps to use it are:

    Download and uncompress OS-X-Fake-PCI-ID

    Install FakePCIID.kext, FakePCIID_HD4600_HD4400.kext, and FakePCIID_Intel_HDMI_Audio.kext in

    /System/Library/Extensions or Clover kexts.

    Edit Clover's config.plist to contain the [optional] patches shown below as needed. The first is to fix few

    glitches that may appear if you are using ig-platform-id = 0x0a260006 and the other two to fix Boot Second

    Stage glitch (select the patches matching your OS X version only).

    Now we need to use DPCIManager app to fix permissions and clear cache, and boot Clover without caches.

    We should see the graphics are fine and second boot stage should be fixed (if optional patches are used).

    Comment

    0x0a260006 9MB cursor bytes patch

    Find

    0600260a01030303000000020000300100006000

    Name

    AppleIntelFramebufferAzul

    Replace

    0600260a01030303000000020000300100009000

  • This is for OS X 10.10.2 only:

    Comment

    Boot graphics glitch, 10.10.2 (1 of 2)

    Name

    IOGraphicsFamily

    Find

    QYjE6xE=

    Replace

    QYjE6zE=

    Comment

    Boot graphics glitch, 10.10.2 (2 of 2)

    Name

    IOGraphicsFamily

    Find

    hcB0a0g=

    Replace

    McB0W0g=

    This is for OS X 10.10.0 and 10.10.1 only:

    Comment

    Boot graphics glitch, 10.10.0 and 10.10.1 (1 of 2)

    Find

  • hcB0XUg=

    Name

    IOGraphicsFamily

    Replace

    McB0W0g=

    Comment

    Boot graphics glitch, 10.10.0 and 10.10.1 (2 of 2)

    Find

    QYjE6wM=

    Name

    IOGraphicsFamily

    Replace

    QYjE6yM=

    6.2 Sound

    Ill take the easy route using VoodooHDA. Simply download the latest package and install it on the system.

    Something just needs to be patched in VoodooHDA.kext in order to allow auto switch when headphone is plugged

    in or out. To do that, grab a copy (or better move) VoodooHDA.kext from /S/L/E into EFI > Clover > Kexts >

    10.10 (or in folder other if you use that). Right click the kext and select Show Package Contents > Contents, open

    the file Info.plist with PlistEdit Pro, and head to the section IOKitPersonalities > VoodooHDA > NodesToPatch. Add

    this to the section and save the file:

  • Codec

    0

    Config

    0x0421101f

    Node

    33

    As usual, use Kext Wizard app to fix permissions and clear cache, and boot Clover without caches. This will fix the

    sound and nothing else to do.

    6.3 Wi-Fi

    The built-in Wi-Fi card in Lenovo Y510P wont work with OS X and I had to replace mine with Broadcom BCM4352

    AC WLAN BT4.0 Wi-Fi card that is compatible with Y510P and OS X. Two patches for AirPortBrcm4360.kext (inside

    IO80211Family.kext > Contents > PlugIns) are required to get this card fully working: patch to identify it as

    Airport Extreme and patch to enable AC (5GHz). Before we proceed, copy IO80211Family.kext from /S/L/E into

    EFI/Clover/Kexts/10.10 and we will edit this copy and leave the one in /S/L/E untouched.

    6.3.1 Broadcom Airport Extreme

    Open IO80211Family.kext/Contents/PlugIns/AirPortBrcm4360.kext/Contents/Info.plist with PlistEdit Pro.

    Navigate to: IOKitPersonalities > Broadcom 802.11 PCI > IONameMatch

    Get the card VendorID and DeviceID using DPCIManager and use them to add new entry to IONameMatch

    array :

    pci14e4,43b1

    (note: these are the for my card and yours may be different).

    Save the file and close it.

    6.3.2 Enable AC (5GHz)

    Open Terminal and change directory to EFI/Clover/kexts/10.10

    Paste this command (replacing the patch code if changed):

    sudo perl -pi -e 's|\x58\x54\x00\x2B\x18\x2C\x21\x00\x20|\x58\x54\x08\x0A\x36\x1C\x47\x00\x0A|g'

    IO80211Family.kext/Contents/PlugIns/AirPortBrcm4360.kext/Contents/MacOS/AirPortBrcm4360

    Close the Terminal.

  • Note: the bits are changed for 10.10.2 to be:

    Find : 58 54 00 5D 19 54 21 00 00

    Replace: 55 53 1A 04 19 2B 21 00 00

    So the command would be:

    sudo perl -pi -e 's|\x58\x54\x00\x5D\x19\x54\x21\x00\x00|\x55\x53\x1A\x04\x19\x2B\x21\x00\x00|g'

    IO80211Family.kext/Contents/PlugIns/AirPortBrcm4360.kext/Contents/MacOS/AirPortBrcm4360

    As usual, use Kext Wizard app to fix permissions and clear cache, and boot Clover without caches.

    6.4 Bluetooth

    Broadcom BCM4352 AC WLAN BT4.0, my card, has Bluetooth but its not detected by OS X. I found Bluetooth-

    Firmware-Uploader is an easy yet powerful method to get Bluetooth working perfectly in OS X. Simply put

    BTFirmwareUploader.kext in Clovers kexts folder and reboot. Although this works, it is against the

    instructions by the author of this kext as he suggests to install it in /S/L/E instead.

    6.5 Proper CPU Power Management

    This is important as it affects many aspects of the system specially sleep. To get proper CPUPM download the

    latest version of ssdtPRGen.sh, open terminal and change directory to script location, and run the script this way:

    ./ssdtPRGen.sh -c 2 -f 2400 -l 8 -p 'i7-4700MQ' -turbo 3400 -t 47

    The script will produce a SSDT (Secondary System Description Table) that can be used from Clover. To do that,

    put the resulting ssdt.aml into EFI/Clover/ACPI/patched among other patched tables and set ACPI > SSDT >

    DropOEM to turn in EFI/Clover/config.plist.

    6.6 Sleep

    At this moment the system might not sleep for many reasons like problems with USB, Network interrupting sleep,

    and not having AppleLPC.kext loaded on startup. Ill try to cover all these for perfect sleep but this will involve

    DSDT patches so you should be familiar with the process. You have to know how to use MaciASL, extract native

    ACPI tables (from Linux), disassemble tables using iasl, and fix common problems while patching.

    The Laptop Patch Repository by Rehabman is a must have with MaciASL. Add it and it wont harm to add

    his Debugging Patch Repository too.

    6.6.1 AppleLPC.kext is not loading

    This kext is essential for sleeping. To test if it is loaded or not fire off Terminal and issue the command kextstat

    then look for com.apple.driver.AppleLPC in the output. If it is there then the kext is loaded and nothing to do in

    this section. If not, edit your DSDT in MaciASL and patch it with Haswell-LPC. Reboot and use kextstat again to

    confirm AppleLPC.kext is loaded fine.

    6.6.2 Fix EHC1/EHC2 Kernel Assertions

    You can test if there are problems prevents sleep using the command pmset -g assertions. If you got anything

    with EHC1 or EHC2 then it probably USB related problem and you might need to patch the DSDT with 7-

    series/8-series usb and/or SMBUS Fix. You may also need to put GenericUSBXHCI.kext in Clovers kexts

    folder and add the boot argument -gux_defer_usb2 to config.plist.

    6.6.3 Fix EHC1/EHC2/XHC Auto Wake

    If you got OS X to sleep but found it to wake immediately then look for wake reason in system.log using Console

  • app. If the reason is found related to either EHC1, EHC2, or XHC then the easy fix is to delete/comment the code

    related to powering on/off to these devices from DSDT which is the method _PRW for each of them.

    6.7 Brightness

    Getting brightness to work perfectly is a process of several steps that Ill cover in order of importance:

    6.7.1 Patching DSDT or SSDT

    Either DSDT or one of the SSDTs (whichever contains IGPU definition) have to be patched with "Brightness fix

    (Haswel)" from Rehabman Laptop Repository. Doing this correctly will result in having the brightness slider

    visible in System Preferences > Displays.

    6.7.2 ACPIBacklight.kext

    This is a must have kext that gets the job done assuming DSDT/SSDT is already patched. With this kext the

    brightness slider will function normally.

    6.8 Battery Management

    This one is important but easy to fix, just download the latest version of ACPIBatteryManager.kext and put it in

    Clovers kexts folder, reboot.

    6.9 Keyboard

    Here we customise our OS X keyboard to enhance our experience by using custom keyboard layouts, fixing

    functionality of some keys, and changing shortcuts. I thought to make / change some shortcuts and remap some

    keys for easier manipulation. Since I'm using Windows on the same machine, it is more convenient to have as

    much consistent keyboard actions. Here we will use OS X System Preferences to manage shortcuts, third-party

    key-remapping software, and / or custom KeyBinding dictionaries. Nothing here is necessary and all steps are

    optional.

    6.9.1 Custom Keyboard Layouts

    Since my Y510P came with UK keyboard I used British - PC layout but some keys are not working as intended. I

    used Ukelele to create the layouts to match my keyboard for Arabic and English UK and all what remains is to copy

    them (with their accompanying .icns) to /Library/KeyboardLayouts then select them in System Preferences. Some

    people prefer to put the keyboard layout files in ~/Library/KeyboardLayouts but this causes a problem while typing password in

    dialog boxes so the best way is to put them for system wide access. Theres another catch though, since Im not using any system layout and only

    custom layouts I have to remove the system (default) one from the list. OS X doesnt allow this so we have to hack to do it:

    Change the current input source to your custom keyboard layout.

    Open ~/Library/Preferences/com.apple.HIToolbox.plist with PlistEdit Pro.

    Remove the input source or input sources you want to disable from the AppleEnabledInputSources

    dictionary. If there is an AppleDefaultAsciiInputSource key, remove it.

    Restart.

    6.9.2 Managing Shortcuts from System Preferences

    This is (almost) easy to do but certain shortcuts can be tricky. First, let's swap Option (Alt) and Command (Win)

    keys because Command is the main key for OS X and I want it to be on the main key for Windows keyboard. To

    do this:

    1. Open System Preferences

    2. Select Keyboard

    3. Click Modifier Keys...

    4. Set Option to be Command and Command to be Option

    5. Click OK

    Next, I want to make changes so F11 shows all applications windows, F12 opens Mission Control, F10 show

    spotlight, F9 opens System Preferences, and others. This change is not necessary but will make use of the logos

    printed on some F keys. To do this:

    1. Open System Preferences

  • 2. Select Keyboard

    3. Select Shortcuts tab

    4. Select Mission Control from the left side

    5. On the right side activate (check) and set the following:

    1. Mission Control: F12

    2. Show Notification Center: F4

    3. Application windows: F11

    4. Show Desktop: F7

    5. Show Dashboard: F8

    6. Select Spotlight from the left side

    7. On the right side activate (check) and set Show Spotlight search: F10

    8. Select App Shortcuts from the left side

    9. On the right side click the (+) button and set the following in the new dialog:

    1. Application: All Applications

    2. Menu Title: System Preferences (the three dots are a MUST)

    3. Keyboard Shortcut: F9

    4. Click Add

    6.9.3 Fixing Home and End Keys using KeyBindings [Deprecated]

    Spoiler

    This method is deprecated in this guide (while still supported in OS X) because using KeyBindings is limited to a

    few predefined actions and it is not even close to what can be achieved using Karabiner.

    6.9.4 Remapping Keys using Karabiner (third-party software)

    This third-party software is amazing since it allows too many possibilities to customise the keystrokes and mouse

    events in OS X. As I stated earlier, I will try to customise the usability of keyboard shortcuts to resemble shortcuts

    in Windows. Not may would like to do this, specially those who use Macs otherwhere or those who rarely use

    Windows.

    There are two modes to do mappings using Karabiner. The first is to use as much as you need from the predefined

    mappings and the second is to code the mapping you want using an xml file. But first you have to download the

    app and install it of course! Link is in Downloads section.

    6.9.4.1 Using predefined mappings

    Assuming you downloaded and correctly installed Karabiner, activating mappings from predefined set is a no-

    brainer. All you need to do is to click on Karabiner's icon on menu bar then chose Preferences. From there, select

    the mapping you want and tick its check box. I will not list the options I checked because it is down to everyone's

    preference but for example I enabled Ctrl+C, Ctrl+V, Ctrl+X for copy, paste, and cut respectively.

    The most important thing to mention here is how to backup these options so if you installed OS X again you do not

    go through this. Karabiner allows a CLI (Command Line Interface) to manage everything the app can do and even

    more options that are not available on the UI (User Interface) and you can read further here.

    One of these options is the ability to export all the options into one file. To do this, open Terminal, and issue this

    command:

    /Applications/Karabiner.app/Contents/Library/bin/karabiner export > ~/Desktop/karabiner-import.sh

    This will export all the options into a file on the desktop called karabiner-import.sh that can be executed to restore

    the options using this Terminal command:

  • sh ~/Desktop/karabiner-import.sh

    6.9.4.2 Custom mappings using private.xml

    Currently, I only needed two extra mappings not offered in Karabiner preset. The first one is to map the menu key

    (that lies between right Alt and right Ctrl) so its function is to open context menu (right-click menu) as in

    Windows. The other mapping is set Ctrl+Click to select individual items rather than Command+Click (again, as in

    Windows!). Reader is advised to search online on how to achieve different mappings because there are many of

    them ready to use online.

    Once all custom mappings needed are ready, we combine them into one xml file called private.xml with the

    following structure:

    This is the first mapping

    .....

    .....

    This is the second mapping

    .....

    .....

    Karabiner creates an empty file by default which you can access from the app itself (the same apply for your

    custom file thereafter):

    1. Make sure you downloaded and correctly installed Karabiner

    2. Click on its icon on menu bar then chose Preferences.

    3. Select "Misc & Uninstall" tab.

    4. Click on "Open private.xml"

    5. Open the file using any xml editor (any text editor would do as well if kept plain text).

    The file usually saved in the path "~/Library/Application Support/Karabiner/private.xml" and can be loaded using

    Karabiner:

    1. Make sure you downloaded and correctly installed Karabiner.

    2. Click on its icon on menu bar then chose Preferences.

    3. On the "Change Key" tab, hit ReloadXML

    4. Tick the new entries added on top of the list to activate them.

  • As mentioned, I only needed two custom mappings for the moment. The resulting xml file for these two mappings

    can be found in Downloads section.

    6.9.5 Getting Fn+Up and Fn+Down to Control Brightness

    At the moment, you can control the brightness using the slider in System Preferences > Display or using

    Fn+Home and Fn+Insert. To get the default combination for Y510P working we cannot use Karabiner or OS X

    shortcuts as the events are buried deep down. Therefore, the DSDT have to be patched so the event of pressing

    these combinations maps to brightness control. Edit DSDT using MaciASL and patch it with this patch:

    into method label _Q11 replace_content

    begin

    // Brightness Down\n

    Notify(\_SB.PCI0.LPCB.PS2K, 0x0205)\n

    Notify(\_SB.PCI0.LPCB.PS2K, 0x0285)\n

    end;

    into method label _Q12 replace_content

    begin

    // Brightness Up\n

    Notify(\_SB.PCI0.LPCB.PS2K, 0x0206)\n

    Notify(\_SB.PCI0.LPCB.PS2K, 0x0286)\n

    end;

    7. Wrapping up

    Almost everything is working. However, few things are still needed to be fixed:

    There is a small problem related to display sleep/wake (which in turns affect system sleep/wake the same way). Once I wake the display

    from sleep something go wrong with display colours which tends to have gradients like 16-bit colours and for some unknown reason the

    system is not able to restart at this time. This might be related to ig-platform-id since desktop values for this doesnt result in the same

    issue. Which encourage me to think we may need another patch to AppleIntelFramebufferAzul.kext but Im not sure.

    Sleep/Wake on Lid Close/Open.

    Waking system from sleep normally goes to log-in screen where there is a button to Cancel which should return it to sleep again but it

    does not.

    While CapsLK is ON, pressing Shift+any letter should result in lower case letter. Instead, the upper is printed but this may be related to

    my custom keyboard layout.

    Using the custom keyboard layout for other language than English resulted in losing the shortcuts combinations that involves special

    keys. For example, in my English custom keyboard layout I can press Alt+C to copy it doesn't work if I switched to my Arabic custom

    keyboard layout. [FIXED]

    Downloads

    This section contains all links to all the downloads required to get the best installation for Lenovo Y510p so far.

    Spoiler

  • Appendix

    Here I list some of the things I had to do to fix few problems I faced on my journey maybe they would help

    somebody.

    1. Fix for [unexpected '}', expecting (] and [unexpected PARSEOP_IF] Errors in DSDT

    Sometime these type of errors show up while patching DSDT. To fix them, simple apply this patch:

    into_all method code_regex If\s\(CondRefOf\s\(\\_SB\.PCI0\..*.PS\dX\)\)[^\}]*\} remove_matched;

    into method label ADBG replace_content begin // nothing end;

    2. Fix AppStore error [your device or computer could not be verified. contact support for assistance]

    This error usually happens when Ethernet isnt defined as BuiltIn at en0 while SMBIOS is for Mac with Ethernet

    port. If Ethernet is defined as Built-in but not at en0 it could be easy, simply issue this command and restart:

    sudo rm /Library/Preferences/SystemConfiguration/NetworkInterfaces.plist

    Credits

    To be Added !

    Final Words

    I hope this helps somebody out there to fix a problem or more on his Y510p hackintosh. If anyone thinks he can

    do something in a better way it would be awesome to share thoughts.