• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

profzei/Matebook-X-Pro-2018: macOS on Huawei Matebook X Pro 2018

原作者: [db:作者] 来自: 网络 收藏 邀请

开源软件名称(OpenSource Name):

profzei/Matebook-X-Pro-2018

开源软件地址(OpenSource Url):

https://github.com/profzei/Matebook-X-Pro-2018

开源编程语言(OpenSource Language):

ASL 96.3%

开源软件介绍(OpenSource Introduction):

macOS  on Huawei Matebook X Pro 2018

Huawei Big Sur 11.0

⚠️⚠️ Advertisement ⚠️⚠️

  • I'm sorry but I decided to remove all my releases: in this way I wanted to make it easier for people who have already copied what is on this site stating they made 'significant and unquestionable original changes' (instead of collaborating by suggesting pull requests)!
  • I'll update this repo but only as my personal online report for how well this laptop could be turned as a full working hackintosh with full support for Thunderbolt devices
  • I thank all those who have supported me during these two years of work, but seeing so many people copying (and then apologizing when confronted with a fait accompli!) templates + all the content of the related pages (even putting a link for a possible donation for their hard work!) + all the content of the ACPI folder of the EFI releases, has deeply disgusted me!

This repository is currently compatible with macOS Monterey, Big Sur, Catalina and OpenCore 0.7.9

Monterey macOS Big Sur macOS Catalina macOS Mojave
12.2.1 (21D62) 11.6.4 (20G417) 10.15.7 (19H15) 10.14.6 (18G87)
12.2 (21D48) 11.6.3 (20G415) 10.15.6 (19G2021) 10.14.5 (18F132)
12.1 (21C52) 11.6.2 (20G314) 10.15.5 (19F101) 10.14.4 (18E226)
12.0.1 (21A559) 11.6.1 (20G224) 10.15.4 (19E287) 10.14.3 (18D42)
11.6 (20G165) 10.15.3 (19D76) 10.14.2 (18C54)
11.5.2 (20G95) 10.15.2 (19C57) 10.14.1 (18B75)
11.5.1 (20G80) 10.15.1 (19B88) 10.14 (18A389)
11.5 (20G71) 10.15 (19A583)
11.4 (20F71)
11.3.1 (20E241)
11.3 (20E232)
11.2.3 (20D91)
11.2.2 (20D80)
11.2.1 (20D74)
11.2 (20D64)
11.1 (20C69)
11.0.1 (20B29)

If you find my work useful:

  • please consider giving it a star to make it more visible.
  • please consider donating via PayPal. donate

DISCLAIMER

  • For best results, read the entire README before you start and follow the install instruction throughly.
  • I am not responsible for any damages you may cause.
  • This is not a support forum.
  • Should you find an error or improve anything — whether in the config or in the documentation — please consider opening an issue or pull request.
  • Complete EFI packs are available in the Releases page (please, refer to the rightside menu).
  • EFI is configured with Monterey or Big Sur in mind: if you are using it on Catalina (or Mojave), read the whole guide to make the necessary changes.
  • EFI is configured for loading macOS from internal NVMe SSD both in dual-boot configuration with Windows and as a single OS (macOS installation on external SSDs are not taken into account)
  • EFI is not suitable, as it is, to be used for installing macOS: please refer to Wiki section for a detailed guide for installing macOS.

Disclaimer

This repository is for personal purposes only.

Introduction

This repo contains the files needed for getting macOS working on a Huawei MateBook X Pro (2018 Edition) laptop with OpenCore.

  • This is intended to create a "fully" functional (as far as possible) hackintosh for the Huawei Matebook X Pro.
  • The project can be considered stable.
  • With each new release of macOS we need to resolve each new "minor issue" we run into. All of the steps I made to get to this point were a result of countless hours of reading along with trial and error, however I'm glad to say that I learned a lot in the meantime. I am by no means an expert so any effective help (suggestions, observations, ...) to tune this project is very appreciated!
  • If you would like to get started with creating a hackintosh on your MBXP but have non experience, I would highly recommend following Dortania's OpenCore Install guide and then returning here for troubleshooting or last improvements.

Summary

  • The compatibility is very good for the most part, most of the stuff works like it would on a real MacBook, including camera, audio, touchpad, iCloud services.
  • The experience is pleasant, as the laptop is smooth and responsive under macOS Big Sur/Catalina.
  • Battery life is quite great (from personal experience it lasts from 8 to 10 hours for light works depending on its age with a behaviour very similar to Windows 10 as shown in the macOS menu bar screenshots below).
  • The Intel WiFi card is soldered onto the motherboard, which means it can't be replaced with a Broadcom one, but the Intel card is now functional albeit not operating at full speeds (however it is fine for most use cases).

MBXP Battery Menu bar

Generate your own SMBIOS Information

For privacy reasons, all SMBIOS information has been wiped out in the configuration file EFI/OC/config.plist. You need to generate your unique SMBIOS info by yourself (recommend to use CorpNewt's GenSMBIOS), and inject them into your config.plist.

  • With every EFI update you retrieve from here, please, remember to transfer your Device details under PlatformInfo -> Generic in your config.plist.
  • For more details on dual booting settings, please, see also below OpenCore and Windows Activation notes.

About this Mac

Configuration

Specifications Details
Computer model Huawei Matebook X Pro 2018 Space Gray
Processor Intel Core i7-8550U Processor @ 1.8 GHz
Memory 8 GB LPDDR3 2133 MHz
Hard Disk LiteON SSD PCIe NVMe 512 GB [CA3-8D512]
Integrated Graphics NVIDIA GeForce MX150 / Intel(R) UHD Graphics 620
Screen JDI 3k Display @ 3000 x 2000 (13.9 inch)
Sound Card Realtek ALC256
Wireless Card Intel Dual Band Wireless-AC 8265/8275
Bluetooth Card Intel Bluetooth 8265/8275

Device Firmware Bios version: 1.37

Benchmarks
System configuration GPU - OpenCL Performance 4731

Compare with these.

Changelog

2022 - March - 12

See Current status

Status

  • Intel(R) UHD 620 Graphics card
  • Intel(R) Wireless-AC 8265/8275 & Intel(R) Bluetooth
  • Power Management with support for HWP (Intel Speed Shift & Intel SpeedStep)
  • Sleep and Wake (support for native macOS hibernatemode3)
  • Hibernation (support for native macOS hibernatemode25 with HibernationFixup.kext)
  • Battery support with better memory access and integration of Battery Information Supplement
  • Automatic Backlight control (with more granular levels)
  • Backlight shortcuts (F1 [brightness level down] - F2 [brightness level up])
  • Volume shortcuts (F4 [mute] - F5 [audio level down] - F6 [audio level up])
  • Audio for Realtek ALC256 card (via AppleALC.kext and layout-id 97)
  • Speakers (4 Channels) & Internal Mic
  • Headphone jack [2 in 1] (via ALCPlugFix)
  • HDMI 2.0 up to two 4K @60 Hz monitors (via LSPCON)
  • Native Color Profile for Display JDI 3k
  • TouchPad (via GPI0 interrupt mode) and native macOS gestures
  • Touchscreen
  • Updated support for LiteON SSD PCIe NVMe
  • PCI Devices latency support and complete description for System Information app
  • USB Ports Mapping (Type-A & Type-C) with proper power levels
  • Thunderbolt Port (limited support)
  • HD Camera
  • NVRAM native support

BIOS Settings

  • Main -> Thunderbolt Device -> Security Level -> No Security
  • Main -> Advanced -> PXE Device Enable -> Disable
  • Main -> Advanced -> Fingerprint Enable -> Disable
Notes
  1. Intel Bluetooth could not support some Bluetooth devices like some Bluetooth mouse since it is only a firmware injector; please, report any issues not here but only on OpenIntelWireless/IntelBluetoothFirmware Gitter Chat
  2. Touchscreen support is disabled by default since release v. 1.8.0. Why? It seems that all VoodooI2C versions after 2.4 are affected to a greater or lesser extent by Multi_GPI0 issues. The solution proposed so far by VoodooI2C developers is only a workaround and not a real fix: proposing to use the GPI0 pinning for touchpad and polling method for touchscreen is not a real fix because this approach increases interrupts and causes a degrade in battery life. This being the case and not needing to use the touchscreen in my daily work, for the moment I have disabled this function pending improvements that can only come from VoodooI2C developers.
  3. If you would like to increase benchmark values for your Intel UHD 620 Graphics card, you need to set rps-control key in DeviceProperties -> PciRoot(0x0)/Pci(0x2,0x0), but keep in mind that rps-control property has been removed to lower down GFX Request:
...
<key>DeviceProperties</key>
<dict>
    <key>Add</key>
    <dict>
        ...
        <key>PciRoot(0x0)/Pci(0x2,0x0)</key>
        <dict>
            ...
            <key>rps-control</key>
            <data>AQAAAA==</data>
            ....
        </dict>
        ...
    </dict>
</dict>
...
Notes: external Display support

Intel UHD 620 Graphics card works well with external display from both USB type-C ports.

  • Suggestion: prefer USB type-C to DisplayPort cable over USB type-C to HDMI one where possible
  • Removed for PciRoot(0x0)/Pci(0x2,0x0) the key force-online (which was set to <data>AQAAAA==</data>). Why?
    • With latest WhateverGreen releases our available connector types are 1 LVDS (internal monitor) and 2 DP; using an external monitor connected with a USB C-type to DP cable I verified the correct recognition and functioning of my BenQ PD2500Q even after the system wake-up. This force-online key could instead be useful for connections using a USB-C type to HDMI cable.
    • Eliminating this key reduces tons of warning messages like [IGFB] [ERROR] [AGDC] Failed with status -536870212 for stream access aux in system log during boot phase: that warning is correct/normal since it reports that the display is not connected for the remaining ports (i.e. FB1 and FB2 in our case using only FB0 i.e. internal display); eliminating those warnings reduces log-file size (in debug-mode) from 2.6 to 1.6 MB thus reducing slightly boot loading time. Reference
  • force-online and force-online-framebuffers work around (possible) HDMI black screen issues after waking from sleep
...
<key>DeviceProperties</key>
<dict>
    <key>Add</key>
    <dict>
        ...
        <key>PciRoot(0x0)/Pci(0x2,0x0)</key>
        <dict>
            ...
            <key>force-online</key>
            <data>AQAAAA==</data>
            <key>force-online-framebuffers</key>
            <data>Af////////8=</data>
            ....
        </dict>
        ...
    </dict>
</dict>
...
Notes: NVMe SSD support
  1. Very rarely some users reported the following kernel panic after sleep:
panic(cpu 0 caller 0xffffff800b6ce860): nvme: "Fatal error occurred. CSTS=0xffffffff
...

It's certainly a NVMe error, but it is not due to EFI released in the present repo:

In case you run into such an issue, it is recommended adding forceRenderStandby=0 boot-args in your config.plist to disable RC6 Render Standby.

  1. If your laptop has a Samsung PM981 NVMe SSD or any unsupported SSD listed in dortania/bugtracker#192, then it's obviously not supported here. I have no way to make my EFI work on broken IONVME compatibility SSDs.

Obvious solutions:

  • buy another (internal) NVMe SSD
  • or install macOS on an external SSD drive

Even if your macOS installed on an external SSD drive, you need to add a new ACPI patch to disable PM981 (or other non-supported NVMe SSDs) detection on macOS:

DefinitionBlock ("", "SSDT", 2, "HUAWEI", "_DRP05", 0)
{
	External (OSDW, MethodObj)

    External (_SB_.PCI0.RP05, DeviceObj)

    Scope (\_SB.PCI0.RP05)
    {
        OperationRegion (DE01, PCI_Config, 0x50, One)
        Field (DE01, AnyAcc, NoLock, Preserve)
        {
                ,   1, 
                ,   3, 
            DDDD,   1
        }
    }

    Scope (\)
    {
        If (OSDW ())
        {
            \_SB.PCI0.RP05.DDDD = One
        }
    }
}
Notes: Bios version

Starting from BIOS version 1.33 and newer, Huawei added to default DSDT.aml a new method, called _QBF, related to battery thermal management.

As default, in config.plist in ACPI -> Add section it has been added SSDT-BIOS.aml (as enabled) for introducing method _QBF also for BIOS versions up to 1.30: proper BIOS version check has been implemented.

Notes: OpenCore and Windows Activation

For dual-booting systems, Windows Activation may fail due to different hardware UUID generated by OpenCore

  • According to OpenCore Official Configuration, you are highly recommended to inject the original Windows system UUID to PlatformInfo -> Generic - >SystemUUID in EFI/OC/config.plist: run wmic csproduct get UUID command in Windows PowerShell app
Notes: AirportItlwm support in macOS Catalina (or Mojave)

If you use this release in macOS Catalina you need to make the following changes in the config.plist to make AirportItlwm.kext support active:

  • DmgLoading set to Signed
  • SecureBootModel set to Default
Notes: Thunderbolt support

As reported in NotebookCheck review our Matebook X pro (2018) is utilizing only half the PCIe lanes for its single Thunderbolt 3 port (TB). Thus, its PCIe x2 Thunderbolt 3 port is only capable of providing a maximum of 20 Gbps instead of 40 Gbps when compared to a standard Thunderbolt 3 port with PCIe x4 lanes.

The connector type is Usb-C and it can do multiple protocols (TB, USB 2/3/3.1, DP, etc...) with different backing controllers. The problem on Hackintoshes is mostly about TB on Usb-C, because the firmware and power management of Apple's TB-controllers works entirely different than those for other OS'es. So even if it's the same hardware found on Windows laptops, they don't "just work" because of the different firmware.

The ACPI-part for handling Thunderbolt 3 port and its power management has been implemented:

  • it enables not only the PCIe-to-PCIe bridge-mode of the TB controller but also the native drivers which make it possible to completely poweroff the controller after using the TB port, saving battery life and prevent the controller from preventing the CPU goes into deeper C-State
  • the ICM is disabled on boot to let OSX' drivers take over the job
  • the TB port works when any device is plugged into it at the boot time: this means no hot-plug
  • the TB 3 XHC Controller is working fine when any device is plugged into it at boot time
  • the TB drivers are loaded even if no device is plugged into it at boot time
  • the TB 3 XHC Controller bus is loaded even if no device is plugged into it at boot time

Thunderbolt Controller: drivers loaded

Thunderbolt Controller: PCI section

Thunderbolt Controller with OWC Envoy Express

Since I was given an OWC Envoy Express Thunderbolt 3 Controller is enabled in my default config.plist.

Steps for disabling support for Thunderbolt controller (\_SB.PCI0.RP09):

  • disable SSDT-JHL6240-AR2.aml
  • enable SSDT-DTB3.aml
  • disable all TB3: * binary patches

Real-time power management for Thunderbolt controller with Discrete GPU (NVIDIA GeForce MX150) removed at PCI level are shown:

Thunderbolt Controller with disabled Discrete GPU at PCI level

Thunderbolt Controller with disabled Discrete GPU at PCI level

For reference, see Thunderbolt 3 Fix and ThunderboltPatcher for related attempts to fix TB by patching its firmware.

What's not working due to Incompatible Hardware
  • Discrete graphics card (NVIDIA GeForce MX150) is not working, since macOS doesn't support Optimus technology
    • Have used SSDT-DDGPU.aml to disable it in order to save power.
    • Removed it at PCI level reducing time for putting machine to sleep and for resuming it from sleep (i.e. laptop is more reactive during these phases!)
    • \_SB.PCI0.RP01 is not present anymore in IORegistryExplorer tree (this is proof for having disabled GPU at PCI level!)

Discrete GPU removedat PCI level

  • Fingerprint sensor is not working
    • Fingerprint readers on Macbooks are managed by T2 chip which has not been very throughly reverse engineered yet
    • Have used SSDT-XHC.aml to disable it (in order to save some power).

Bootloader Firmware

  • Default bootloader: OpenCore 0.7.8 Official release.
    • Support macOS 10.14 ~ latest macOS release
    • As theme for OpenCanopy, a cleaner version with custom graphics has been provided by @R-Teer
    • See more info in Wiki section about migration from Clover.
  • No longer maintained: Clover r5118 Official release r5103 Dids release

Install Settings

If you try to use latest EFI Release for installing macOS onto your Matebook X Pro, you'll realize it didn't work... Why?

Because our EFI is very fine tuned to overcome some InsydeH2O firmware's limits and therefore it is not suitable for installation process as it is.

Please refer to Wiki section for a detailed guide for installing macOS.

Post - Install Settings

Enable Tap (with one finger) for Touchpad

Starting from VoodooI2C v. 2.4.1, the click down action is emulated to force touch, which causes the failure of click down and drag gestures.

For example, you can turn off Force Click in System Preferences -> Trackpad or choose three finger drag in System Preferences -> Accessibility -> Mouse & Trackpad -> Trackpad Options

Suggested configuration:

Touchpad Settings

Enable Apple Services

To use iMessage and other Apple services, you need to generate your own serial numbers. This can be done using CorpNewt's GenSMBIOS:

  • If Serial numbers have been correctly generated, these services (iMessage, FaceTime, ...) should work for you
  • If not, clean up and generate new serial number for your SMBIOS.

Default SMBIOS settings of this repo is MacBookPro15,2 MacBookPro14,1 MacBookPro16,3

  1. Launch Terminal app
  2. Copy the following script, paste it into the Terminal window, then press Enter
    git clone https://github.com/corpnewt/GenSMBIOS && cd GenSMBIOS && ./GenSMBIOS.command 
  3. Type 1 for downloading/updating MacSerial script
  4. Type 3, then press Enter
  5. Type MacBookPro15,2 10, then press Enter
  6. Then, go Apple Check Coverage page to check your generated serial numbers. If the website tells you that the serial number is not valid, that is fine. Otherwise, you have to generate a new set.
  7. Next you will have to copy the following values to your config.plist:
    • Serial Number -> PlatformInfo/Generic/SystemSerialNumber
    • Board Number -> PlatformInfo/Generic/MLB
    • SmUUID -> PlatformInfo/Generic/SystemUUID. Reboot and Apple services should work.
<key>PlatformInfo</key>
<dict>
    ...
    <key>MLB</key>
    <string>M0000000000000001</string>
    ...
    <key>SystemSerialNumber</key>
    <string>W00000000001</string>
    ...
    <key>SystemUUID</key>
    <string>00000000-0000-0000-0000-000000000000</string>
    ...
</dict>
  1. If they don't work, follow this in-depth guide. It goes deeper into clearing Keychain (missing this step might cause major issues), and much more.
Sleep & Hibernation settings

On a MacBook there are some stages of sleep:

  • Sleep or memory sleep: this is what happens when you let the computer idle for some time (power to display is turned off);
  • Standby or Safe Sleep: memory state is written to RAM and after a certain period memory power could be turned off;
  • Hibernation: all power is off and all state has been written to a disk image (/private/var/vm/sleepimage); you know this has happened if when you open the lid you see OpenCanopy boot picker, and then see a progress bar while it is loading state from disk.

Sleep stages for macOS

We could summarize sleep settings as the following:

  1. if sleep == 0, the computer will not sleep or hibernate any more
    • For MacBooks, the effective setting automatically changes whenever the charger is plugged in:
      • Normally, sleep minutes are simply equal to displaysleep minutes, which you can set in System Preferences -> Energy Saver
      • But under the Power Adapter tab, checking Prevent computer from sleeping automatically when the display is off option will override sleep minutes to 0
  2. if standby == 1 and hibernatemode == 3, the computer will wait another standbydelay seconds before really entering hibernation
  3. autopoweroff is just an extra implementation to fulfill regulatory requirement and has the same impact equivalent to 2)
  4. either 2) or 3) takes effect if one of them is reached at first
  5. if standby == 1 and hibernatemode == 25, the computer will enter hibernation immediately after sleep minutes.

