Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.
Status
The first post of this thread is a WikiPost and can be edited by anyone with the appropiate permissions. Your edits will be public.

w1z

macrumors 6502a
Aug 20, 2013
692
481
@w1z, FAT driver implementations in the firmware often contain serious errors, which result in likely partition filesystem corruption after write operations. We saw this happen with APTIO IV and Insyde in firmwares before 2015. Most likely MacPro firmware has it too. You can either replace FAT driver with the one from EDK II or disable stuff like logging in a production environment.

I'll have a look at the EDK II option. Not sure if you read my updated post but the replacement of kexts loaded by OC from EFI/OC/Kexts causes the corruption. Other options include loading kexts via /Library/Extensions or unloading kexts in OC prior to updating them (the kext files).

Not really a major issue.

Thank you.
 

cdf

macrumors 68020
Original poster
Jul 27, 2012
2,256
2,583
Any hints on how to go about this?
Downloaded the util but not sure what next steps are.
Cheers

First, get the name of your device: look for "AHCI Controller" or "NVM Express Controller" in System Information > PCI. You should see something like "pci144d,a801." Then, for example, enter the following in terminal:
Code:
gfxutil -f pci144d,a801
 
  • Like
Reactions: octoviaa and Dayo

h9826790

macrumors P6
Apr 3, 2014
16,656
8,587
Hong Kong
Any hints on how to go about this?
Downloaded the util but not sure what next steps are.
Cheers
Another easy way is to use Hackintool -> PCI page -> find your device name -> get the device path
Screenshot 2020-02-15 at 8.55.35 PM.png
 
  • Like
Reactions: octoviaa and Dayo

Dayo

macrumors 68020
Dec 21, 2018
2,257
1,279
First, get the name of your device: look for "AHCI Controller" or "NVM Express Controller" in System Information > PCI. You should see something like "pci144d,a801." Then, for example, enter the following in terminal:
Code:
gfxutil -f pci144d,a801

Another easy way is to use Hackintool -> PCI page -> find your device name -> get the device path

Thanks both. Got it done with a combination of the two.

About ready to drop the "--nextonly" flag that i have been adding to the bless command while setting up and go all in with OC!
 

h9826790

macrumors P6
Apr 3, 2014
16,656
8,587
Hong Kong
Just did some test of ROM dump / flash when boot via OC.

No problem at all.

Hold power button to boot can enter firmware flashing mode with OC boot picker display / work normally. ROMTool work as expected after boot to desktop.

And after flashing a clean ROM, the cMP can still boot to OC boot picker by default. This is amazing. Which means, no matter after we reset NVRAM, or even ROM flashing, the boot screen still there.
 

paulogilmour

macrumors newbie
Feb 14, 2020
18
6
How i instaled Windows in UEFI mode.


Tools needed:


Brew (to install gdisk)​
Gdisk (GPT Fdisk)​
Virtual Box​
Windows 10 ISO image​
More than 3 hard drives​

First config virtual box to have full access to disk (In Mac OS preference panel)

Now open the Terminal and type:

sudo -s

Enter your password and hit return.

Type it:

diskutil list

Take note to the number of disk designated for Windows. (In my Mac is /dev/disk3)

Type it:

diskutil umountdisk /dev/disk# # = the number of your disk

Type it:

VBoxManage internalcommands createrawvmdk -filename "</path/to/file>.vmdk" -rawdisk /dev/disk#

Type it:

/Applications/VirtualBox.app/Contents/MacOS/VirtualBox

In the VirtualBox, create a VM for Windows 10 with the vmdk file created. Set the VM to use EFI.

Boot the VM and install Windows. At the end don’t create a user! Type Control + Shift + F3 to enter in audit mode.

In audit mode (sysprep) download and extract the driver** for your video card and install it from the INF file (AMD/DriverVersion/Packages/Drivers/Display/WT6A_INF)! Not from Setup aplication.

Now open the sysprep and select “Generalize” and “Shutdown”. After that close VirtualBox. If the disk not show in Mac OS Desktop, mount with diskutil mount /dev/disk#. Open the disk and check for EFI folder, if partition has no name, rename it to EFI.

Type gdisk /dev/disk#

Gdisk show an error in the partition and fix it, now rename the Windows partition to BOOTCAMP, save the modification and exit gdisk.

Then install (copy) OpenCore to a secondary disk (here i used my media disk) and bless it.

Now restart your Mac,

The OpenCore bootpicker now show BOOTCAMP Windows. Boot it and install driver with brigadier (google it).

** I needed to do this, because otherwise I would lose the video signal right after the boot.

Works!!
 
Last edited:
  • Like
Reactions: h9826790

tsialex

Contributor
Jun 13, 2016
13,454
13,601
How i instaled Windows in UEFI mode.


Tools needed:


Brew (to install gdisk)​
Gdisk (GPT Fdisk)​
Virtual Box​
Windows 10 ISO image​
More than 3 hard drives​

First config virtual box to have full access to disk (In Mac OS preference panel)

Now open the Terminal and type:

sudo -s

Enter your password and hit return.

Type it:

diskutil list

Take note to the number of disk designated for Windows. (In my Mac is /dev/disk3)

Type it:

diskutil umountdisk /dev/disk# # = the number of your disk

Type it:

VBoxManage internalcommands createrawvmdk -filename "</path/to/file>.vmdk" -rawdisk /dev/disk#

Type it:

/Applications/VirtualBox.app/Contents/MacOS/VirtualBox

In the VirtualBox, create a VM for Windows 10 with the vmdk file created. Set the VM to use EFI.

Boot the VM and install Windows. At the end don’t create a user! Type Control + Shift + F3 to enter in audit mode.

In audit mode (sysprep) download and extract the driver** for your video card and install it from the INF file (AMD/DriverVersion/Packages/Drivers/Display/WT6A_INF)! Not from Setup aplication.

Now open the sysprep and select “Generalize” and “Shutdown”. After that close VirtualBox. If the disk not show in Mac OS Desktop, mount with diskutil mount /dev/disk#. Open the disk and check for EFI folder, if partition has no name, rename it to EFI.

Type gdisk /dev/disk#

Gdisk show an error in the partition and fix it, now rename the Windows partition to BOOTCAMP, save the modification and exit gdisk.

Then install (copy) OpenCore to a secondary disk (here i used my media disk) and bless it.

Now restart your Mac,

The OpenCore bootpicker now show BOOTCAMP Windows. Boot it and install driver with brigadier (google it).

** I needed to do this, because otherwise I would lose the video signal right after the boot.

Works!!
No need to do that at all. Just create a standard USB key with Microsoft Windows Media Creation Tool, then boot your Mac Pro from it, it will do an UEFI install.
 

Ludacrisvp

macrumors 6502a
May 14, 2008
797
363
That helped. I've updated my post with my new findings. Could you try the following only if you have kexts loaded via OC:

- Mount EFI partition via terminal ie. sudo diskutil mount diskXsX
- Choose a kext that is loaded by OC and referenced in config.plist from your OS drive to your EFI/OC/Kexts folder
- Open disk utility and run first aid on the EFI partition
- Report your result

Thanks
I have like 6 or 7 injected kexts from OC I believe.

I dont use diskutil to mount.

i use this

sudo mkdir /Volumes/EFI; sudo mount -t msdos /dev/disk0s1 /Volumes/EFI; open /Volumes/EFI

ill have to mount it explicitly and try later today. When I ran first aid on the root of the drive it showed that it checked the efi partition so I would not expect different results.

Im also debug logging OC to the efi partition and I’m not sure why you think kext injection is related.
 

paulogilmour

macrumors newbie
Feb 14, 2020
18
6
No need to do that at all. Just create a standard USB key with Microsoft Media Creator, then boot your Mac Pro from it, it will do an UEFI install.

Don't work for me!


If your Mac contains multiple physical drives, you will need to disconnect all disks except the one which you intend to install Windows on or you may encounter the following error:

Windows could not prepare the computer to boot into the next phase of installation. To install Windows, restart the installation.
If i disconnect all my drives, i loose Opencore! And my VGA has no bootscreen without this!
 

startergo

macrumors 603
Sep 20, 2018
5,021
2,283
Any hints on how to go about this?
Here is how I did it:
Code:
<key>Patch</key>
        <array>
            <dict>
                <key>Arch</key>
                <key>x86_64</key>
                <key>Base</key>
                <string></string>
                <key>Comment</key>
                <string>IONVMeFamily Patch#External</string>
                <key>Count</key>
                <integer>0</integer>
                <key>Enabled</key>
                <true/>
                <key>Find</key>
                <data>
                RXh0ZXJuYWw=
                </data>
                <key>Identifier</key>
                <string>com.apple.iokit.IONVMeFamily</string>
                <key>Limit</key>
                <integer>0</integer>
                <key>Mask</key>
                <data>
                </data>
                <key>MaxKernel</key>
                <string></string>
                <key>MinKernel</key>
                <string></string>
                <key>Replace</key>
                <data>
                SW50ZXJuYWw=
                </data>
                <key>ReplaceMask</key>
                <data>
                </data>
                <key>Skip</key>
                <integer>0</integer>
            </dict>
        </array>
1581796664922.png
 
Last edited:

h9826790

macrumors P6
Apr 3, 2014
16,656
8,587
Hong Kong
If your Mac contains multiple physical drives, you will need to disconnect all disks except the one which you intend to install Windows on or you may encounter the following error:


If i disconnect all my drives, i loose Opencore! And my VGA has no bootscreen without this!
It isn't that hard to work around this problem. e.g. put OpenCore on a USB drive, and boot from it. So that you can have

1) OpenCore on USB drive 1
2) Windows installer on USB drive 2
3) Target hard drive (the one and only one hard drive installed)

In fact, it may be possible to put OC on the USB Windows installer as well.

Anyway, I just did a clean EFI Windows 10 installation to one of my internal SATA SSD with only one USB drive. And I did that by using the OpenCore boot picker.

I believe it's the hard way already, just to confirm the idea can work. I put OpenCore on the target SSD's EFI partition, then boot from this SSD -> load the USB installer -> install Windows on this SSD.
IMG_7926.jpeg


I even make it more complicated. During Windows installation, I intentionally remove all partitions on the SSD, and let the installer re-create the required partitions. Therefore, OpenCore is removed.

This cause me have to do one extra step.

