Bug 1731924
| Summary: | "grubby --default-kernel" returns "rpm-sort: Invalid input /boot and exit with code 0 | ||||||
|---|---|---|---|---|---|---|---|
| Product: | Red Hat Enterprise Linux 8 | Reporter: | Michal Reznik <mreznik> | ||||
| Component: | grubby | Assignee: | Bootloader engineering team <bootloader-eng-team> | ||||
| Status: | CLOSED ERRATA | QA Contact: | Release Test Team <release-test-team-automation> | ||||
| Severity: | unspecified | Docs Contact: | |||||
| Priority: | unspecified | ||||||
| Version: | 8.0 | CC: | fmartine, ivasilev, pjanda, podvody, zveleba | ||||
| Target Milestone: | rc | Flags: | pm-rhel:
mirror+
|
||||
| Target Release: | 8.0 | ||||||
| Hardware: | Unspecified | ||||||
| OS: | Unspecified | ||||||
| Whiteboard: | |||||||
| Fixed In Version: | grubby-8.40-38.el8 | Doc Type: | If docs needed, set a value | ||||
| Doc Text: | Story Points: | --- | |||||
| Clone Of: | Environment: | ||||||
| Last Closed: | 2020-04-28 16:59:27 UTC | Type: | Bug | ||||
| Regression: | --- | Mount Type: | --- | ||||
| Documentation: | --- | CRM: | |||||
| Verified Versions: | Category: | --- | |||||
| oVirt Team: | --- | RHEL 7.3 requirements from Atomic Host: | |||||
| Cloudforms Team: | --- | Target Upstream Version: | |||||
| Embargoed: | |||||||
| Attachments: |
|
||||||
Hello Michal, The problem is that /boot/loader/entries is empty and that's what grubby uses to determine what are the boot entries. I agree that the error message should be improved to mention that there are no BLS snippets in /boot/loader/entries instead of this cryptic message, but I believe that's what causing your issue. (In reply to Javier Martinez Canillas from comment #1) > Hello Michal, > > The problem is that /boot/loader/entries is empty and that's what grubby > uses to determine what are the boot entries. > > I agree that the error message should be improved to mention that there are > no BLS snippets in /boot/loader/entries instead of this cryptic message, but > I believe that's what causing your issue. Thanks for looking into this, Javier, while I agree that the error message could provide more context I've been also wondering what is the correct course of action here - i.e. who/what/how is supposed to populate the BLS snippets so that we can actually upgrade EFI systems? (In reply to Pavel Odvody from comment #2) > (In reply to Javier Martinez Canillas from comment #1) > > Hello Michal, > > > > The problem is that /boot/loader/entries is empty and that's what grubby > > uses to determine what are the boot entries. > > > > I agree that the error message should be improved to mention that there are > > no BLS snippets in /boot/loader/entries instead of this cryptic message, but > > I believe that's what causing your issue. > > Thanks for looking into this, Javier, while I agree that the error message > could provide more context I've been also wondering what is the correct > course of action here - i.e. who/what/how is supposed to populate the BLS > snippets so that we can actually upgrade EFI systems? I'm not that familiar with Leapp but on a vanilla RHEL8 the BLS snippets are populated by the kernel-install script when a kernel package is installed. There's also a grub2-switch-to-blscfg script that can be used to switch a grub configuration from non-BLS to BLS. This script also will populate the BLS snippets among other things. Seeing that bug again with uefi http://pastebin.test.redhat.com/809957 ``` [ 188.031165] upgrade[390]: 2019-10-30 07:43:18.202 DEBUG PID: 624 leapp.workflow.Finalization.kernelcmdlineconfig: External command has started: ['grubby', '--update-kernel=/boot/vmlinuz-4.18.0-147.el8.x86_64', '--args=net.ifnames=0'] [ 188.054036] upgrade[390]: rpm-sort: Invalid input [ 188.068491] upgrade[390]: The param /boot/vmlinuz-4.18.0-147.el8.x86_64 is incorrect ``` (In reply to Ina from comment #4) > Seeing that bug again with uefi http://pastebin.test.redhat.com/809957 > > ``` > [ 188.031165] upgrade[390]: 2019-10-30 07:43:18.202 DEBUG PID: 624 > leapp.workflow.Finalization.kernelcmdlineconfig: External command has > started: ['grubby', '--update-kernel=/boot/vmlinuz-4.18.0-147.el8.x86_64', > '--args=net.ifnames=0'] > [ 188.054036] upgrade[390]: rpm-sort: Invalid input > [ 188.068491] upgrade[390]: The param /boot/vmlinuz-4.18.0-147.el8.x86_64 > is incorrect > ``` This seems to be caused by /boot/loader/entries not having any BLS config file. Can you please share the content of your /boot/loader/entries directory as well as the following files /boot/grub2/grubenv and /etc/grub2-efi.cfg ? (In reply to Javier Martinez Canillas from comment #5) > (In reply to Ina from comment #4) > > Seeing that bug again with uefi http://pastebin.test.redhat.com/809957 > > > > ``` > > [ 188.031165] upgrade[390]: 2019-10-30 07:43:18.202 DEBUG PID: 624 > > leapp.workflow.Finalization.kernelcmdlineconfig: External command has > > started: ['grubby', '--update-kernel=/boot/vmlinuz-4.18.0-147.el8.x86_64', > > '--args=net.ifnames=0'] > > [ 188.054036] upgrade[390]: rpm-sort: Invalid input > > [ 188.068491] upgrade[390]: The param /boot/vmlinuz-4.18.0-147.el8.x86_64 > > is incorrect > > ``` > > This seems to be caused by /boot/loader/entries not having any BLS config > file. > > Can you please share the content of your /boot/loader/entries directory as > well as the following files /boot/grub2/grubenv and /etc/grub2-efi.cfg ? Sorry for not giving all the details in the previous comment - you are absolutely right, empty /boot/loader/entries was the cause of the failure. Yesterday I workarounded that as you advised earlier, by calling grub2-switch-to-blscfg before executing the grubby command. (In reply to Ina from comment #6) > (In reply to Javier Martinez Canillas from comment #5) > > (In reply to Ina from comment #4) > > > Seeing that bug again with uefi http://pastebin.test.redhat.com/809957 > > > > > > ``` > > > [ 188.031165] upgrade[390]: 2019-10-30 07:43:18.202 DEBUG PID: 624 > > > leapp.workflow.Finalization.kernelcmdlineconfig: External command has > > > started: ['grubby', '--update-kernel=/boot/vmlinuz-4.18.0-147.el8.x86_64', > > > '--args=net.ifnames=0'] > > > [ 188.054036] upgrade[390]: rpm-sort: Invalid input > > > [ 188.068491] upgrade[390]: The param /boot/vmlinuz-4.18.0-147.el8.x86_64 > > > is incorrect > > > ``` > > > > This seems to be caused by /boot/loader/entries not having any BLS config > > file. > > > > Can you please share the content of your /boot/loader/entries directory as > > well as the following files /boot/grub2/grubenv and /etc/grub2-efi.cfg ? > > > Sorry for not giving all the details in the previous comment - you are > absolutely right, empty /boot/loader/entries was the cause of the failure. > Yesterday I workarounded that as you advised earlier, by calling > grub2-switch-to-blscfg before executing the grubby command. Thanks for confirming. But still grubby shouldn't print a cryptic error message in this case, that would only confuse users. Reproduced on RHEL-8.2-20191120.0 x86_64 By following steps: 1) install RHEL-8.2 (EFI is not needed) 2) cp -a /boot/loader/entries /boot/loader/entries.backup 3) grubby --default-kernel it prints rpm-sort: Invalid input /boot message and exits with code 0 providing qa_ack As a note: I think in such case grubby should exit with different exit code. (In reply to Petr Janda from comment #8) > Reproduced on RHEL-8.2-20191120.0 x86_64 > > By following steps: > 1) install RHEL-8.2 (EFI is not needed) > 2) cp -a /boot/loader/entries /boot/loader/entries.backup > 3) grubby --default-kernel > > it prints > rpm-sort: Invalid input > /boot > > message and exits with code 0 > > providing qa_ack > Thanks a lot. > As a note: I think in such case grubby should exit with different exit code. I'm not sure if grubby should consider not finding any entries an error. So at least for this bug I would just like to avoid printing the cryptic / confusing message. Verified grubby-8.40-38.el8.x86_64 RHEL-8.2.0-20200227.0 Since the problem described in this bug report should be resolved in a recent advisory, it has been closed with a resolution of ERRATA. For information on the advisory, and where to find the updated files, follow the link below. If the solution does not work for you, open a new bug report. https://access.redhat.com/errata/RHBA-2020:1882 |
Created attachment 1592579 [details] /boot content Description of problem: At the end of upgrade process from RHEL7 to RHEL8, we try to get currently set default kernel running: # grubby --default-kernel but if fails as follows: rpm-sort: Invalid input /boot # echo $? 0 Version-Release number of selected component (if applicable): grubby-8.40-34.el8.x86_64 How reproducible: Steps to Reproduce: 1. system with EFI 2. leapp upgrade (specific patch is currently needed; can be provided) 3. grubby --default-kernel Actual results: Command # grubby --default-kernel fails Expected results: Command #grubby --default-kernel returns default kernel Additional info: On vanilla RHEL8 the command works just fine. Attaching /boot content (without kernels and initramfs'es). In case any additional info is needed, please let us know.