For our Huawei Matebook X Pro sleep/standby function works flawlessly (both via software and via clamshell) like hibernation (suspend to disk or S4 sleep).

In order to get automatic sleep working properly like real Macs, the following settings are mandatory:

sudo pmset -a powernap 0 
sudo pmset -a proximitywake 0
sudo pmset -a tcpkeepalive 0
sudo pmset -a womp 0
  • powernap will wake up the system from time to time to check mail, make Time Machine backups, etc...
  • proximitywake can wake your machine when an iDevice is near.
  • tcpkeepalive has resolved periodic wake events after setting up iCloud.
  • womp is wake on lan.

After every update, ALL these settings should be reapplied manually!

Suggested configuration in System Preferences -> Bluetooth -> Advanced for Bluetooth devices for avoiding random wake events during sleep:

Bluetooth settings

Default macOS setting for MacBooks is hibernatemode 3 i.e. sleep mode:

  • standby causes kernel power management to automatically hibernate a machine after it has slept for a specified time period
  • standbydelay specifies the delay, in seconds, before writing the hibernation image to disk and powering off memory for standby

Concretely, the way I like to configure my Matebook X Pro is for it to do first a standby-only sleep, so that it quickly goes to sleep, with the chance of a very quick wake-up phase, and then, if I leave the laptop sleeping for a certain number of hours (say in my case 1 hour), it could write the RAM contents to disk and power off the computer, so as to save battery in case of an extended sleep (entering therefore hibernation phase).

