Contribute
Register

[Guide] Lenovo ThinkPad X240

Status
Not open for further replies.

Sniki

Moderator
Joined
Jan 5, 2016
Messages
2,313
Motherboard
HP Elite 8300 SFF
CPU
i7-3770
Graphics
Intel HD 3000 | GTX 1650 LP
Mac
  1. MacBook Pro
Mobile Phone
  1. iOS
High Sierra.png

Overview

Welcome to my Lenovo Thinkpad X240 guide, this guide is based on the latest macOS High Sierra.
for the macOS Sierra guide, you can click the link down below to go to my Lenovo Thinkpad X240 macOS Sierra guide:
https://www.tonymacx86.com/threads/guide-lenovo-thinkpad-x240.245583/
This laptop is a solid Hackintosh machine since it offers almost 100% real MacBook Experience & Functionality.
The entire guide is based on Hotpatch ACPI patching method via UEFI Clover and @RehabMan fork of Clover Bootloader.

Note: i don't own a Lenovo Thinkpad X240 laptop, the entire guide is build based on X240 users that requested help on my existing guides for other Thinkpad laptops & tonymacx86 forums.
Lenovo Thinkpad laptops are similar on hardware with each other but on ACPI structure, they have small enough differences that require a whole different guide for the other model.
(specific example is Lenovo Thinkpad T440 ; Lenovo Thinkpad T440P ; Lenovo Thinkpad T440S)
Although they are very similar, i needed to create specific guide & files for each other so everyone can have a working one.

My laptop Specs (Lenovo Thinkpad L440)
Intel HM86 Series Chipset.
Intel Core i7 4700MQ 2.4GHz (Turbo Boost up to 3.4GHz).
Intel HD4600 Integrated Graphics.
8GB Ram (DDR3) clocked at 1600MHz
Realtek ALC3232 Audio Codec
FHD IPS Display Panel "B140HAN01.3" (Upgraded, OEM was 1366x768 LCD)
DW1560 Wireless/Bluetooth Card "BCM94352Z" (Upgraded, OEM was Intel AC7260)
Lenovo Thinkpad T460 Touchpad with "Physical Buttons" (Upgraded, OEM was flat surfaced)

Upgrades
BCM94352Z Wireless / Bluetooth Card:
https://www.aliexpress.com/item/BCM...32487923741.html?spm=2114.13010608.0.0.CuOUjG

Thinkpad T460/T560 Trackpad:
https://www.aliexpress.com/item/For...32427424309.html?spm=2114.13010608.0.0.k2vYwc


Lenovo ThinkPad X240 Guide

What doesn't work / Partially works
As far as reported from X240 users, everything else is working fine except of these issues that i listed down below:

D-SUB/VGA Port
Might be able to make it work, so far haven't seen a HD4200/4400/4600 available patch for it, also something that i didn't have time to experiment with, might attempt a fix/patch when i get some time to play with it, but not important for me at all.

TrackPoint
The Trackpoint does work very well with the Tluck fork of VoodooPS2Controller.kext since it has support for it, but there's a rare issue where the trackpoint doesn't work on some cold boots, a restart or two should fix it.
Will check Synpatics documentation when i get time for it to see if i can fix it or propably will be fixed by an update from Tluck.

PCI Card Reader
There is a development going on for PCI Card Readers on Insanelymac forums from Sinetek, there's a working kext which works decently, except that it has an issue where if laptop sleeps, the kext stops working and the Card Reader doesn't work anymore,
a restart of the laptop should fix it and avoiding letting it sleep.

For more information follow the development thread below, i will update the attached kext & guide if a change happens.
http://www.insanelymac.com/forum/topic/321080-sineteks-driver-for-realtek-rtsx-sdhc-card-readers/


Precautions
These laptops have the so called WHITELIST which restricts using another Wireless/Bluetooth Card, in order to install supported Wireless / Bluetooth Card you are required to do a BIOS Mod in order to bypass that.

Whitelist Removal
In order to remove whitelist you will need to buy these tools which they are really cheap, also you are required to disassemble your laptop so you can reach the EEPROM chip for Bios Dump ; Sent Patch Request ; Erase ; Write new Modded Bios

Tools required:
  • CH341a Flash Programmer
  • SOIC8 Test Clip
After you received the tools, assuming you disassembled your laptop you have to Dump your current Bios which you should do a backup of it just in case something goes wrong, you can revert it back to normal.
You zip the Bios Dump and sent to the forum: https://www.bios-mods.com
Specifically for more details go to: https://www.bios-mods.com/forum/Thread-Guide-Whitelist-remove-for-2014-Lenovo-thinkpad

