Skip to content
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

grub2/efi: fix /boot/efi/EFI/redhat/grub.cfg #1229

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

rmetrich
Copy link
Contributor

@rmetrich rmetrich commented May 13, 2024

When upgrading a UEFI system with /boot on Software Raid, the /boot/efi/EFI/redhat/grub.cfg wrapper is created with unexpected content, causing the system to land into grub> prompt upon upgrade completion.

jira: https://issues.redhat.com/browse/RHEL-36186 RHEL-36249

Copy link

Thank you for contributing to the Leapp project!

Please note that every PR needs to comply with the Leapp Guidelines and must pass all tests in order to be mergeable.
If you want to request a review or rebuild a package in copr, you can use following commands as a comment:

  • review please @oamg/developers to notify leapp developers of the review request
  • /packit copr-build to submit a public copr build using packit

Packit will automatically schedule regression tests for this PR's build and latest upstream leapp build. If you need a different version of leapp, e.g. from PR#42, use /packit test oamg/leapp#42
Note that first time contributors cannot run tests automatically - they will be started by a reviewer.

It is possible to schedule specific on-demand tests as well. Currently 2 test sets are supported, beaker-minimal and kernel-rt, both can be used to be run on all upgrade paths or just a couple of specific ones.
To launch on-demand tests with packit:

  • /packit test --labels kernel-rt to schedule kernel-rt tests set for all upgrade paths
  • /packit test --labels beaker-minimal-8.10to9.4,kernel-rt-8.10to9.4 to schedule kernel-rt and beaker-minimal test sets for 8.10->9.4 upgrade path

See other labels for particular jobs defined in the .packit.yaml file.

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.

@pirat89
Copy link
Member

pirat89 commented May 13, 2024

/packit copr-build

@rmetrich
Copy link
Contributor Author

@pirat89 for your kind eyes :)

@pirat89 pirat89 added the bug Something isn't working label May 13, 2024
When upgrading a UEFI system with /boot on Software Raid, the
/boot/efi/EFI/redhat/grub.cfg wrapper is created with unexpected
content, causing the system to land into 'grub>' prompt upon upgrade
completion.

jira: https://issues.redhat.com/browse/RHEL-36186

Signed-off-by: Renaud Métrich <[email protected]>
Co-authored-by: Petr Stodůlka <[email protected]>
Copy link
Member

@pirat89 pirat89 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm. as there are RHEL tickets for this, waiting with merge until it's approved for the release. @mkluson ping

@pirat89
Copy link
Member

pirat89 commented May 14, 2024

/packit copr-build

@Macleykun
Copy link

Hi!
We stumbled across this issue during an leapp upgrade and i was wondering if @mkluson had the time to review this PR so it can be merged!

@mkluson
Copy link
Member

mkluson commented Jul 25, 2024

Hello @Macleykun,
The review has already been done by @pirat89. He mentions me as I am responsible for leapp priorities in RHEL.
Because this project is quite connected with RHEL workflows, I have to ensure I have enough RHEL recourses first.

What version of leapp, and where do you use?

@Macleykun
Copy link

Macleykun commented Jul 25, 2024

Hello @Macleykun, The review has already been done by @pirat89. He mentions me as I am responsible for leapp priorities in RHEL. Because this project is quite connected with RHEL workflows, I have to ensure I have enough RHEL recourses first.

What version of leapp, and where do you use?

hi! tottaly understand that the implications of merging this has consequences of everyone who uses leapp for rhel!
We use this version of leapp: leapp-0.17.0-1.el8
We used this on one of our internal mailservers, my collegeue stumbled across the issue after the inplace upgrade was finished:
image
We do use EFI + secureboot so we fall under this condition stated in this PR.

I am planning on testing this patch to see if that remdiates the issue if that helps with testing/ensurance.
edit: seem the issue still persists.

@mkluson
Copy link
Member

mkluson commented Jul 26, 2024

@Macleykun please follow RHEL-36249 to have the latest information when it is supposed to land in RHEL.

@morete
Copy link

morete commented Jul 30, 2024

