acoutts / x1c7-hackintosh

Hackintosh for Lenovo X1C7 with Intel i7-10710u
MIT License
5 stars 1 forks source link

Potential solution for M.2 whitelist problem #1

Open notthebee opened 4 years ago

notthebee commented 4 years ago

I know you've given up on this project but you still might be interested in this. The M.2 whitelist has been a long standing issue of Lenovo laptops until its removal in 50-series laptops. For Ivy Bridge and Haswell models the solution is BIOS modification, which requires hardware flashing, but works pretty well.

Here's a post that describes the whitelist removal on T440p http://thrimbor.github.io/2019/09/24/removing-the-m2-whitelist-on-a-thinkpad-t440p.html

SPI flashing introduces a certain risk if the programmer isn't set up properly, so I imagine not everyone would want to risk their €1000+ laptop for that.

Still, if someone can make an SPI dump and send it to me, I'd love to try and see if the whitelisting mechanism is similar to older models. Pretty sure it is since even the message on the screen is the same.

n4ru commented 4 years ago

This will not work on any machine with a soldered CPU since Haswell, because Boot Guard shuts you out as soon as it detects a foreign BIOS.

acoutts commented 4 years ago

Also regardless if you managed to bypass the whitelist, the m.2 slot is upside down so the wifi card won't clear, because the tall side will be going down against the board instead of being flush against the board.

SukkaW commented 4 years ago

Continuing the discussion about potential solution:

muhchaudhary commented 4 years ago

It seems like he tried both AWAC patch and Fake CPU-ID

SukkaW commented 4 years ago

It seems like he tried both AWAC patch and Fake CPU-ID

Checked & confirmed. He indeed tried.

n4ru commented 4 years ago

