For installing kexts, I use my KextUtil.sh script.This has been done before by @abdyfranco 's Next Loader and even more elegantly by @joevt by using the driver#### NVRAM variables. I just want to document my experiences.
I first tied to install the mouSSE SSE4.2 emulator so I could use my flashed Radeon HD 7770 card, but I failed to get the kext to load. I was however able to boot into the NVMe drive in safe mode by disabling compatibility check in com.apple.Boot.plist. (Safe mode disables all boot-args, including -no_compat_check.)
I use apfs.efi from Driver####. The Apple boot picker does show APFS volumes. I'm not sure how well nvme works from Driver#### though. You can bless the Recovery volume of APFS so it will appear. You can bless the Preboot volume also. I think blessing the System volume just blesses the Preboot volume. The folder/file to be blessed is the one containing the boot.efi file. For all three volumes, you can add a .VolumeIcon.icns (use El Capitan to create it to make sure it has a it32 icon because later macOS versions don't create the it32 by default or you may need to use a utility to add the it32 icon to the icns - use Preview.app to see what icon types the icns contains). Since the System volume can't be blessed directly, it may appear as EFI Boot but at least the volume icon can tell you what it's pointing to. The other two can be given unique .disk_label files. I use my DiskUtil.sh script to create the disk labels (they can have multiple lines).I then switched over to my unflashed Nvidia GTX 770 reference card. High Sierra runs and sleeps perfectly, with no kexts or patches installed. The problem is in getting the unmodified Mac Pro 3,1 to boot a APFS volume from a NVMe drive.
I had rEFInd installed on my Mac. I added apfs.efi and NvmExpressDxe.efi driver files into the rEFInd drivers_x64 folder. The Apple native boot picker does not show APFS or NVMe drives, but once in rEFInd they become visible. The standard rEFInd distribution however requires a boot screen.
Regarding nvme booting, I have a HighPoint SSD7505 (four M.2 slots, gen 4). It has code in the PEX chip that makes the nvme devices appear as SCSI so they can be booted by the Startup Manager (hold option at boot) without an NVMe driver. The Startup Manager will set the EFI boot device path if you hold the control key and press return on an item. If there's a mystery item in the Startup Manager then that doing that will help you discover what it is. I haven't tested the boot from fake SCSI to see if it completes booting. Of course, the EFI device path created by Startup Disk preferences would point to NVMe instead of SCSI, so that method may not boot without NVMe driver. That's another thing to test. Third thing to test is the hardware RAID feature - the PEX chip has code to act as a RAID. Anyway, regardless of the EFI device driver (SCSI) used to start boot.efi, there should be a successful transition to kext device driver (NVME). The transition waits for the proper system partition to appear as a kext device - the partition is matched by volume UUID I guess.
RefindPlus has recently added code to get more GPUs to show boot screen (at least RefindPlus boot screen). For example, I can get RefindPlus to appear on a GTX Titan X (Maxwell). It has a GOP driver that doesn't load unless the EFI version is 2.1 or later. My MacPro3,1 EFI version is 1.1. RefindPlus fakes the version so the GOP will load. The RefindPlus log should have the info. Output ofTo use my unflashed GTX 770 I upgraded to RefindPlus, which should provide a boot screen with EFI GOP cards. My GTX 770 however did not show any video before macOS booted.
dh -d -v > dh_d_v.txt
from EFI Shell may be useful to show what drivers exist. You can also find the location of the rom and dump the contents to a text file.I have the Mac Edition EVGA Nvidia GTX 680 which has UGA driver so it works. But the goal is to be able to use non-UGA graphics GOP cards like AMD and newer Nvidia. RefindPlus and OpenCore have UGAPassThrough which is a UGA on GOP driver. I would also like to try a GOP on UGA driver since there is a EFI screen shot driver that requires GOP that I would like to be able to use to get a screen shot of the Startup Manager.Nvidia Kepler cards work in Mojave and above, but they do not seem to provide boot screens with bootloaders like RefindPlus or OpenCore. Luckily there is a Mac EFI file for the GTX 770 which worked perfectly on my "Founders Edition" card.
Currently, there's an issue where the first stage boot process doesn't appear on my GOP card. RefindPlus is visible on my GOP card, but the first stage boot appears on my UGA card. So that's another issue I would like to get fixed.
So the apfs.efi driver sets a flag that says this Mac can boot apfs? Maybe it's an nvram thing. Or maybe a feature flag?At first I tried to install High Sierra before installing the AFPS and NVMe drivers for rEFInd. I thought this would not be an issue, as the High Sierra installer can see both NVMe and APFS drives. The installer refused to install in a APFS-formatted drive. This is reasonable, as the end result would be an unbootable system, but I wondered how Apple implemented this. Normally the kernel should know nothing of the pre-boot environment. All of it disappears once boot.efi calls ExitBootServices(). There must be some undocumented mechanism for passing information from EFI to macOS.
OpenCore has a list of firmware feature flags at https://github.com/acidanthera/Open...nclude/Apple/IndustryStandard/AppleFeatures.h
Does loading the apfs.efi driver change the value of this flag? It doesn't seem to on my MacPro3,1.
I have a script called gfxutil.sh that has commands to show nvram variables. One of the commands is
showfirmwarefeatures
I use my KextUtil.sh script. It will check for kext Info.plist, bundle identifier, unload existing kext, delete existing kext, copy the kext, fix the permissions and ownership, move the copy to /Library/Extensions, and load it.At first I tried installing mouSSE from the Catalina patcher USB drive. It copied the kext to /Library/Extensions/ but the kext was not loaded. This was half expected as cache rebuild is incompatible between Catalina and older macOS versions. I then tried to manually flush the cache with sudo kextcache -i / but received complaints about file permissions. I then followed these instructions for installing 3rd party kexts in /Library/Extensions. The kext was accepted, but MouSSEstats claimes the driver was not loaded.
My gfxutil.sh script has a commandBooting into live Linux disabled the rEFInd boot entry and put the Mac into a weird boot order loop instead of booting back to rEFInd and my NVMe High Sierra installation:
On every restart the Mac flashes the folder icon with a question mark. The boot order has now become random, with a preference on Linux. The problem persists, even after I reinstalled rEFInd.
- Restarting from Linux boots it into El Capitan.
- Restarting from El Capitan puts it into rEFInd
- rEFInd waits 20 seconds and boot into High Sierra on a NVMe drive.
- Restarting from High Sierra puts it into Linux.
I checked the boot order with efibootmgr in Linux. This is the output. rEFInd is installed on the same hard drive as Linux. El Capitan is on a SSD in the optical bay. I cannot see anything missing. rEFInd is the first item, as it should be.
Code:petri@petri-MacPro:~$ efibootmgr -v BootCurrent: 0000 Timeout: 5 seconds BootOrder: 0001,0000,0080 Boot0000* ubuntu HD(1,GPT,44c4643d-d1e7-453e-9d50-866c7787ec9a,0x800,0x100000)/File(\EFI\ubuntu\shimx64.efi) Boot0001* rEFInd Boot Manager HD(1,GPT,44c4643d-d1e7-453e-9d50-866c7787ec9a,0x800,0x100000)/File(\EFI\refind\refind_x64.efi) Boot0080* Mac OS X PciRoot(0x0)/Pci(0x1f,0x2)/Sata(4,0,0)/HD(2,GPT,3b9502a7-9747-4d32-9c34-aed695e0a632,0x64028,0xddfac40) Boot0081* Mac OS X PciRoot(0x0)/Pci(0x1f,0x2)/Sata(3,0,0)/HD(2,GPT,a10fadc5-4c84-49d6-8642-a6677afad36d,0x64028,0x25294b40) BootFFFF* PciRoot(0x0)/Pci(0x1f,0x2)/Sata(2,0,0)/HD(1,GPT,44c4643d-d1e7-453e-9d50-866c7787ec9a,0x800,0x100000)/File(\EFI\BOOT\BOOTX64.efi)
dumpallbootvars
that will show the same info in macOS. It also shows the Driver#### variables. There's also commands to change the info.One thing interesting about your ubuntu and rEFInd boot variables is that they are relative to an HD instead of absolute (from PciRoot). I guess if that works then it means you can move the drive to other locations and it will still boot. If that doesn't work then you should make them absolute.
There are a few ways to change the default boot:
- Startup Disk preferences panel
- Startup Manager (hold option at boot) - select an item and press Control-Return to make it the default
- bless command in macOS
- For FAT or EFI:
bless --mount /Volumes/xxx --file /Volumes/xxx/yyy/zzz.efi --setboot
- For HFS+ or APFS:
bless --folder /Volumes/xxx/yyy --file /Volumes/xxx/yyy/zzz.efi
- To create a disk label:
bless --folder /Volumes/xxx/yyy --label yourdisklabel
- For FAT or EFI:
setbootorder
andsetbootvar
from gfxutil.sh script- Boot Camp control panel in Windows
- EasyUEFI.exe in Windows
- etc.
The Apple Boot picker has the problem of one boot target per drive - for booting EFI, it is either the blessed file (for HFS+ or APFS) or the file with a specific name and location such as /EFI/BOOT/bootx64.efi for the EFI partition. rEFInd does not have that problem.A fundamental problem with rEFInd on a Mac is that the Apple Boot Picker application will only show one boot target for each physical drive, or at most partition.
rEFInd can choose from multiple EFI files on the same partition. It scans for EFI files in certain locations, not just files named bootx64.efi. There are flags in the refind.conf file to control what rEFInd scans. If there's no flag that makes it scan a particular location, you can add a manual entry (manual stanza) with the file path (and volume name if you want it to be specific to a single volume). Read the rEFInd documentation.The Linux drive now has two boot targets on the EFI partition of the Linux drive. How do you chose which one to boot?
You mean add the flag to Kernel Flags in the com.apple.Boot.plist file?This is what happens if you try to boot an unpatched High Sierra installation in Safe Mode. Drivers are not loaded and boot args are ignored. To get past this you need the plist patch.
This command shows the flags in the com.apple.Boot.plist file of all the mounted file systems:
grep "string" /Volumes/*/Library/Preferences/SystemConfiguration/com.apple.Boot.plist | sed -E '/(.*plist): *(.*)/s//\2 \1/; /<string>mach_kernel<\/string>/d' | sort
Maybe disconnecting internet until installation is done would help. Going into safe mode to install a kext should not be necessary.I wanted to get into safe mode to install kext manually and to rebuild the kext cache. To get into Safe Mode I pressed F2 in rEFInd and selected Safe Mode. I was able to do the second part of the installation in safe mode, but once once I entered my Apple ID password Apple locked my account. I do not know if it was because of the safe mode or because it was the 10th time I had installed High Sierra the same day.
I have not tried NVMe in 10.11 El Capitan. Maybe remove the IONVMEFamily.kext if it is causing kernel panic? It is not compatible with third party NVMe drives that use 512K block size until 10.13 High Sierra. Or you could try patching it. https://github.com/RehabMan/patch-nvmeHaving the the NVMe drive is the Mac Pro and shutting down El Capitan leads to a kernel panic. The shutdown fails at the last moment and the Mac reboots. I have sent the report to Apple at least ten times. I do not know if they care what happens in El Capitan. There is nothing unusual about having a NVMe drive in a Mac Pro 3,1 even if Apple does not support any macOS version that supports it. Linux and Windows 10 have no problems.