-
Notifications
You must be signed in to change notification settings - Fork 165
Replace EFI boot entry during conversion #1466
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
base: main
Are you sure you want to change the base?
Conversation
Thank you for contributing to the Leapp project!Please note that every PR needs to comply with the leapp-repository contribution and development guidelines and must pass all tests in order to be mergeable.
Packit will automatically schedule regression tests for this PR's build and latest upstream leapp build.
Note that first time contributors cannot run tests automatically - they need to be started by a reviewer. It is possible to schedule specific on-demand tests as well. Currently 2 test sets are supported,
See other labels for particular jobs defined in the Please open ticket in case you experience technical problem with the CI. (RH internal only) Note: In case there are problems with tests not being triggered automatically on new PR/commit or pending for a long time, please contact leapp-infra. |
1682df4 to
b04df4d
Compare
|
I've found an interesting setup when testing CS9->RHEL10.1 on particular VM instance (ping me for details). The CS entry is already called Red Hat Enterprise Linux on the source system despite it pointing to the CS efidir: The entry was correctly removed by the actor, because we removed it based on BootCurrent boot entry number. Just noting. |
f031c64 to
fecc8c6
Compare
9bae012 to
2d04536
Compare
The grub library has been used for all things related to booting,
including also utilities related to EFI and "partitions".
This patch splits the unrelated information grub library into multiple
dedicated libraries:
- grub - now only grub related utilities
- firmware - contains the is_efi and is_bios helpers
- firmware/efi - utilities related to EFI
- partitions - contains utilities related to partitions and devices, used by
both grub and efi
2d04536 to
601491f
Compare
Functions in efi library now raise efi.EFIError instead of StopActorExecutionError.
After an upgrade+conversion, the upgraded system might end up with an EFI boot loader entry from the source system pointing the shim or grub EFI binary from the source system. E.g. Centos Stream pointing to \EFI\centos\shimx64.efi instead of Red Hat Enterprise Linux pointing to \EFI\redhat\shimx64.efi. This patch introduces a new convert/updateefi actor that adds a new EFI boot entry for the target system with the correct EFI binary, removes the source system directory on ESP, e.g /boot/efi/EFI/centos, and finally removes the source system EFI boot entry. This is handled for both x86_64 and aarch64 EFI systems. This currently does not work with SecureBoot enabled. The problem probably is, in my understanding, that the shim and grub only contain keys for verifying signatures of the source distro. Our upgrade boot entry uses the target distros kernel, which is signed by the target distro. And so the shim/grub of the source distro rejects it. Jira: RHEL-133549
The EFI bootloader entry replacement during conversion, handled by the convert/updateefi actor, does currently not handle secure boot. This patch adds the convert/securebootinbihit actor that inhibits secureboot during conversion, regular upgrade is not affected. Jira: RHEL-133549
601491f to
8ae0a4d
Compare
|
On python3.6 linter complains if I don't add I will maybe need to move the test out of the class, but then the fixture name needs to be uglier. |
|
I now consider this ready for full review, there are just some minor things I will change (reports and the linter problem mostly). |
After an upgrade+conversion we want the EFI boot entry to have the name of the target OS (e.g. Red Hat Enterprise Linux, when converting from CS->RHEL). The source distro boot entry and also EFI directory (e.g.
/boot/efi/EFI/centos/) should be removed.This PR:
common.firmware- contains is_efi and is_bioscommon.grublibrary that are not related to grub to 2 new libraries:common.firmware.efi- functions related to EFI, StopActorExecutionErrors changed to EFIErrorcommon.partitons(name suggestions are) welcome - operations on disks/parititions - this is used by both efi and grub lib/boot/efi/EFI/centos/).Jira: RHEL-133549
TODO