-
Notifications
You must be signed in to change notification settings - Fork 45
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
rhboot/shim cannot directly load OpenCore.efi after recent build tooling changes #2239
Comments
This has been tested on the shim which came with Fedora, and on a built shim from Arch https://archlinux.org/packages/community/any/shim/download/ - same result. I believe the same issue is also occurring in own-build shim from source, though this is not thoroughly tested - I switched back to pre-built shims as I (initially) thought this issue might be a result of an error in how I built/configured own-build shim. |
In OVMF, where I have been doing most testing, 1st and 3rd options (i.e. normal ways of starting OC) work. 2nd and 4th start the images (you can see early debug o/p), but generate errors and crash OVMF early. The named boot options above start what you would think they would start. For the shimmed versions, a copy of OC's /EFI/BOOT/BOOTx64.efi has been made, called grubx64.efi, in its directory, and a copy of /EFI/OC/OpenCore.efi has been made, called grubx64.efi, in its directory. (Worth noting, going forwards, that own-build shim can easily be configured, via its existing make options, to chain to OpenCore.efi directly, with no renaming necessary, but this is not done here.) |
And to give a little more context on exactly what I am seeing: The error case (first screenshot) shown above is starting /EFI/OC/OpenCore.efi (renamed to grubx64.efi) directly (i.e. shim->oc, not shim->grub->oc) from shimx64.efi in the same directory. I can single step into this, once started, using lldb (I have just added a The first screenshot is the error case, the second screenshot is the very same OpenCore.efi, loaded in the very same OVMF setup, but started using a boot entry which points to it directly, rather than starting it via a boot entry which points to /EFI/OC/shimx64.efi. |
FWIW IDA can load the problem OpenCore.efi fine - the function pointers in question are pointing to sane code in a .text section. Given that IDA loads it, and presumably lots of people's BIOSes are loading it, it is starting to seem as if shim is the code that is quirky... so also (assuming my whole issue isn't off, for some reason) that a PR might be needed... |
As requested, attached are EFIs showing the problem:
|
I think I was trying to achieve the same thing as you: I have signed my OpenCore files with
Still I would have expected it to work if I boot into grub and select the Mac entry (it works with SB disabled), but grub displayed the error:
|
There are people on reddit reporting two years ago that exactly that worked: |
Closing this as fixed by PR from the OC team accepted into rhboot/shim. |
See also #2237. |
See also acidanthera/OpenCorePkg#484, which finishes off the project of actually using the accepted change to Shim. |
Pre-existing GRUB2 shim (not recompiled) is failing to load recent OpenCore.efi (renamed to grubx64.efi) correctly.
A part of the code linked code within OpenCore is zero when it should be initialized (specifically - though there may be others, this is encountered first - all of the memory pointed to by the function pointers in
mUefiDevicePathLibToTextTable
is zero) (so - it may or may not be worth noting - this is all code which is linked only via static variable pointers to it, but not sure if this is what matters). The same pointers are working (pointing to valid code) when the same, current OpenCore.efi file is loaded 'normally' (by any BIOS, but including by OVMF). Also, chaining from the very same shim works fine with older 0.8.7 OpenCore.efi. Is this even supposed to work? It seems like it should, as presumably loads of old loaders have to sucessfully load our newly compiled OpenCore.efi.(FYI Not that it probably matters too much, but I am attempting to use rhboot/shim before OC instead of before GRUB2 as I think it may be an easy and clean way to combine Linux MOK handling with OpenCore. Most likely as something to encourage advanced users to compile for themselves.)
The text was updated successfully, but these errors were encountered: