-
Notifications
You must be signed in to change notification settings - Fork 288
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
Discard load-options that start with WINDOWS #621
base: main
Are you sure you want to change the base?
Conversation
Windows bcdedit.exe creates boot entries where load options begin with "WINDOWS\0" (in 8-bit chars), followed by some Windows-specific data which is useless for shim. This data causes shim error "Failed to open \EFI\mypath\䥗䑎坏S". Resolves: rhboot#370 Signed-off-by: Lauri Kenttä <lauri.kentta@gmail.com>
Shim expects a filename or nothing in the load options. To avoid an error message during boot, do several things: When creating the NVRAM entry, use empty load options. The current string ("HackBGRT\0") was just a decoration, and it's luckily ignored by shim because the length is odd. When creating the entry with BCDEdit, manually fix the load options. The load options in BCDEdit entries start with "WINDOWS\0" followed by UINT32 version, as seen in ReactOS struct BL_WINDOWS_LOAD_OPTIONS. The version is 1, but BCDEdit seems to be happy with a higher number. By setting this version to 'X' (0x58), the string becomes a valid UCS-2 file name. Update the installer so that the HackBGRT loader is installed with this weird file name. The reason why the load options cannot be deleted completely is that BCDEdit will recreate the entry on next boot if it doesn't find the entry it just tried to create. See: rhboot/shim#621 See: https://github.com/reactos/reactos/blob/v0.4.7/boot/environ/include/bl.h#L911
Note: Depending on the system, these characters may be rendered as blocks or not at all. Most similar reports seem to contain either filled blocks or just the letter S, which may lead to misinterpreting the issue. Are there any active rhshim developers who could review this? |
Seems like all the shim developers are either dead or not to be found, why is no one fixing this?? |
@steve-mcintyre can you have look at this? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks plausible to me
Windows bcdedit.exe creates boot entries where load options begin with "WINDOWS\0" (in 8-bit chars), followed by some Windows-specific data which is useless for shim. This data causes shim error "Failed to open \EFI\mypath\䥗䑎坏S".
Resolves: #370