In order to get this configuration, I suggest the following settings:

  • add to config.plist in NVRAM -> Add -> 7C436110-AB2A-4BBB-A880-FE41995C9F82 -> boot-args section the value hbfx-ahbm=129 which controls auto-hibernation feature introduced by HibernationFixup kext (in particular it is an arithmetic sum of EnableAutoHibernation = 1 and DisableStimulusDarkWakeActivityTickle = 128 flags) Reference for deeper insight
  • run in Terminal
sudo pmset -a standby 1 
sudo pmset -a hibernatemode 3
sudo pmset -a standbydelaylow 3600
sudo pmset -a standbydelayhigh 3600
  • reboot your laptop

Note: Keep in mind that, with the above settings, after 3600 seconds the laptop wake up itself only partially (display remains off) for switching from standby sleep to hibernation sleep: it is standard behaviour since all Macs use maintenance wake (dark wake - display remains off) to switch laptop from regular sleep into hibernation. It is not an issue! Reference

macOS hibernatemode3

Note: Hibernation mode can be enabled only via console command sudo pmset -a hibernatemode 25 and is fully supported by Matebook X Pro (obviously using HibernationFixup kext).

If, however, you would like to disable it, then

sudo pmset -a hibernatemode 0
sudo pmset -a autopoweroff 0
sudo rm -rf /private/var/vm/sleepimage
sudo touch /private/var/vm/sleepimage
sudo chflags uchg /private/var/vm/sleepimage

You can verify your power settings by typing in terminal sudo pmset -g live .

If you ever want to reset these settings: sudo pmset -a restoredefaults

About power consumption, HWMonitor reports for the idle state both before and after sleep phase the same value for "CPU package total" (0.65-0.70 W). Sleep discharge rate is about 1% every 4:30 hours (during night).

Power Management settings

With CPUFriend.kext and SSDT-PM.aml we achieved a very good power management on battery for

该文章已有0人参与评论

请发表评论

全部评论

热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap