-
Notifications
You must be signed in to change notification settings - Fork 519
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
update grub to 2.06 and implement hybrid boot support for x86_64 #1701
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Signed-off-by: Ben Cressey <[email protected]>
Previously we built x86_64 images for BIOS only; now we want to build them for EFI as well. This cleans up the GRUB related macros, which assumed a single target per architecture, and special cases the BIOS build for x86_64. Signed-off-by: Ben Cressey <[email protected]>
Canceled the workflow since I still need to upload the grub source rpm to the lookaside cache. |
arnaldo2792
reviewed
Aug 9, 2021
tjkirch
approved these changes
Aug 17, 2021
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.
Nice work.
arnaldo2792
approved these changes
Aug 17, 2021
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.
🛥️
This moves to Amazon Linux as our upstream, by way of Fedora. Fedora's patches include an implementation of Secure Boot support, as well as many other fixes that are not yet upstream. Amazon Linux's patches include fixes for console handling in EC2, and on metal instances in particular. They also add an option to disable module loading, which eliminates a potential vector for altering the boot process. Signed-off-by: Ben Cressey <[email protected]>
Split the configs so we can change the default terminal output based on whether we're booting from the BIOS or EFI image. Signed-off-by: Ben Cressey <[email protected]>
The modules we need are all built into the firmware image. Signed-off-by: Ben Cressey <[email protected]>
This allows us to boot compressed kernels for platforms like aarch64 where the kernel does not support decompressing itself. Signed-off-by: Ben Cressey <[email protected]>
Instead of a single "firmware" partition for either BIOS or EFI, we now create the BIOS partition for all architectures, and ignore it except for the x86_64 use case. Two EFI partitions are allocated out of previously reserved space. Only the first one is used today; using the second one would require a scheme to swap the partition types on upgrade, since EFI firmware will not understand the significance of the GPT priority bits. The result is a hybrid x86_64 image capable of booting under legacy BIOS or EFI. With BIOS, the MBR will point to the next GRUB stage in the BIOS boot partition. With EFI, the firmware will look for the EFI system partition. In either case, the GRUB image will find the right boot partition by checking GPT priorities, and load the configuration file from there. Signed-off-by: Ben Cressey <[email protected]>
bcressey
force-pushed
the
grub-efi-hybrid
branch
from
August 17, 2021 23:51
aa50ded
to
7bd3f70
Compare
tjkirch
approved these changes
Aug 18, 2021
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Issue number:
Fixes #1697
Description of changes:
Update grub to 2.06, from Amazon Linux by way of Fedora. Build both EFI and BIOS images for GRUB.
Adjust default grub configurations to take advantage of the improved console support on EFI and BIOS, and to disable module loading for security reasons.
Implement hybrid support for x86_64 images, so they work with either BIOS or EFI firmware.
Testing done:
Verified that the GPT priority functionality works correctly by following these steps for x86_64 (BIOS, EFI) and aarch64 (EFI):
Verified that the grub console output was visible on these platforms:
Output was not visible for the VMware guest under EFI, although the guest booted OK. I don't consider this a blocker since we default to BIOS on that platform.
Terms of contribution:
By submitting this pull request, I agree that this contribution is dual-licensed under the terms of both the Apache License, version 2.0, and the MIT license.