midi1996 / X2G2-opencore-hackintosh

OpenCore guide and resources for HP Elite X2 1012 G2 tablet.
22 stars 3 forks source link
macos opencore-guide tablet

X2 1012 G2 macOS install with OpenCore

Intro

I've been able to install macOS on the HP Elite X2 1012 G2 through OpenCore. This guide will go through the setup on how to get it working but will not include any files other than ACPI and parts of the config, you will have to do the work youself.


Disclaimer

THIS GUIDE IS PROVIDED TO YOU FOR EDUCATIONAL PURPOSES. I AND ANYONE MENTIONED DIRECTLY OR INDIRECTLY IN THIS GUIDE WILL NOT BE HELD RESPONSIBLE FOR ANY HARM OR LOSS. BY FOLLOWING THIS GUIDE YOU AGREE TO TAKE FULL RESPONSIBILITY FOR ANYTHING THAT COMES OUT FROM THIS GUIDE.


Table of Content


My Hardware

What's working

Thankfully with OpenCore a lot of things got smoothed out and works just as you would expect:

What's not working

What's working badly/did not test

Things I'm trying to fix atm and need help with


Installing macOS

Preparing your computer

Before installing macOS, you'll have to prepare your computer.

  1. ⚠️ BACKUP EVERYTHING, I will not take responsibility of anything that happens to your data.
  2. If you're dual booting with windows:
    1. Disable BitLocker if you have it enabled already.
    2. Download a disk partitioning tool (like Minitool Partition Wizard, EaseUS, Aomei...), I DO NOT recommend Gparted as it may break NTFS and can create partition overlapping if you're not careful (if you're ok with it and sure about it, go for it).
    3. Resize your C: partition to leave at least 60GB from the right (because windows will be broken if you resize from the other side)
      • In case there are any partitions after the free space, move them at the end of the Windows partition (usually it's Recovery)
      • In case the EFI partition is less than 100MB, make it larger by shrinking the windows partition from the side of the EFI by the amount you need to grow it and some more.
      • This is crucial as it will help use format it with APFS later on.
    4. Create an empty FAT32 partition in that free space (CRUCIAL, as macOS doesn't see "empty" space.)
  3. Boot to the Firmware Setup (AKA, BIOS Setup), use one of these methods
    • Open Start > Settings > Updates and Security > Recovery > Advanced Startup > Troubleshoot > Advanced Options > UEFI Firmware Settings
    • Shutdown the tablet, press the power button once and quickly hold the Volume Down button until you see the HP Startup Menu screen, select BIOS Setup.
    • Shutdown the tablet, attach a keyboard, press the power button and
      • Quickly hold ESC until you get HP Startup Menu, select BIOS Setup
      • Quickly hold F10 until you get to the BIOS Setup
      • Quickly hold F9 until you get to the Boot Menu, press Esc to return to the menu before it, select BIOS Setup
    • If you're using GRUB2/Systemd-boot, select Boot Firmware Setup.
    • IMG_20161102_093722
  4. Configure your BIOS settings as shown in these pictures:
    • Note that only the selected parts are very important to the setup, the rest can changed depending on your needs.
    • Note that YOU DO NOT need to be on the latest BIOS release, it's not really needed, but if you want more security, you may want to update it.
    • Security Tab
      • IMG_1211
    • Advanced Setup tab
      • Boot Options
      • IMG_8138
      • Secure Boot
      • IMG_8794
      • System Options
      • IMG_7541
      • Built-in Devices Options
      • IMG_3160
        • This is called normally DVMT-prealloc, and macOS drivers will only work if it's 64MB or larger, so either choose 64 or 128.
      • IMG_1350
      • Ports Options
      • IMG_2659
      • Power Management Options
      • IMG_8771
        • DISABLE MODERN STANDBY! IT'S THE DEVIL ITSELF!
      • Remote Management Options
      • IMG_8222
  5. Press F10 when done to save and reboot. Make sure you can boot into Windows.

Ok, so I know that some of you may have a macOS machine nearby and some may not so I got the guide for both. The setup overview will be something like this:

  1. Prepare a vanilla bare macOS installer
  2. Install macOS and get it booting
  3. Add extra stuff from this guide

OpenCore Guide - khronokernel aka Hackintosh Slav (boomer-chan)

You're good to go and start your macOS installer

  1. You can boot your OpenCore drive by starting your tablet to the Boot Menu
    • By starting the tablet as shown above to the HP Startup Menu
    • By starting the tablet while holding F9/ESC
  2. Boot your OpenCore USB
  3. When you get to the OpenCore Boot Picker, quickly press the number for macOS recovery/installer
  4. After macOS Installer starts up, select Disk Utility
    1. Select View > All Devices
      • ViewDevices
    2. Select the partition you made earlier
    3. Select Erase
    4. Select APFS as format and name the drive whatever you want
      • erase
    5. Select Erase
      • ⚠️ Disk Utility can suddenly crash and go back to the main menu, just wait like a minute or two, open Disk Utility again and see if the drive has been formatted
    6. Close Disk Utility once done and select Install macOS and install macOS obviously.
    7. The installer may reboot several times (at least once) and will automatically choose the drive to boot from, do not select/change the boot order. Make sure you start your USB drive on each reboot, you can do that automatically by moving the USB boot entry in Boot Options in your BIOS Setup to the top of the list order.
    8. Once macOS installed and get to the desktop (make sure you skip Apple Account login) you can now:
      1. Download MountEFI and install the Automator Quick Action
      2. While in Finder, click on Finder > Preferences > General > Show these items on the desktop > Hard disks and External disks
      3. You will see your SSD's partitions on the desktop, right click on the macOS partition > Quick Actions > Mount EFI > type in your password when you get the prompt. Your SSD's EFI will show up.
      4. Copy Your USB's FAT32 partition > EFI > BOOT and OC to Your SSD's EFI > EFI > .
        • Go Your SSD's EFI > EFI > Boot, rename OC's BOOTx64.EFI to BOOTxOC.EFI (this is so that it doesn't get overwritten after Windows Updates/Linux Grub2 Updates)
      5. Reboot to the Boot Menu (F9)
      6. Select "Select an EFI file" and go to EFI > OC > Tools > Shell.efi
      7. Once you're greeted with the shell
        1. Type map -b, usually you'll find the first partition listed is the FAT32 readable partition, should be named FSX: where X is a number
        2. Type FSX:
        3. Type bcfg boot add 00 FSX:\EFI\BOOT\BOOTxOC.EFI "OpenCore Booter"
          • bcfg: Manages the boot and driver options that are stored in NVRAM. -- UEFI Spec sheet
          • boot: what bcfg needs to change
          • add: add entry
          • 00: entry order in the list (00 being the very first entry)
          • FSX:\EFI...: path to the EFI file
          • "OpenCore Booter": name of the entry, you can choose whatever you want as long as it's 3 characters long and with the quotes.
        4. Press Ctrl + Alt + Del and your tablet will reboot
      8. After that a new entry for the BOOTxOC is made and your tablet will boot to OC automatically.
        • Note that in the even of a Windows Update "replaces your EFI" (which it totally does NOT), you can simply check the boot order in the BIOS Setup > Advanced > Boot Option and change the order as you see fit, or if suddenly the entry vanishes, you'll have to redo the steps above
        • I have yet to get this kind of issue
        • OpenCore's NVRAM clearing will reset the EFI boot entries to the defaults, rerun the above after an NVRAM clearing

Fixing macOS and friends

After installing macOS, getting OpenCore to boot, it's time to get the rest of it to work. In this repository you'll find a bunch of SSDTs with a plist for patches that comes with SSDTs (if needed). Note that these ACPI files are made with my machine in mind (the CPU, RAM, SSD differences do not matter), and depending on your motherboard revision and your UEFI Firmware version/variation/revision, you may need to change things, but usually you wouldn't need to but just in case, I'll link many resources to get information to fix things on your end.

ACPI Fixes

SSDT File Name Patch(es) to use with Reason to use
SSDT-BAT - GBAW to XBAW
- GACW to XACW
- BTIF to XTIF
- BTST to XTST
- ITLB to XTLB
- GBTI to XBTI
- GBTC to XBTC
- SBTC to XBXC
- GCGC to XCGC
- NTBI to XTBI
Battery patches to get battery reading in macOS. The SSDT has the patched OperationRegions + Methods, the OC patches rename the original methods to something else so that macOS uses the new patched methods in the SSDT.
SSDT-XOSI _OSI to XOSI Renames the _OSI (Operating System Interface Level) method so that we can add macOS identification in the SSDT, this way, features that would only be enabled if Windows was detected would be also available for macOS. In our case it's mostly the I2C controllers.
SSDT-PNLF none Fixes brightness by adding a PNLF device.
SSDT-EC none Adds a fake EC device (embedded controller) named EC__, this fixes macOS Catalina's boot issue. More about that here.
SSDT-DMAC none macOS looks for the DMAC device, so we added it.
SSDT-PMCR none Learn more here.
SSDT-TBHP RMV to XRMV Enables USB Type-C hotplug. More about that later in the guide.
SSDT-TPL0 - PS3 to XPS3 in TPL0
- PS0 to XPS0 in TPL0
Fixes the touchscreen unresponsiveness after wake. (Thanks to jhax01)
SSDT-SBUS-MCHC none Adds SBUS and MCHC devices, needed for macOS.
SSDT-NVME none Adds Power Management properties when using NVMe drives, idk really if that actually works, but it's not really doing anything bad either.
SSDT-PLUG none Adds plugin-type property to the CPU scope device, helps with CPU Power management. Contains CPUFriend Data.
SSDT-USBX none Adds USB properties for AppleBusPowerController for the USB ports, helps with the 10 W output support.
SSDT-MEM2 none Learn more here
SSDT-PTS Method(_PTS,1,N) to ZPTS Adds XHC.PMEE fix, helps with the restart after shutdown.
SSDT-SLPB none Adds power button, I'm not sure if it fixes anything for anyone else.
SSDT-HP-FixLidSleep none Fixes e005 spam when putting laptop to sleep.
SSDT-ISHD none Disables ISHD when in macOS.
SSDT-VOL_KEYS _Q30 to XQ30 Fixes volume buttons on the side to actually do their job. (thanks to jhax01)
none GPRW 0x6D, 0x04 to GPRW 0x6D, 0x00 Attempts to fix usb wake, I recommend you disable it and try enabling and re-disabling USB Wake in your firmware to get it fixed.
none SAT0 to SATA In case you're using a SATA M.2 SSD, this would rename the SATA device in ACPI to what macOS ACPI Interpreter likes, may help with SATA power management.
none RTC Fix Fixes RTC issues in macOS, you would get a "CMOS Clock Error" on shudown/restart, this fixes it. (thanks to Rehabman)

Kernel Extensions (Kexts)

Kext Use Depends on Source Download link
Lilu An open source kernel extension bringing a platform for arbitrary kext, library, and program patching throughout the system for macOS. none https://github.com/acidanthera/Lilu https://github.com/acidanthera/Lilu/releases
VirtualSMC Advanced Apple SMC emulator in the kernel. Lilu https://github.com/acidanthera/VirtualSMC https://github.com/acidanthera/VirtualSMC/releases
WhateverGreen Various patches necessary for certain ATI/AMD/Intel/Nvidia GPUs Lilu https://github.com/acidanthera/WhateverGreen https://github.com/acidanthera/WhateverGreen/releases
AppleALC An open source kernel extension enabling native macOS HD audio for not officially supported codecs without any filesystem modifications. Lilu https://github.com/acidanthera/AppleALC https://github.com/acidanthera/AppleALC/releases
USBMap Maps the USB ports by personality and address none Made by USBMap in this repository
AirportBrcmFixup An open source kernel extension providing a set of patches required for non-native Airport Broadcom Wi-Fi cards. Lilu https://github.com/acidanthera/AirportBrcmFixup https://github.com/acidanthera/AirportBrcmFixup/releases
CPUFriend A Lilu plug-in for dynamic power management data injection. Lilu https://github.com/acidanthera/CPUFriend https://github.com/acidanthera/CPUFriend/releases
VoodooI2C VoodooI2C is a project consisting of macOS kernel extensions that add support for I2C bus devices. Fore OpenCore, make sure you put the Dependencies (found in VoodooI2C.kext/Contents/Plugins) in this order: - VoodooI2CServices
- VoodooGPIO
- VoodooI2C
https://github.com/alexandred/VoodooI2C https://github.com/alexandred/VoodooI2C/releases
VoodooI2CHID A sattelite kext for VoodooI2C to enable support for I2C-HID support, like the touchscreen. VoodooI2C https://github.com/alexandred/VoodooI2C/ https://github.com/alexandred/VoodooI2C/releases
NoTouchID Lilu plugin for disabling Touch ID support. Helps with the lag/hang when being asked for password input when using MBP13,1 and later SMBIOSes. Lilu https://github.com/al3xtjames/NoTouchID https://github.com/al3xtjames/NoTouchID/releases
SMCBatteryManager VirtualSMC Plugin to enable battery states readings. VirtualSMC https://github.com/acidanthera/VirtualSMC https://github.com/acidanthera/VirtualSMC/releases
SMCProcessor VirtualSMC Plugin to enable CPU information readings (Temp, Freq...) VirtualSMC https://github.com/acidanthera/VirtualSMC https://github.com/acidanthera/VirtualSMC/releases
VoodooPS2Controller Enables PS/2 Support on macOS, make sure you put this kext before VoodooPS2Keyboard. VoodooPS2Mouse and VoodooPS2Trackpad can be removed/disabled. none https://github.com/acidanthera/VoodooPS2/ https://github.com/acidanthera/VoodooPS2/releases
AlpsT4USB Enables trackpad gestures for the ALPS USB trackpad. VoodooI2C https://github.com/blankmac/AlpsT4USB/ https://github.com/blankmac/AlpsT4USB/releases
BrcmBluetoothInjector The BrcmBluetoothInjector.kext is a codeless kernel extension which injects the BT hardware data using a plist; it does not contain a firmware uploader. none https://github.com/acidanthera/BrcmPatchRAM https://github.com/acidanthera/BrcmPatchRAM/releases
BrcmFirmwareData Holds all the configured firmwares for different Broadcom Bluetooth USB devices BrcmBluetoothInjector https://github.com/acidanthera/BrcmPatchRAM https://github.com/acidanthera/BrcmPatchRAM/releases
BrcmPatchRAM3 A macOS driver which applies PatchRAM updates for Broadcom RAMUSB based devices. (Note that BrcmPatchRAM3 is to be used with 10.15, it works with 10.14 but BrcmPatchRAM2 is recommended for that OS version, OpenCore can inject either of them depending on the OS version, make sure you configure it in the config.plist) - BrcmBluetoothInjector
- BrcmFirmwareData
https://github.com/acidanthera/BrcmPatchRAM https://github.com/acidanthera/BrcmPatchRAM/releases

You should be all done for now. All of these patches will be in oc-additions.plist. You will have to merge them in your config.plist that you made earlier with the OpenCore guide.

Audio and DP output

You'll find 2 entries to merge into your config.plist in the oc-additions.plist\DeviceProperties\Add. You can know more about the data here (WhateverGreen FAQ.IntelHD) and here (AppleALC Wiki).


Issues and small fixes and whatever I can't put in a category lol

Type C

Ok, this thing is a pain. If you're going to use a Type C dongle, please follow these guidelines:

WiFi Card

You will need to disassemble the tablet, which is kinda hard to do.

Check this guide: https://www.ifixit.com/Device/HP_Elite_x2_1012_G2 and https://www.ifixit.com/Guide/HP+Elite+x2+1012+G2+Wi-Fi+Card+Replacement/107930

You can skip step 2 (were you unscrew the hinge). Good luck.

Touch experience

macOS touch experience is by far the worst! Don't even think about getting iPad/iPhone like experience oob, but thanks to VoodooI2C, the experience has been a lot better. The screen acts now like a giant trackpad, with absolute pointing to get "proper" touch usability. Here are some things to keep in mind:

HiDPI Resolutions

By default, if you get proper screen resolution after macOS install, the screen res would be at a 200% DPI, which is for our devices 1368x912, looks small on paper but its actual resolution is twice that at 2736x1824 which, you guessed it, our native screen resolution. It makes text sharper, elements of the screen bigger and more comfortable to use, however unlike windows, macOS does not have non-integer scaling, so you will not have a % you can choose from, but you'll have to give macOS a resolution to emulate and then "x2"s it as a Retina resolution.

Documentations and guides that you must read/follow in case you need assistance:


And with that, Good Luck and let me know if you succeeded. Also I would love to get fixes and changes to this guide to improve on it. Open an Issue or make a PR and I'll review it.

Credits

Thank you.