CloverHackyColor / CloverBootloader

Bootloader for macOS, Windows and Linux in UEFI and in legacy mode
BSD 2-Clause "Simplified" License
4.49k stars 617 forks source link

[SOLVED] Clover disregards GUI Custom Tool Argument #376

Closed LeeBinder closed 3 years ago

LeeBinder commented 3 years ago

verified not working not just with latest Clover 5131 but at least all the way down to r5108. ControlMsrE2.efi runs but complains that an argument is required but missing even though it indeed is defined in config.plist: Screenshot_1 after key press: Screenshot_2 after key pressed

<dict>
    <key>Volume</key>
    <string>\</string>
    <key>Path</key>
    <string>\EFI\Clover\Tools\ControlMsrE2.efi</string>
    <key>Arguments</key>
    <string>unlock</string>
    <key>FullTitle</key>
    <string>1-ControlMsrE2</string>
    <key>Hotkey</key>
    <string></string>
    <key>Hidden</key>
    <false/>
    <key>Disable</key>
    <false/>
    <key>Ignore</key>
    <false/>
</dict>

Below how's it's supposed to looke like - photo of ControlMsrE2.efi w/ arg unlock evoked from OC: Screenshot

The parameter must follow ControlMsrE2.efi without a preceding - only divided by a space, like this:

ControlMsrE2.efi unlock

I also tried <string>"unlock"</string> and <string>'unlock'</string> and also <string> unlock</string> , <string> "unlock"</string> and <string> 'unlock'</string>

Here's the .zip with everything you need so you can replicate the bug in your setup: GUI Custom Tool Arguments disregarded.zip

LeeBinder commented 3 years ago

tested all the way down to r5108 - same thing. Must be an old hidden and unsolved bug.

LeeBinder commented 3 years ago

source code (thanks to cecekpawon for the pointer): https://github.com/zhen-zen/OpenCorePkg/tree/ControlMsrE2/Application/ControlMsrE2

LeeBinder commented 3 years ago

on Mar 21, 2021, 7:21 AM GMT+1 @SergeySlice wrote:

ControlMsrE2.efi works as well in Clover 5131 with Shell provided with the Clover. IMG_0480

yes, it works fine if run via shell. What happens when you run it from Tools on your computer - does it work from there for you, either with any of the 3 arguments

<dict>
    <key>Volume</key>
    <string>\</string>
    <key>Path</key>
    <string>\EFI\Clover\Tools\ControlMsrE2.efi</string>
    <key>Arguments</key>
    <string>unlock</string>
    <key>FullTitle</key>
    <string>1-ControlMsrE2</string>
    <key>Hotkey</key>
    <string></string>
    <key>Hidden</key>
    <false/>
    <key>Disable</key>
    <false/>
    <key>Ignore</key>
    <false/>
</dict>

or even with empty <key>Arguments</key> <string></string>?

jief666 commented 3 years ago

Should work now with the latest commit, or this efi : CLOVERX64.efi.zip

Please test. If works, close this issue please.

LeeBinder commented 3 years ago

@jief666 sorry but no, error persists here. Additionally I even just tried the latest ControlMsrE2.efi compile, both release and debug version.

I verified Clover really did boot from the CLOVERX64.efi from your link, renamed and copied to EFI/BOOT/BOOTX64.efi:

screenshot0

I even tried the trick which works with Brummbär's original CFGlock.efi - as an intermediate step first open my Laptop's UEFI BIOS boot menu, but still no-go.

Does ControlMsrE2.efi work for you via tools? If so, maybe you could zip and attach your EFI folder - (minus) themes and SMBIOS data in config.plist.

jief666 commented 3 years ago

Send your debug.log...

LeeBinder commented 3 years ago

sure - can do tomorrow - have to leave right this second

LeeBinder commented 3 years ago

Send your debug.log...

here you go -> 2021-3-23_20-27_BOOTX64.EFI.log.zip

also preboot.log, for what it might be worth -> preboot.log.zip

jief666 commented 3 years ago

That is the log for when you boot macOS. I'd like the log when you tried to boot ControlMsrE2.efi.

jief666 commented 3 years ago

Also, in that log, I don't see any custom tool "ControlMsrE2.efi".

LeeBinder commented 3 years ago

Also, in that log, I don't see any custom tool "ControlMsrE2.efi".

screenshot

config.plist.zip

That is the log for when you boot macOS. I'd like the log when you tried to boot ControlMsrE2.efi.

this time I invoked both via Clover > tools, ControlMsrE2.efi and ControlMsrE2_debug.efi while Clover > Boot > Debug is enabled - hopefully efi tools log into that debug log, too.

2021-3-23_21-18_BOOTX64.EFI.log.zip

jief666 commented 3 years ago

Thanks, your config.plist and log were helpful. I didn't realize it was a custom tool and not a custom entry. Should work now. Compile last commit or : CLOVERX64.efi.zip

LeeBinder commented 3 years ago

I didn't realize it was a custom tool and not a custom entry.

my bad - should've set the issue title to double-size and red .. ;)

Should work now. Compile last commit or : CLOVERX64.efi.zip

YES, you ROCK as usual - finally the arg is being passed over - great job!

Clover still needs the UEFI BIOS boot menu to be invoked first to initiate the MSR E2 register so that both, ControlMsrE2.efi and CFGLock.efi find it if called via Clover, but oh well, that's a minor oddity in contrast to OC. Fair enough/ fine for now.

Thanks again @jief666 for solving this Bug!

jief666 commented 3 years ago

my bad - should've set the issue title to double-size and red .. ;)

Of course NOT. I never used Custom tool and I misinterpreted it as a tool configured as a custom entry. My bad.

Clover still needs the UEFI BIOS boot menu to be invoked first

Not sure to understand that. If you'd like an improvement, it maybe possible...

LeeBinder commented 3 years ago

Not sure to understand that. If you'd like an improvement, it maybe possible...

I explained it here. This applies not only to CFGLOck but also to ControlMsrE2.efi. For OC that's not necessary - all CFG unlock tools find the register right away w/o detour/ extra step through UEFI boot menu for initialization. No idea if this is on Asus VivoBook only or also on other hardware. I could only test on a AMD computer, but from what I read it won't have CFG locked to begin with.

What about on our hack if you run ControlMsrE2.efi from Tools in Clover?

jief666 commented 3 years ago

I explained it here.

What you explained here is now possible again, right ?

Clover still needs the UEFI BIOS boot menu to be invoked first

I don't know what means : Clover finds UEFI Bios boot menu.

w/o detour

No idea what is that "detour".

What about on our hack if you run ControlMsrE2.efi from Tools in Clover?

Something like : "register not found". I'm not even sure what is MsrE2, but I don'thave that, I think.

LeeBinder commented 3 years ago

jief, thanks for being willing to dig even deeper into this, but if all this does not tell you anything, it's OK to just forget about it - it's fine enough now the way it is after your corrections. The extra step with having to enter the UEFI boot menu before running Clover for MSR E2 register detection and flipping the bit might just be an Asus Vivobook S15 oddity, so we can simply let it slide for now. I'd say it might help more Clover users to rather focus on the other issues here :)