Contribute
Register

EFI Agent v1.2.7 (menu bar utility)

jaymonkey

Moderator
Joined
Aug 27, 2011
Messages
2,541
Motherboard
ASRock-Z97 EX6
CPU
i7-4790K OC @ 4.8GHz
Graphics
Vega 64LC + HD4600
Mac
MacBook Air, MacBook Pro
Mobile Phone
Android, iOS
@headkaze,

Could you please explain how you extrapolate the boot device from IODeviceTree:/chosen/boot-device-path.

Just wondering if i can inject it using a codeless kext so that EFI Agent can highlight the correct device on my desktop.

Cheers
Jay
 
Last edited:
Joined
Jun 20, 2014
Messages
863
Motherboard
Gigabyte Aero 15X v8-BK4K4P
CPU
i7-8750H
Graphics
UHD 630 / GTX 1070 Max-Q / 4K
@headkaze,

Could you please explain how you extrapolate the boot device from IODeviceTree:/chosen/boot-device-path.

Just wondering if i can inject it using a codeless kext so that EFI Agent can highlight the correct device on my desktop.

Cheers
Jay
It would be easier to write to IODeviceTree:/options/efi-boot-device. Give me a bit and I'll write a feature to set this for you to try.
 

jaymonkey

Moderator
Joined
Aug 27, 2011
Messages
2,541
Motherboard
ASRock-Z97 EX6
CPU
i7-4790K OC @ 4.8GHz
Graphics
Vega 64LC + HD4600
Mac
MacBook Air, MacBook Pro
Mobile Phone
Android, iOS
It would be easier to write to IODeviceTree:/options/efi-boot-device. Give me a bit and I'll write a feature to set this for you to try.

@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.

Basically what i was going to propose was if EFI Agent is unable to get a valid/matching device id or volume UUID from IODeviceTree:/chosen/boot-device-path or IODeviceTree:/options/efi-boot-device then you could enable a right click context menu item on the EFI Partition list called "Mark as Boot Device" .. you could then add a custom variable to NVRAM with the volumes UUID which would then be referenced by EFI Agent and Hackingtool. Using a custom variable would ensure that it does not upset MacOS .... there would be no need to add code to remove the custom NVRAM variable as it can be done using Hackingtool's NVRAM (-) option.

However I do find it very strange that on both my Laptop and Desktop there is no efi-boot-device NVRAM variable so maybe setting that makes more sense as i guess it could fix what is wrong (missing) ....

Will be interesting to see what you come up with .... :)

The only reason I was trying to sort it myself is that on my desktop system I have 4 or 5 GUID drives that have very similar device names so having EFI Agent and Hackingtool id the boot EFI with the green highlight makes it obvious which one it is and as we have already discussed get around the problem of MacOS randomly changing the BSD name.

Thanks for taking the time to look in to it .... appreciate it buddy.

Cheers
Jay
 
Last edited:
Joined
Sep 29, 2010
Messages
18
Motherboard
Gigabyte GA-X58A-UD3R (2.0) BIOS FH
CPU
X5670
Graphics
GT740
Mac
MacBook Pro, Mac mini, Mac Pro
Mobile Phone
iOS
@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.
 

jaymonkey

Moderator
Joined
Aug 27, 2011
Messages
2,541
Motherboard
ASRock-Z97 EX6
CPU
i7-4790K OC @ 4.8GHz
Graphics
Vega 64LC + HD4600
Mac
MacBook Air, MacBook Pro
Mobile Phone
Android, iOS
Last edited:

jaymonkey

Moderator
Joined
Aug 27, 2011
Messages
2,541
Motherboard
ASRock-Z97 EX6
CPU
i7-4790K OC @ 4.8GHz
Graphics
Vega 64LC + HD4600
Mac
MacBook Air, MacBook Pro
Mobile Phone
Android, iOS
@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:
Top