You should request for:
  • Whitelist Removal
  • Unlock Advanced Menu
For me someone Answered in 30min with a BIOS Mod, after you receive the mod Erase the EEPROM and Write the New Bios Mod
Install new Wireless Card and you are done !

BIOS
  • Disable Security Chip
  • Disable Anti Theft Module
  • Disable TPM

All of these settings if left enabled will cause problems with the macOS and especially with sleep, in order to have a fully functional setup you are required to disable those settings in BIOS.


Special note regarding Clover Bootloader
Recently RehabMan added his own fork of Clover Bootloader into his Github, which does include a lot of ACPI Patching changes / fixes / added features that makes hotpatching ACPI much more easier.
In result: Rehabman Fork of Clover bootloader is recommended by default now, if you want to use this guide and the files on my guide you have to use his Clover Bootloader.

Link to his Fork of Clover Bootloader:
https://github.com/RehabMan/Clover

Link to his Prebuilt Clover Installer:
https://bitbucket.org/RehabMan/clover/downloads/


Creating USB Installer
Everything is covered at Rehabman guide on how to create a USB Installer, go read his guide first then come back here to continue with the creation of USB Installer. Link to his guide:
https://www.tonymacx86.com/threads/guide-booting-the-os-x-installer-on-laptops-with-clover.148093/

  • Download latest MacOS High Sierra from AppStore
  • Download Latest Clover Bootloader
  • Create Installer USB

Clover Bootloader installer options to choose:
  • Install for UEFI Booting Only
  • Install Clover in ESP
  • Drivers64UEFI > OsxAptioFixDrv-64

Into EFI/Clover/kexts/Other add these kexts since they will be mandatory for macOS Installation:


Post Installation
After you reached desktop, now it's time to install Clover Bootloader into HDD/SSD, Install with Clover with same settings as above, now its time add files into their correct locations and proceed with finalizing the laptop.

Install kexts into HDD/SSD (use your favorite kext installer,i personally use Terminal like described below)
Install into "System/Library/Extensions" or "Library/Extensions" , the choice is yours.
For me i install into /Library/Extensions as Apple recommends it.
Copy all the kext into a folder on desktop name like "kext"
Open Terminal
Code:
cd desktop/kext
sudo cp -R *.kext /Library/Extensions/
With this command all the kexts will be installed into Library/Extensions.

List of the kexts:
  • FakeSMC.kext + ACPIsensors.kext + LPCsensors.kext + CPUsensors.kext.
  • VoodooPS2Contoller.kext (Tluck fork kext attached since it does support TrackPoint).
  • IntelMausiEthernet.kext
  • ACPIBatteryManager.kext
  • FakePCIID.kext + FakePCIID_Intel_HD_Graphics.kext + FakePCIID_HDMI_Audio.kext + FakePCIID_Broadcom_WIFI.kext
  • (Broadcom_Wifi.kext only if you have replaced Intel Wireless / Bluetooth card with the supported DW1560 BCM94352Z)
  • IntelGraphicsFixUp.kext + Shiki.kext + Lilu.kext
  • USBInjectAll.kext
  • BrcmPatchRam2.kext + BrcmFirmwareRepo.kext (for Bluetooth if you have compatible card installed)
  • AppleBacklightInjector.kext (Built from Rehabman - Attached at the end of the guide)
  • CodecCommander.kext
  • ALC3232.kext (attached at the end of the guide)
  • Sinetek-rtsx.kext (Card Reader kext - attached at the end of the guide)
  • AirPortBrcmFixUp.kext (if you live outside of US and have trouble with 5GHz Connections & slow speeds).

Rebuild Caches with:
Code:
sudo kextcache -i /
All the other kexts listed that are not attached can be found at @RehabMan Github:
https://github.com/RehabMan?tab=repositories


Hotpatching ACPI
For ACPI patching we use the Hotpatch method which is a newer way of patching and the future for hackintosh.
- Its more generic (can use same patch on same laptop model, while static requires to patch your own).
- More Update Proof (both software & hardware), etc
I attached the ACPI Folder into the guide which contains all SSDTs that have patches/fix for everything to work correctly.

Copy Include folder into desktop, open terminal and into the terminal window enter the command(s):
Code:
cd desktop/include
then
Code:
iasl SSDT-X240.dsl
This will create the finalized "assembled" SSDT-X240.aml which you should copy it into HDD/SSD EFI/Clover/ACPI/Patched

