Contribute
Register
Status
Not open for further replies.
Ok, is the process tricky? Did you follow any guide here or elsewhere?
There are a few guides for that here. You can find info here. Have you notice that most bootable drives have a file name bootx64.efi? Yes, this file can be substitute by a modified grub shell file by renaming the file to bootx64.efi
You can even use the macOS USB installer to do this and after you're done then rename back the original file. I'm not quite sure but I think another way that can be done is dropping the file in the tools folder and while you boot with clover using the USB drive you press any key to stop a the boot screeen and then from the shell you can use the mod grub from the tools folder to run the command that sets the variable you need that enables NVRAM write. The tricky part is finding out which is the variable you are going to change.
In my case the command I use is: setup_var_3 0x4EF 0x00 Notice that I typed in red the variable that is going to be change and that's what you need to find out by analizing your UEFI/BIOS firmware with a couple of tools. This command changes the default value from 0x01 to 0x00, this basicly is switching Yes/true to No/false. I think your in luck because all or most Gigabyte Z170X series motherboards uses the same variable which means that this exact command might work for you without having to dig analizing your firmware to find out which variable you need to change. Which UEFI/BIOS version you have in your motherboard? I can download it and check the firmware.
 
Last edited:
There are a few guides for that here. You can find info here. Have you notice that most bootable drives have a file name bootx64.efi? Yes, this file can be substitute by a modified grub shell file by renaming the file to bootx64.efi
You can even use the macOS USB installer to do this and after you're done then rename back the original file. I'm not quite sure but I think another way that can be done is dropping the file in the tools folder and while you boot with clover using the USB drive you press any key to stop a the boot screeen and then from the shell you can use the mod grub from the tools folder to run the command that sets the variable you need that enables NVRAM write. The tricky part is finding out which is the variable you are going to change.
In my case the command I use is: setup_var_3 0x4EF 0x00 Notice that I typed in red the variable that is going to be change and that's what you need to find out by analizing your UEFI/BIOS firmware with a couple of tools. This command changes the default value from 0x01 to 0x00, this basicly is switching No/false to Yes/true. I think your in luck because all or most Gigabyte Z170X series motherboards uses the same variable which means that this exact command might work for you without having to dig analizing your firmware to find out which variable you need to change. Which UEFI/BIOS version you have in your motherboard? I can download it and check the firmware.
I just confirm, your motherboard uses the same var. You don't need to investigate unless you want to learn to do it your self. Just use the command: setup_var_3 0x4EF 0x00
Another tip: in your UEFI/BIOS settings there is an option available to save your
UEFI settings to a USB drive. Then every time you factory default your settings you don't have go through all this again, just use your backup and restore settings which will enable again NVRAM write. No need to use mod grub with command again. This is very usefull because when update UEFI/BIOS firmware we have to do this all over again unless we restore the UEFI settings with a backup.
 
I have the latest BIOS (F23g) and you're right, the VarOffset is indeed 0x4EF.

Code:
0x33346     Form: View/Configure CPU Lock Options, FormId: 0x2734 {01 86 34 27 11 07}
0x3334C         One Of: CFG Lock, VarStoreInfo (VarOffset/VarName): 0x4EF, VarStore: 0x1, QuestionId: 0x24B, Size: 1, Min: 0x0, Max 0x1, Step: 0x0 {05 91 B4 08 B5 08 4B 02 01 00 EF 04 10 10 00 01 00}
0x3335D             One Of Option: Disabled, Value (8 bit): 0x0 {09 07 04 00 00 00 00}
0x33364             One Of Option: Enabled, Value (8 bit): 0x1 (default) {09 07 03 00 30 00 01}


Thanks mate! I will try next week...
 
I have the latest BIOS (F23g) and you're right, the VarOffset is indeed 0x4EF.

Code:
0x33346     Form: View/Configure CPU Lock Options, FormId: 0x2734 {01 86 34 27 11 07}
0x3334C         One Of: CFG Lock, VarStoreInfo (VarOffset/VarName): 0x4EF, VarStore: 0x1, QuestionId: 0x24B, Size: 1, Min: 0x0, Max 0x1, Step: 0x0 {05 91 B4 08 B5 08 4B 02 01 00 EF 04 10 10 00 01 00}
0x3335D             One Of Option: Disabled, Value (8 bit): 0x0 {09 07 04 00 00 00 00}
0x33364             One Of Option: Enabled, Value (8 bit): 0x1 (default) {09 07 03 00 30 00 01}


