Jump to content

Clover UEFI secure boot and NVRAM emulation


Melab
 Share

5 posts in this topic

Recommended Posts

I've read that there is a "-DENABLE_SECURE_BOOT" available for compiling Clover. Does this mean that Clover can emulate secure boot when it's installed on a system that uses a legacy BIOS? If so, how do I setup keys/hashes for it?

 

I've seen threads on this website that mention Clover emulating NVRAM, but details are scarce. Assuming it can emulate NVRAM, in what file is the data stored? Is there a size limit? What are the limitations?

Link to comment
Share on other sites

1. Secure boot is possible butClover should be compiled with the definition ENABLE_SECURE_BOOT. Release Clover did not. The you have to fill some fields in config.plist, sign the CloverX86.efi with some tool and then set secure keys into BIOS. I don't know details. Ask @apianti about all this.

2. If you can't get native NVRAM working then you can use Clover feature "emulated NVRAM". To do this you have to place the driver EmuVariableUEFI.efi into /EFI/CLOVER/drivers/UEFI/ and install rc scripts into your macOS. To do this look carefully into Clover installer. Each reboot or shutdown the content of the emulated NVRAM will be saved into the file "nvram.plist" into the root of your system. Then at Clover start the file will be read again into "emulated NVRAM" keeping it non-volatile at reboot.

3. nvram.plist has no reasonable limitations. It can be 1Gb of size but it is unreal.

I can tell ten time more about this but I am not sure if my explanations are useful.

Link to comment
Share on other sites

  • 4 weeks later...
4 hours ago, maclinuxG4 said:

if you switch emulate NVRAM into native, dont forget to copy your last  nvram.plist  one another folder of EFI.

slice, 1 Gb in EFI ( 255 Mo generally MAX in EFI partition). Sur ?

I just said that there is no reasonable limitation. Not 10 bytes, not 10kb, not 10Mb.... only size of storages.

Link to comment
Share on other sites

  • 1 year later...
On 8/5/2020 at 3:26 PM, maclinuxG4 said:

if you switch emulate NVRAM into native, dont forget to copy your last  nvram.plist  one another folder of EFI.

somewhat of an old topic, but still: I have no idea what you mean. Do you think you can just copy a (properly structured) nvram.plist into the EFI partition with Clover, or into EFI/EFI/Clover, and Clover would process it on startup and inject its content as values into NVRAM? Nowhere in any Clover documentation including on github.com/5T33Z0/Clover-Crate I ever ready anything like that.

 

As per OC2Clover#nvram--add, NVRAM entries that can manually be entered into Clover config.plist for injection on boot are e.g. boot-args (in Boot section) and csr-active-config (in RtVariables section), just to name the two main ones I can think of right now.

 

@Slice you do offer reset NVRAM via the F11 key. Sometimes that is of tremendous help to solve oddities, esp. when installing a completely new version of macOS. I esp. like that your flavor of NVRAM reset does NOT touch the UEFI BIOS boot menu entries but leaves them intact!

 

It also comes in very handy that you gave us a way to keep significant NVRAM entries even after reset like the SIP state via csr-active-config.

 

What has really proven troubling over time is that there is at least one important value that gets lost, which is the TRIM state to keep our non-Apple SSDs healthy and alive. After quite some experimenting I can say that enabling TRIM for SSD (com.apple.iokit.IOAHCIBlockStorage) in KernelandKextPatches > KextsToPatch is not always enough for non-NVMe SSDs. That's bad news because:

 

Quote

Once you make the choice stick with it; ie you do not want to be flipping back and forth as this will lead to data corruption. (source @ discussions.apple.com)

 

In that context:

 

1. if possible, can you please add a new section "NVRAM" analog to OC 7C436110-AB2A-4BBB-A880-FE41995C9F82 with the possibility to add (+ edit/ remove) any desired name and value?

2. If that's too much for now, can you please add an input option "EnableTRIM" to the RtVariables section, with a textfield to enter a value?

 

That would be really helpful.

 

Thanks again Sergey for all your great work 😎

Edited by BuXb
Link to comment
Share on other sites

 Share

×
×
  • Create New...