Just an FYI, you can partially bypass bootguard and enable a custom BIOS on these machines now using a Lenovo backdoor. Not sure if that gets us any closer, but if you have the hardware feel free to play around - this should let you unlock the whitelist (you'll have to write the patch yourself, this just stops boot guard from locking up when you flash an unsigned BIOS).

sed 's/\x4C\x4E\x56\x42\x42\x53\x45\x43\xFB\xFF/\x4C\x4E\x56\x42\x42\x53\x45\x43\xFF\xFF/g' input.rom > output.rom

Not tested on C7, but tested on C6 and several other Skylake machines - T480, T470.

muhchaudhary commented 4 years ago

Just an FYI, you can partially bypass bootguard and enable a custom BIOS on these machines now using a Lenovo backdoor. Not sure if that gets us any closer, but if you have the hardware feel free to play around - this should let you unlock the whitelist (you'll have to write the patch yourself, this just stops boot guard from locking up when you flash an unsigned BIOS).

sed 's/\x4C\x4E\x56\x42\x42\x53\x45\x43\xFB\xFF/\x4C\x4E\x56\x42\x42\x53\x45\x43\xFF\xFF/g' input.rom > output.rom

Not tested on C7, but tested on C6 and several other Skylake machines - T480, T470.

I have an x1c7, same model, i7 10710u. Do you have any documentation or resources on this method?

SukkaW commented 4 years ago

@MuhammadAhmadChaudhary

https://github.com/tylernguyen/x1c6-hackintosh/blob/master/docs/1_README-HARDWAREandBIOS.md#modding-your-bios

muhchaudhary commented 4 years ago

@SukkaW seems like even if I do mod the bios, I wont be able to get macOS to boot. I've tried just about everything but get stuck at [EB|#LOG:EXITBS:START]

SukkaW commented 4 years ago

seems like even if I do mod the bios, I wont be able to get macOS to boot. I've tried just about everything but get stuck at [EB|#LOG:EXITBS:START]

Did you disable the CFG Lock disabled in modded BIOS? What version of OpenCore are you using? 0.6.1 or newer? If so, did you disable the SecureBootModel and set DmgLoading to Any?

muhchaudhary commented 4 years ago

seems like even if I do mod the bios, I wont be able to get macOS to boot. I've tried just about everything but get stuck at [EB|#LOG:EXITBS:START]

Did you disable the CFG Lock disabled in modded BIOS? What version of OpenCore are you using? 0.6.1 or newer? If so, did you disable the SecureBootModel and set DmgLoading to Any?

Yeah, I set those parameters, no change. Still stuck at [EB|#LOG:EXITBS:START]

Edit: forgot to mention that im using OC 0.6.1

muhchaudhary commented 4 years ago

It seems like I misunderstood you, my thinkpad is not currently bios modded. Currently there is no way to mod a 10th generation Lenovo thinkpad. Take a look at this: https://github.com/bomdurup/x1c7_2020_hacintosh

SukkaW commented 4 years ago

Take a look at this: https://github.com/bomdurup/x1c7_2020_hacintosh

cc @bomdurup

SukkaW commented 4 years ago

SSDT-RTC0: If default RTC has been force disabled inside BIOS, just fake a new RTC under LCB then.


        Device (RTC)
        {
            Name (_HID, EisaId ("PNP0B00"))  // _HID: Hardware ID
            Name (_CRS, ResourceTemplate ()  // _CRS: Current Resource Settings
            {
                IO (Decode16,
                    0x0070,             // Range Minimum
                    0x0070,             // Range Maximum
                    0x01,               // Alignment
                    0x08,               // Length
                    )
                IRQNoFlags ()
                    {8}
            })
            Method (_STA, 0, NotSerialized)  // _STA: Status
            {
                If (LEqual (STAS, One))
                {
                    Return (0x0F)
                }
                Else
                {
                    Return (Zero)
                }
            }
        }

According to DSDT.dsl, it appears that adding a simple SSDT will be fine:

External (STAS, FieldUnitObj)
Scope (\)
{
    If (_OSI ("Darwin"))
    {
        STAS = 2
    }
}
muhchaudhary commented 4 years ago

Tried all those options and compiled SSDT:RTC0, still stuck at exitbs :( .

SukkaW commented 4 years ago

@MuhammadAhmadChaudhary

https://dortania.github.io/OpenCore-Install-Guide/troubleshooting/troubleshooting.html#stuck-on-eb-log-exitbs-start

Have you tried those method then?

Also, remove SSDT-AWAC & SSDT-RTC0, both of them. Then compile following content into a new SSDT-AWAC, use it instead:

External (STAS, FieldUnitObj)
Scope (\)
{
    If (_OSI ("Darwin"))
    {
        STAS = 2
    }
}
muhchaudhary commented 4 years ago

Tried AWAC patch. compiled and ran. Still stuck on the same spot here is my most up to date log https://pastebin.com/KTmMuPsm

SukkaW commented 4 years ago

here is my most up to date log https://pastebin.com/KTmMuPsm

09:854 00:048 OC: Current SMBIOS: LENOVO model 20R1S05B00
09:910 00:056 OC: New SMBIOS: Acidanthera model MacBookAir9,1

It appears that you have misconfigured your SMBIOS type. Use MacBookPro15,4 instead.

MacBookPro15,4 is used by a Lenovo XiaoXin Pro Hackintosh EFI whose model has i7-10710u as well.

10:603 00:057 OC: Setting devprop PciRoot(0x0)/Pci(0x1b,0x0):layout-id - Success
10:652 00:048 OC: Setting devprop PciRoot(0x0)/Pci(0x2,0x0):AAPL,ig-platform-id - Success
10:700 00:048 OC: Setting devprop PciRoot(0x0)/Pci(0x2,0x0):framebuffer-patch-enable - Success
10:749 00:048 OC: Setting devprop PciRoot(0x0)/Pci(0x2,0x0):framebuffer-stolenmem - Success
10:797 00:048 OC: Setting devprop PciRoot(0x0)/Pci(0x2,0x0):framebuffer-fbmem - Success
10:846 00:048 OC: Setting devprop PciRoot(0x0)/Pci(0x2,0x0):device-id - Success

Try not to include any device properties before you have successfully installed the macOS. But it doesn't matter since you have stuck at Early Boot.

30:469 00:101 OC: Prelinked injection Lilu.kext () - Success
30:550 00:080 OC: Prelinked injection VirtualSMC.kext () - Success
30:645 00:094 OC: Prelinked injection AppleALC.kext () - Success
30:735 00:090 OC: Prelinked injection IntelMausi.kext () - Success
30:806 00:070 OC: Prelinked injection NVMeFix.kext () - Success
30:873 00:066 OC: Prelinked injection NoTouchID.kext () - Success
30:960 00:086 OC: Prelinked injection SMCBatteryManager.kext () - Success
31:030 00:070 OC: Prelinked injection SMCProcessor.kext () - Success
31:102 00:071 OC: Prelinked injection SMCSuperIO.kext () - Success
31:253 00:151 OC: Prelinked injection VoodooInput.kext () - Success
31:333 00:079 OC: Prelinked injection VoodooPS2Controller.kext () - Success
31:411 00:077 OC: Prelinked injection VoodooPS2Controller.kext/Contents/PlugIns/VoodooInput.kext () - Success
31:499 00:088 OC: Prelinked injection VoodooPS2Controller.kext/Contents/PlugIns/VoodooPS2Keyboard.kext () - Success
31:570 00:070 OC: Prelinked injection VoodooPS2Controller.kext/Contents/PlugIns/VoodooPS2Mouse.kext () - Success
31:649 00:079 OC: Prelinked injection VoodooPS2Controller.kext/Contents/PlugIns/VoodooPS2Trackpad.kext () - Success
31:727 00:077 OC: Prelinked injection WhateverGreen.kext () - Success

Try adding RTCMemoryFixup.kext along with the boot args rtcfx_exclude=80-AB,B0-B4.

BTW, are you still using PM981 or you are using other SSD?

muhchaudhary commented 4 years ago

YOU WON't BELIEVE IT. I got it past exitbs error. I cleared nvram and applied all the changes you recommended. Unfortunately, my PC restarted with an error message: Boot Manager recovered from an error. reset to default configurations.

This is where opencore stops now, https://pastebin.com/8hULQjVb

still, this is a major development lol. I'm thinking that I should remove everything not necessary for macos to boot, but I don't know where to start.

edit: it displays the apple logo and then crashes, edit: also, I have a toshiba nvme ssd installed : KXG6AZNV256G TOSHIBA

SukkaW commented 4 years ago

still, this is a major development lol. I'm thinking that I should remove everything not necessary for macOS to boot, but I don't know where to start.

Remove following kexts:

Remove following DeviceProperties:

Also, I cannot see the boot args inside the log.

This is where opencore stops now, https://pastebin.com/8hULQjVb

73:527 00:064 AAPL: [EB|#MBA:NV] (<null string>)

It is strange. Clearing NVRAM shouldn't result in missing boot args.

Try adding SSDT-PMC.

edit: it displays the apple logo and then crashes,

Since boot args are completely missing, that's why you only see Apple logo instead of verbose message.

Also, try disabling Secure Boot in config.plst:

hagenest commented 3 years ago

I'm having the exact same problem as you @MuhammadAhmadChaudhary, but on the Thinkpad L13 Yoga which has a similar hardware configuration. The problem seems to affect all comet lake thinkpads. Did you get any further? I tried to follow @SukkaW s steps, but I can't get past AAPL: [EB|#LOG:EXITBS:START]

SukkaW commented 3 years ago

@hagenest Try follows the instruction here: https://dortania.github.io/OpenCore-Install-Guide/troubleshooting/extended/kernel-issues.html#stuck-on-eb-log-exitbs-start

hagenest commented 3 years ago

Thank you for answering :) I and many others have already tried this, but I couldn't find anyone who was able to get past that message on a comet lake ThinkPad. CFG Lock can't be disabled and it seems like AppleXcpmcfglock doesn't work here. It's possible that the problem lies somewhere else though, an opencore developer told me it has nothing to do with them. I was hoping you two stumbled upon a solution, but I couldn't replicate @MuhammadAhmadChaudhary s success

SukkaW commented 3 years ago

@hagenest Well. Just don't try Reset NVRAM. SIMPLY DON'T. Reset NVRAM will brick any ThinkPad after 2019.

Otherwise, feel free to play around with anything you like.

AppleXcpmcfglock is a kernel quirk, which means it patches macOS. Whether the quirk works or not is related with the macOS version, not the hardware you are using. That's why vit9696 said it has nothing to do with them.

muhchaudhary commented 3 years ago

@hagenest unfortunately, I was unable to get macOS to boot as well. Couldn’t get past that exitbs. The little success that I did have was most likely untreated to actually getting the macOS installer to boot. The problem seems to stems from Lenovo’s locked down and protected bios as most other laptop with 10th gen cpus don’t have much issues getting past the dreaded exitbs error.

muhchaudhary commented 3 years ago

Would someone like to try to hackintosh again using opencore 0.6.7. I found a reddit thread of someone with a thinkpad p14s 10710u that was successful. https://www.reddit.com/r/hackintosh/comments/lo6rkt/problem_loading_opencore_066_laptop/

hagenest commented 3 years ago

I was able to hackintosh my Thinkpad L13 Yoga with an i7-10510U with OC 0.6.7 just yesterday, it should work

muhchaudhary commented 3 years ago

Great news. I have Catalina installing in my x1c7 now

huyhoang8398 commented 3 years ago

Great news. I have Catalina installing in my x1c7 now

can you share your installation guide?

muhchaudhary commented 3 years ago

of course, my EFi is based off this one https://github.com/aidanchandra/x1c7-hackintosh

with the following additions:

Cpuid1Data: EC060800 00000000 00000000 00000000

Cpuid1Mask: FFFFFFFF 00000000 00000000 00000000

in the config.plist file. without setting these parameters, you'll be stuck at [EB|#LOG:EXITBS:START].

Also, the ideal smbios is MacBookPro16,2 however using this model with prevent bluetooth from working so for now sticking with MacBookPro15,4 is just fine

muhchaudhary commented 3 years ago

I will add, just about everything is working. So far what I've noticed that is not working is:

A quick note, using the first thunderbolt port for display output caused my screen to glitch out.

huyhoang8398 commented 3 years ago

I will add, just about everything is working. So far what I've noticed that is not working is:

  • iservices(most likely my fault, not really interested in getting this working)
  • internal microphone
  • HDMI port (external displays are only working through the second thunderbolt port so far)

A quick note, using the first thunderbolt port for display output caused my screen to glitch out.

how about sleep, hotplug thunderbolt?

muhchaudhary commented 3 years ago

sleep works perfectly, haven't been able to test hot plug thunderbolt