Thanks mate! I will try next week...
In your pic I can see that the value is 0x1 which means is lock. But I'm almost sure you will be able to unlock it.:lol:
 
Done!
Not sure about the real benefits as (I think) I already had native NVRAM, but that can only be good... :)
Thanks again!
Remember to uncheck all fixes on the kernel and patches option.
These are not needed when native NVRAM Write is enable.
Uninstall any NVRAM emulation/RC scripts.
Remove EmuVariableUefi from EFI/CLOVER/Drivers folder.
(Usually this is done when installing clover boot loader or when building USB macOS installer with Unibeast)
Screen Shot 2020-06-03 at 1.38.57 PM.png
 
Last edited:
@tecnicasopr, I don't know if it's related, but since I unlocked the MSR, I have sleep/wake problem...
Code:
pmset -g log | grep -i failure
2020-06-07 14:57:52 +0200 Failure                 Failure during sleep: 0xFFFFFFFF0000001F : EFI/Bootrom Failure after last point of entry to sleep            
2020-06-08 00:17:02 +0200 Failure                 Failure during sleep: 0xFFFFFFFF0000001F : EFI/Bootrom Failure after last point of entry to sleep            
2020-06-08 13:44:19 +0200 Failure                 Failure during sleep: 0xFFFFFFFF0000001F : EFI/Bootrom Failure after last point of entry to sleep            
2020-06-08 16:11:45 +0200 Failure                 Failure during sleep: 0xFFFFFFFF0000001F : EFI/Bootrom Failure after last point of entry to sleep            
2020-06-08 17:14:06 +0200 Failure                 Failure during sleep: 0xFFFFFFFF0000001F : EFI/Bootrom Failure after last point of entry to sleep            
2020-06-08 18:32:31 +0200 Failure                 Failure during sleep: 0xFFFFFFFF0000001F : EFI/Bootrom Failure after last point of entry to sleep            
2020-06-09 01:06:26 +0200 Failure                 Failure during sleep: 0xFFFFFFFF0000001F : EFI/Bootrom Failure after last point of entry to sleep

It seems to be the same problem as @patrick797 in this thread.
Still investigating what's the exact cause, but haven't found anything so far...
Any Idea?
 
Last edited:
@tecnicasopr, I don't know if it's related, but since I unlocked the MSR, I have sleep/wake problem...
Code:
pmset -g log | grep -i failure
2020-06-07 14:57:52 +0200 Failure                 Failure during sleep: 0xFFFFFFFF0000001F : EFI/Bootrom Failure after last point of entry to sleep          
2020-06-08 00:17:02 +0200 Failure                 Failure during sleep: 0xFFFFFFFF0000001F : EFI/Bootrom Failure after last point of entry to sleep          
2020-06-08 13:44:19 +0200 Failure                 Failure during sleep: 0xFFFFFFFF0000001F : EFI/Bootrom Failure after last point of entry to sleep          
2020-06-08 16:11:45 +0200 Failure                 Failure during sleep: 0xFFFFFFFF0000001F : EFI/Bootrom Failure after last point of entry to sleep          
2020-06-08 17:14:06 +0200 Failure                 Failure during sleep: 0xFFFFFFFF0000001F : EFI/Bootrom Failure after last point of entry to sleep          
2020-06-08 18:32:31 +0200 Failure                 Failure during sleep: 0xFFFFFFFF0000001F : EFI/Bootrom Failure after last point of entry to sleep          
2020-06-09 01:06:26 +0200 Failure                 Failure during sleep: 0xFFFFFFFF0000001F : EFI/Bootrom Failure after last point of entry to sleep

It seems to be the same problem as @patrick797 in this thread.
Still investigating what's the exact cause, but haven't found anything so far...
Any Idea?
Most of the times the sleep problems are related with USB ports or a Bad implemented USB port patch/kext. Changing BIOS settings or power settings can possibly create problems.
I always do a few things after doing changes that can break sleep.
Delete all PowerManagement files (I have 2 but I think once I saw 3 or 4 of them) at: Library/Preferences
Screen Shot 2020-06-08 at 9.04.23 PM.png

Rebuild KextCache & Repair Permissions.
If necessary at the clover boot screen press F11 to clear NVRAM and reboot again.
After boot test sleep again.
There are also some apps that helps with the cleaning automatically like Mac Optimizer.
 
Status
Not open for further replies.
Back
Top