I also attached a prebuilt SSDT-X240.aml for you that don't need any change and if you follow/install everything as explained here from this guide.

For a better understanding read the guide:
https://www.tonymacx86.com/threads/guide-using-clover-to-hotpatch-acpi.200137/


Setup config.plist according to your Laptop
Now copy my config.plist into "EFI/Clover/" of your HDD/SSD Partition which does have everything already setup, except that you have to choose the patch according to your laptop at Kernel & Kext Patches section:
For example:
  • If you have standard Bios and have standard 32/64 DVMT-prealloc then the patch is enabled by default on config.plist
  • If you have set 128MB DVMT-prealloc in Bios then that patch is already present but you will have to enable it manually, while disabling the 9mb cursor patch.


Generate your own SMBIOS data for iMessage & FaceTime
Every device does have it's unique ID's and it's manadatory to create your Unique ID's before accessing Apple Services.
For more details i will add the links to the two respective guides from @jaymonkey & @P1LGRIM for iMessage

P1LGRIM -An idiot's guide to iMessage:
https://www.tonymacx86.com/threads/an-idiots-guide-to-imessage.196827/

JayMonkey - How to Fix iMessage:
https://www.tonymacx86.com/threads/how-to-fix-imessage.110471/


Audio
For audio i created a audio injector "ALC3232.kext" which i patched on my own from my CodecDump from Ubuntu.
Audio is implement via SSDT-HDEF & SSDT-HDAU + config.plist = Kernel and Kext Patches
In my guide we will use LayoutID28 which is already injected on SSDT-HDEF & SSDT-HDAU - (for MiniDP Audio)
This kext should work for all the other Thinkpad Laptops that do have ALC3232 (ALC292) Audio Codec.
For this codec, it's required to use ALCplugFix in order to fix External Mic "Line-In".
What it does, it does automatically detect when you plug in headphones and does switch to the required verb for it.
I also built a CustomSSDT for CodecCommander "SSDT-ALC3232" which is required for fixing issues after wake from sleep.
Audio is 100% working, All Inputs,Outputs & Even after wake from sleep.
  • Speakers
  • Internal Mic
  • Headphones
  • External Mic (Line-In) "even with headsets that have built in mic like EarPods etc without any issue.

Audio Installation
  • We install "ALC3232.kext" which will be installed with all other kexts mentioned above in the kext section of the guide.
  • Copy alc_fix folder into desktop and open terminal and enter:
Code:
cd desktop/alc_fix

  • After you entered the command, open the alc_fix folder on desktop and drag the install.sh and drop in terminal window and then press enter, it will install alc_fix into his proper location.
  • SSDT-ALC3232: is the Custom Codec Commander Profile for ALC3232 which contains configuration for the codec, which get's installed / assembled into the SSDT-X240.aml (already available on the pre-built SSDT-X240.aml) so no need for it.
Audio installation done !


Keyboard
Keyboard is fully mapped and all buttons are working including Brightness keys and Rest of the Keyboard & FN Buttons.
All other Fn Buttons do work, you just have to assign them as shortcuts on Sysprefs > Keyboard > Shortcuts like:
  • F4 (Mic On/Off) i mapped this one to Siri shortcut
  • F7 (Projector) i mapped this one to Video/Mirror Toggle
  • F8 (Radio On/Off) i mapped this one to Notification Center
  • F9 (Settings) i mapped this one as System Preferences
  • F10 (Cortana/Search) i mapped this one to Spotlight Search
  • F11 (Open Apps/AltTab) i mapped this one to Mission Control
  • F12 (Start Menu) i mapped this one to Launchpad
To see whats going on and how they are implemented you can have a look at SSDT-KBD attached on ACPI folder.


Touchpad/TrackPad/TrackPoint
The TrackPad does work very well with the Tluck fork of VoodooPS2Controller.kext which i attached at the end of the guide.
It also includes support for TrackPoint and Physical Buttons like Left,Middle & Right Click Buttons.
Also 3 fingers scrolling is supported which is excellent as i use these to switch left and right into desktops with mission control.
These gestures are assignable via SysPrefs > Keyboard > Shortcuts > Mission Control.
i Personally have customized these gestures like this on my laptop:
  • 3 fingers swipe up for "Application Windows"
  • 3 fingers swipe down for "Show Desktop"
  • 3 fingers swipe right for "Move left a space" (to move to the desktop on the left side)
  • 3 fingers swipe left for "Move right a space" (to move to the desktop on the right side).

Wireless & Bluetooth
Wireless & Bluetooth won't work unless you replace your Wireless/Bluetooth card with a compatible one:
As this laptop does use NGFF card you may want to look for :
"DW1560 BCM94352Z" or "BCM943602BAED" which has native IDs but requires installation of 1 extra antenna.

Wireless will work with the installation of only these two kexts: FakePCIID.kext & FakePCIID_Broadcom_WiFi.kext
Bluetooth will work with the installation of : BrcmFirmwareRepo.kext & BrcmPatchRam2.kext.

If you live outside of US, you may want to use the Country Code Patch as it adds some bands that are not available on US.
There was a working config.plist /Kernel and Kext Patches - Patch for Country Code #a but it seems it's not working on 10.13.3.
So the solution for this is to install AirportBrcmFixUp.kext which can be downloaded at:
https://sourceforge.net/projects/airportbrcmfixup/

After installation of the kext you might need to add these kernel flags in order to enable it & add the corresponding country code:
"-brcmfx-country=#a" (you can find the other country codes on the description of the kext from the link above).
"-brcmfxbeta"
"-lilubeta"

Note: it seems that on macOS High Sierra the features like Universal Clipboard & HandOff are not working very well/not stable.
for example Universal Clipboard works when i copy something on hackintosh and paste it on my iPhone 7 Plus.
While when i copy on iPhone 7 Plus and right click to paste it on Hackintosh the paste option is not available everytime/rarely.
On macOS Sierra these features work much better, so maybe a future macOS High Sierra update might fix it or new kext/patch.
If you have slow speeds after wake from sleep go to SysPrefs>EnergySaver>Power Adapter: uncheck "Wake for Network Access"


Rest of the "Important" fixes/patches
  • Power Management
  • Battery Status
  • Dual Battery Support
  • LED Blink after wake from Sleep
  • USB Ports
  • MiniDP Port & MiniDP Audio
  • Brightness/Backlight
  • Including the others that i forgot to list "etc".
Are all fixed/patched & prebuilt on config.plist & Hotpatch SSDTs which are assembled on a single SSDT-X240.aml SSDT.


Customization
A fully working hackintosh laptop also requires to have his Full real look in the system for eye satisfaction.

SystemLogo
For that i created 3 Lenovo Thinkpad 440 Series SystemLogo's for About This Mac section for 3 recent MacOS Versions.
  • Lenovo Thinkpad 440 Series Laptop Logo with El Capitan Wallpaper into the Display
  • Lenovo Thinkpad 440 Series Logo with Sierra Wallpaper into the Display
  • Lenovo Thinkpad 440 Series Logo with High Sierra Wallpaper into the Display

Same logo as the one on the top of the guide but different display wallpaper which reflects each version of MacOS.

Installation:
  • Rename HighSierra.tiff logo to "SystemLogo.tiff
  • Copy it and go to Applications/Utilities/System Information/ right click on it and click on "show package contents"
  • go to /Contents/Resources and paste the new logo there, Replace with the existing one, Enjoy your X240 Logo on “About this mac” !

Laptop/PC Name & Model /CPU Name/Model/Frequency/Displays/ETC
All of these customizations are covered on this page:
http://www.idownloadblog.com/2017/01/13/how-to-modify-about-this-mac-hackintosh/



Problem Reporting
(Before posting any Problem you must read this and provide all the files request in this post of @RehabMan as he described.)

It is impossible to diagnose a problem without data that shows how your system is configured.

Also, impossible to analyze any data that you might provide without a clear understanding of your hardware. So make sure your profile is filled as per the first question in this FAQ, "Q. Where do I start?".

If you can't boot, a bare minimum is:
- Boot verbose, attach photo
- Attach EFI/Clover folder as ZIP (press F2 then F4 at main Clover screen before collecting). Please eliminate 'themes' directory. Provide only EFI/Clover, not the entire EFI folder.

Note: Some laptops swap Fn+Fx for Fx. For those laptops, press Fn+F2 then Fn+F4. If you're not sure, press F2, then F4, then Fn+F2, then Fn+F4. You can also verify by pressing F1 (or Fn+F1) to see which one brings the menu.

If you can boot, but are having some other problem, describe the problem clearly and provide data...

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.

Attach contents of Downloads/RehabMan directory as ZIP.

Attach ioreg as ZIP: 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.