After the first stage installation, Windows installer will reboot. The cMP will stuck at no boot condition (may be it's looking for OpenCore). So, I shutdown the cMP, re-insert all my MacOS drives that have OC installed, and perform a NVRAM reset.

Then my cMP boot to the OpenCore boot picker again. I can simply choose "BOOTCAMP Windows" to continue the Windows installation.
IMG_7927.jpeg


Anyway, I re-installed the Bootcamp drivers, GPU driver, and some basic softwares. Perform a few reboots, then dump the BootROM and check it. There is no more certificate as expected.

I check that by using Binwalk, and keyword search in iHex. Both method can't see the "Microsoft Windows Secure Boot Variable Signer".
Screenshot 2020-02-16 at 7.31.55 AM.png


So, I also believe that we can run EFI Windows risk free now.
 

rroumen

macrumors member
Apr 7, 2016
35
24
One thing still, do you guys get sleep to work properly? It seems after reboot first time the machine sleeps normally but after wake it will not sleep anymore. (Power led blinks one or two times and then turns solid white again, also the video card stays powered on)
 

Cmp4life

macrumors newbie
Feb 12, 2020
8
2
One thing still, do you guys get sleep to work properly? It seems after reboot first time the machine sleeps normally but after wake it will not sleep anymore. (Power led blinks one or two times and then turns solid white again, also the video card stays powered on)
 
Last edited:

Dayo

macrumors 68020
Dec 21, 2018
2,257
1,279
Here is how I did it:

Thanks. I had gotten it done using tips posted earlier:


 

w1z

macrumors 6502a
Aug 20, 2013
692
481
I have like 6 or 7 injected kexts from OC I believe.

I dont use diskutil to mount.

i use this

sudo mkdir /Volumes/EFI; sudo mount -t msdos /dev/disk0s1 /Volumes/EFI; open /Volumes/EFI

ill have to mount it explicitly and try later today. When I ran first aid on the root of the drive it showed that it checked the efi partition so I would not expect different results.

Im also debug logging OC to the efi partition and I’m not sure why you think kext injection is related.

Just tried your method of mounting and I can replicate the corruption in the EFI filesystem as soon as I copy a kext file that is already loaded by OC from the OS to the EFI/OC/Kexts folder. No corruption occurs with plist, efi or log/txt file types.

I have not looked at how OC injects kexts in depth but I believe the process involves loading the kexts with direct file access to the kext executables. Overwriting the kexts while they're still loaded causes the reported corruption in the EFI filesystem.
 

Ludacrisvp

macrumors 6502a
May 14, 2008
797
363
Just tried your method of mounting and I can replicate the corruption in the EFI filesystem as soon as I copy a kext file that is already loaded by OC from the OS to the EFI/OC/Kexts folder. No corruption occurs with plist, efi or log/txt file types.

I have not looked at how OC injects kexts in depth but I believe the process involves loading the kexts with direct file access to the kext executables. Overwriting the kexts while they're still loaded causes the reported corruption in the EFI filesystem.
I’m having a hard time visualizing this.
Can you do a screen recording?
 

roobarb!

macrumors 6502
Jul 30, 2009
277
185
Okay, got my Windows 10 EFI install working now. Couple of things:

- Followed the instructions for driver installation - all good, except there's no control panel appearing in the system tray, I have to run it from Windows\System32\AppleControlPanel.exe.
- Changing the boot device overrides OC entirely. How are you guys getting persistence of OC when using the boot pickers?

I also had it all go south when Windows would stick at its own boot screen with no spinner, just the blue logo. Had to use the inbuilt repair and rebuild to get it back, but I doubt this is anything to do with OC.

Finally, how do I go checking that this install isn't harming my NVRAM and make sure OC is in play under Windows? Because of the picker overriding OC I'm pretty sure this boot is not under OC's power, so I'm guessing this could be a scenario where those certificates being written to NVRAM become an issue.
 

vit9696

macrumors member
Jun 4, 2014
50
147
* @w1z, you come to incorrect conclusions with your exploration. Kexts, once injected by OpenCore, do not depend on the disk anyhow, as it is simply inaccessible from there. The reason you get filesystem corruption is either because of some bug in macOS, or, more likely, because you already have corrupted filesystem, just macOS does not see it.

Creating logs or writing anything in UEFI pretty certainly corrupts EFI partition on e.g. APTIO IV. But the results of this may not be immediately visible. If we assume MacPro bug is similar, for you the key part may be overwriting the existing files. Perhaps a certain modification of the file system tree happens due to this action and the corruption becomes apparent.

Just to be clear, installing decent FAT UEFI driver requires firmware flashing.

* To install Windows you can always use dism. This guide is slightly outdated, but is enough to get the grasp.
— Format the disk in macOS the way you need.
— Copy Windows ISO contents to USB flash (basically any filesystem should do).
— Boot from that USB flash through OpenCore.
— Use dism /Apply-Image to install Windows on your previously formatted disk.
— Install Windows bootloader on any EFI partition you like.

* Latest OpenCore in master got HideAuxiliary support and various other enhancements, which should improve startup performance.
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.