Contribute
Register

EFI Agent v1.3.2 (menu bar utility)

@headkaze,

I was thinking about such a feature earlier but did not want to bother you something that probably only effects a very few users like me who boot MacOS in an unusually way such as booting from a different partition to the one on the system drive.

No, I do that too - boot from Clover on USB to NVME on an old X58 board.
 
Last edited:
@headkaze,

Not sure if you have already considered it but there is one sure fire way to find the UUID of the EFI partition Clover was booted from on ALL systems and boot configurations by using the output of bdmesg :-

Toward the top of the output there is the property named SelfDevicePath which contains the Partition UUID that Clover was booted from, here is an example output from my desktop system ...

Code:
0:100  0:000  SelfDevicePath=PciRoot(0x0)\Pci(0x1F,0x2)\Sata(0x0,0xFFFF,0x0)\HD(1,GPT,0FBD5BD2-AE6A-4F30-BDD6-F8ABABD7E795,0x28,0x64000) @B259DB98
0:100  0:000  SelfDirPath = \EFI\BOOT


We can parse the output of bdmesg for the EFI/Clover boot Partition UUID with the following command :-

Code:
bdmesg | grep -i "SelfDevicePath=" | cut -d "," -f 6


Which will return just the Partition UUID :-

Code:
0FBD5BD2-AE6A-4F30-BDD6-F8ABABD7E795


I've run that bdmesg grep command on all my different MacOS Hackingtosh systems and it appears to always return the correct Partition UUID that Clover was booted from.

Its not a pretty or elegant method for sure but it should it would work for all systems booted with Clover and would get around unusual boot configurations such as mine (and others) ... you would only have to execute and parse bdmesg once when EFI Agent or Hackingtool initialises.

Note: bdmesg is a Clover utility that is installed by the Clover installer and is not a standard MacOS command so I guess you would need to check that it is installed first in /usr/local/bin ... if it is then you could use that as the primary method to find the EFI Boot Partition .. if its not installed then fall back to using one of the other methods.

Just a suggestion ...

Cheers
Jay
 
Last edited:
Hummmm .. looks like it's still leaking ... ?

I'll let the latest build run for a few hours on my desktop system and see if it does the same.

Cheers
Jay

Actually, it varies in size - I noticed it was much smaller later in the day.

I'd have thought the memory usage should be pretty static - nothing is changing except my one working USB which I attach when I arrive and then detach when I leave.
 
Actually, it varies in size - I noticed it was much smaller later in the day.

I'd have thought the memory usage should be pretty static - nothing is changing except my one working USB which I attach when I arrive and then detach when I leave.
I'm guessing it's getting garbage collected eventually but it seems strange the memory usage gets so high. I will do some more in depth leak analysis soon just incase.
 
Toward the top of the output there is the property named SelfDevicePath which contains the Partition UUID that Clover was booted from, here is an example output from my desktop system ...
Thanks for letting me know. bdmesg is not required as the log is actually stored in IORegistry (IOService:/boot-log or IODeviceTree:/efi/platform/boot-log) so I can easily read the path from there.

Please try EFI Agent 1.2.3 which will now attempt to use SelfDevicePath first, then IODeviceTree:/options/efi-boot-device, then IODeviceTree:/chosen/boot-device-path. If all of those fail you can now set the Boot EFI via the context-menu. Haven't had a chance to do any major testing yet though.
 
Last edited:
Thanks for letting me know. bdmesg is not required as the log is actually stored in IORegistry (IOService:/boot-log or IODeviceTree:/efi/platform/boot-log) so I can easily read the path from there.


Ahh ok, i did not know that ... makes much more sense to read the value from the ioreg rather than messing around executing and parsing bash commands.

Please try EFI Agent 1.2.3 which will now attempt to use SelfDevicePath first, then IODeviceTree:/options/efi-boot-device, then IODeviceTree:/chosen/boot-device-path. If all of those fail you can now set the Boot EFI via the context-menu. Haven't had a chance to do any major testing yet though.


@headkaze,

very cool ... have just downloaded and installed version 1.2.3, and as you can see from the following screen shot its now working correctly with the non standard boot config on my desktop system :-

Screenshot 2019-04-17 at 23.57.44.png


Looks like it picked up the correct UUID from SelfDevicePath all by its-self and is now highlighting the correct EFI Partition where I boot Clover from .... very nice work.

I also tested (several times) manually setting the Boot Partition to one of the other EFI Partitions using the context menu option which seems to work as expected without any issues. Question: Where are you storing the value ? ... Just curious if your updating/creating IODeviceTree:/options/efi-boot-device, or IODeviceTree:/chosen/boot-device-path ?

EFI Agent Should now work with all boot configurations, even those not using Clover .... I assume you'll incorporate the new code in Hackingtool in some future release ? .... I really appreciate the time and effort you put into resolving this.

I also see that you now save the vertical divider position, yet another small but handy feature :)

Top marks buddy :thumbup::thumbup::thumbup::thumbup::thumbup: (5 out of 5)

Cheers
Jay
 
Last edited:
I'm guessing it's getting garbage collected eventually but it seems strange the memory usage gets so high. I will do some more in depth leak analysis soon just incase.

left overnight, it's sitting at a frugal 232MB this morning.
 
Back
Top