Provide output (in Terminal):
Code (Text):

kextstat|grep -y acpiplat
kextstat|grep -y appleintelcpu
kextstat|grep -y applelpc
kextstat|grep -y applehda

Attach EFI/Clover folder as ZIP (press F2 then F4 at main Clover screen before collecting). Please eliminate 'themes' directory. Provide only EFI/Clover, not the entire EFI folder.

Note: Some laptops swap Fn+Fx for Fx. For those laptops, press Fn+F2 then Fn+F4. If you're not sure, press F2, then F4, then Fn+F2, then Fn+F4. You can also verify by pressing F1 (or Fn+F1) to see which one brings the menu.

Attach output of (in Terminal):
Code (Text):

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

Compress all files as ZIP. Do not use external links. Attach all files using site attachments only.


Automatic script to Generate Problem Reporting files
Black.Dragon74 created a script to automatically collect all the problem reporting files which does also automatically Mask serial number;UUID;MLB & ROM
Link to the script:
https://www.tonymacx86.com/threads/tool-generate-proper-problem-reporting-files.235953/

Credits
@RehabMan Everything, making it possible for us to use macOS on laptops like on real MacBooks.
@mnmmnm for testing & feedback
 

Attachments

  • config.plist
    15.4 KB · Views: 1,027
  • SSDT-X240.aml
    8.9 KB · Views: 797
  • hotpatch.zip
    19.3 KB · Views: 639
  • include.zip
    19.5 KB · Views: 602
  • ALC3232.kext.zip
    10.4 KB · Views: 630
  • alc_fix.zip
    11.5 KB · Views: 609
  • (TLUCK)VoodooPS2Controller.kext.zip
    88.6 KB · Views: 615
  • AppleBacklightInjector.kext.zip
    2.8 KB · Views: 506
  • Card Reader.zip
    39.1 KB · Views: 566
  • SystemLogo.zip
    876.4 KB · Views: 502
  • ThinkPad Theme for Clover.zip
    1 MB · Views: 527
Last edited:
Hello Sniki. I have followed your instructions, everything works fine, only the usb port is not getting the external device. Only usb port of the touchpad only. Thanks to you for helping me with this manual. Thank you.
 
to send your clover file, do you see help. Thank you
 

Attachments

  • Clover-LENOVO-X240.zip
    9.4 MB · Views: 520
Hello,

Thanks for this guide, i follow the guide but i'm blocked on this step

"iasl SSDT-X240.dsl" on folder include "command not found any idea ?
 
Thanks All Works correctly now the SSD-X240.Aml generate copy to efi partition on EFI/Clover/ACPI/Patched i reboot nice :) but the keyboard Mapp not works it is necessary to copy other *.dsl and otherfile include folder to EFI partition ?
if so which folder EFI Partition ?
 
And i have a new probleme for trackpad/touch pad, i have a original x240 touchpad but the right click not work and a touch for click not work i have installed a kext
(TLUCK)VoodooPS2Controller.kext.zip attached on thread a fix exist ?
 
Thanks All Works correctly now the SSD-X240.Aml generate copy to efi partition on EFI/Clover/ACPI/Patched i reboot nice :) but the keyboard Mapp not works it is necessary to copy other *.dsl and otherfile include folder to EFI partition ?
if so which folder EFI Partition ?

What do you mean by "keyboard Mapp not works"?

And i have a new probleme for trackpad/touch pad, i have a original x240 touchpad but the right click not work and a touch for click not work i have installed a kext
(TLUCK)VoodooPS2Controller.kext.zip attached on thread a fix exist ?

No "Problem Reporting" files attached.
Read FAQ, "Problem Reporting" again. Carefully. Attach all requested files/output.
https://www.tonymacx86.com/threads/faq-read-first-laptop-frequent-questions.164990/
Use the gen_debug.sh tool mentioned in the FAQ, that way it is less likely you'll omit something.
 
thank you, my enabled usb 3.0 in bios, now usb port active, support all devices outside. every features as the top topic on the good activities.
 
And i have a new probleme for trackpad/touch pad, i have a original x240 touchpad but the right click not work and a touch for click not work i have installed a kext
(TLUCK)VoodooPS2Controller.kext.zip attached on thread a fix exist ?
you can try clover of me, every good performance.
remember to follow the top of the top tutorial
 

Attachments

  • CLOVER X240 ok.zip
    6.8 MB · Views: 558
Status
Not open for further replies.
Back
Top