I see same scenario happening 8.10 EFI boot and GRUB 2.06 going to cli after the initramfs inplaceupgrade runs... I can manually boot the OS on RHEL 9.4 from the GRUB cli and I see indeed the /boot/efi/EFI/redhat/grub.cfg content is not as it should... I tried "injecting" the proposed actor before running the upgrade and I see it being executed, as per the logs, but still did not solve the issue and went again into GRUB 2.06 cli after reboot...

@Macleykun
Copy link

I see same scenario happening 8.10 EFI boot and GRUB 2.06 going to cli after the initramfs inplaceupgrade runs... I can manually boot the OS on RHEL 9.4 from the GRUB cli and I see indeed the /boot/efi/EFI/redhat/grub.cfg content is not as it should... I tried "injecting" the proposed actor before running the upgrade and I see it being executed, as per the logs, but still did not solve the issue and went again into GRUB 2.06 cli after reboot...

May I ask how you were able to boot to rhel 9? I tried but couldn’t find clear steps how to do it from there.

@morete
Copy link

morete commented Jul 30, 2024

I see same scenario happening 8.10 EFI boot and GRUB 2.06 going to cli after the initramfs inplaceupgrade runs... I can manually boot the OS on RHEL 9.4 from the GRUB cli and I see indeed the /boot/efi/EFI/redhat/grub.cfg content is not as it should... I tried "injecting" the proposed actor before running the upgrade and I see it being executed, as per the logs, but still did not solve the issue and went again into GRUB 2.06 cli after reboot...

May I ask how you were able to boot to rhel 9? I tried but couldn’t find clear steps how to do it from there.

Hey @Macleykun , Sure you can ask... from the console on the GRUB cli you load the corresponding files and boot them running the following 3 commands:
linux (hd0,gpt2)/vmlinuz-5.14.0-427.26.1.el9_4.x86_64 root=/dev/{{device with root fs}}
initrd (hd0,gpt2)/initramfs-5.14.0-427.26.1.el9_4.x86_64.img
boot

note: hd0 is the disk and gpt2 is the partition where /boot is located... the grub cli has tab autocomplete which will help you.
last minute note: as in /boot/efi/EFI/redhat/grub.cfg I see it writes something to load configs from /boot/grub2/grub.cfg I just tried creating that file before running upgrade and it worked for me... so try grub2-mkconfig -o /boot/grub2/grub.cfg and then leapp upgrade... see if that works for you.

@Macleykun
Copy link

I see same scenario happening 8.10 EFI boot and GRUB 2.06 going to cli after the initramfs inplaceupgrade runs... I can manually boot the OS on RHEL 9.4 from the GRUB cli and I see indeed the /boot/efi/EFI/redhat/grub.cfg content is not as it should... I tried "injecting" the proposed actor before running the upgrade and I see it being executed, as per the logs, but still did not solve the issue and went again into GRUB 2.06 cli after reboot...

May I ask how you were able to boot to rhel 9? I tried but couldn’t find clear steps how to do it from there.

Hey @Macleykun , Sure you can ask... from the console on the GRUB cli you load the corresponding files and boot them running the following 3 commands: linux (hd0,gpt2)/vmlinuz-5.14.0-427.26.1.el9_4.x86_64 root=/dev/{{device with root fs}} initrd (hd0,gpt2)/initramfs-5.14.0-427.26.1.el9_4.x86_64.img boot

note: hd0 is the disk and gpt2 is the partition where /boot is located... the grub cli has tab autocomplete which will help you. last minute note: as in /boot/efi/EFI/redhat/grub.cfg I see it writes something to load configs from /boot/grub2/grub.cfg I just tried creating that file before running upgrade and it worked for me... so try grub2-mkconfig -o /boot/grub2/grub.cfg and then leapp upgrade... see if that works for you.

Thanks this did the trick! Thank you so much for suggesting this!
I did make the grub2 config for the original efi location and removed the one for the bios location and also that worked!
Sorry to everyone for my (unrelated) replies for this PR.

@Macleykun
Copy link

Macleykun commented Dec 1, 2024

This PR can be closed as it's now properly fixed looking at the jira ticket!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants