RHEL Engineering is moving the tracking of its product development work on RHEL 6 through RHEL 9 to Red Hat Jira (issues.redhat.com). If you're a Red Hat customer, please continue to file support cases via the Red Hat customer portal. If you're not, please head to the "RHEL project" in Red Hat Jira and file new tickets here. Individual Bugzilla bugs in the statuses "NEW", "ASSIGNED", and "POST" are being migrated throughout September 2023. Bugs of Red Hat partners with an assigned Engineering Partner Manager (EPM) are migrated in late September as per pre-agreed dates. Bugs against components "kernel", "kernel-rt", and "kpatch" are only migrated if still in "NEW" or "ASSIGNED". If you cannot log in to RH Jira, please consult article #7032570. That failing, please send an e-mail to the RH Jira admins at rh-issues@redhat.com to troubleshoot your issue as a user management inquiry. The email creates a ServiceNow ticket with Red Hat. Individual Bugzilla bugs that are migrated will be moved to status "CLOSED", resolution "MIGRATED", and set with "MigratedToJIRA" in "Keywords". The link to the successor Jira issue will be found under "Links", have a little "two-footprint" icon next to it, and direct you to the "RHEL project" in Red Hat Jira (issue links are of type "https://issues.redhat.com/browse/RHEL-XXXX", where "X" is a digit). This same link will be available in a blue banner at the top of the page informing you that that bug has been migrated.
Bug 1524554 - grub2-set-default command can't change a default start kernel when grub2-efi rpms are installed
Summary: grub2-set-default command can't change a default start kernel when grub2-efi ...
Keywords:
Status: CLOSED DUPLICATE of bug 1497918
Alias: None
Product: Red Hat Enterprise Linux 7
Classification: Red Hat
Component: grub2
Version: 7.7
Hardware: x86_64
OS: Linux
medium
medium
Target Milestone: rc
: 7.7
Assignee: Peter Jones
QA Contact: Release Test Team
URL:
Whiteboard:
Depends On:
Blocks: 1477664
TreeView+ depends on / blocked
 
Reported: 2017-12-11 16:45 UTC by Dmitry Zhukovski
Modified: 2018-11-26 07:40 UTC (History)
6 users (show)

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2018-11-26 07:40:34 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)

Description Dmitry Zhukovski 2017-12-11 16:45:00 UTC
Description of problem:
grub2-set-default command can't change a default start kernel when grub2-efi rpms are installed

Version-Release number of selected component (if applicable):
grub2-tools-minimal-2.02-0.65.el7_4.2.x86_64
grub2-pc-modules-2.02-0.65.el7_4.2.noarch
grub2-tools-2.02-0.65.el7_4.2.x86_64
grub2-pc-2.02-0.65.el7_4.2.x86_64
grub2-common-2.02-0.65.el7_4.2.noarch
grubby-8.28-23.el7.x86_64
grub2-tools-extra-2.02-0.65.el7_4.2.x86_64
grub2-2.02-0.65.el7_4.2.x86_64


How reproducible:
Everytime

Steps to Reproduce:
1. Install several kernels
2. Check we are booted into recent kernel
[root@desktop ~]# cat /etc/sysconfig/kernel
# UPDATEDEFAULT specifies if new-kernel-pkg should make
# new kernels the default
UPDATEDEFAULT=yes

# DEFAULTKERNEL specifies the default kernel package type
DEFAULTKERNEL=kernel
[root@desktop ~]# awk -F\' '$1=="menuentry " {print $2}' /etc/grub2.cfg
Red Hat Enterprise Linux Client (3.10.0-693.11.1.el7.x86_64) 7.4 (Maipo)
Red Hat Enterprise Linux Client (3.10.0-693.2.2.el7.x86_64) 7.4 (Maipo)
Red Hat Enterprise Linux Client (3.10.0-514.el7.x86_64) 7.4 (Maipo)
Red Hat Enterprise Linux Client (0-rescue-66bc7c210909401584fe486451278072) 7.4 (Maipo)
[root@desktop ~]# cat /boot/grub2/grubenv |grep saved
saved_entry=0
[root@desktop ~]# uname -a
Linux desktop 3.10.0-693.11.1.el7.x86_64 #1 SMP Fri Oct 27 05:39:05 EDT 2017 x86_64 x86_64 x86_64 GNU/Linux

3. Set default entry to #2 => third in the list (3.10.0-514.el7.x86_64)
[root@desktop ~]# grub2-set-default 2
[root@desktop ~]# grub2-mkconfig -o /boot/grub2/grub.cfg
Generating grub configuration file ...
Found linux image: /boot/vmlinuz-3.10.0-693.11.1.el7.x86_64
Found initrd image: /boot/initramfs-3.10.0-693.11.1.el7.x86_64.img
Found linux image: /boot/vmlinuz-3.10.0-693.2.2.el7.x86_64
Found initrd image: /boot/initramfs-3.10.0-693.2.2.el7.x86_64.img
Found linux image: /boot/vmlinuz-3.10.0-514.el7.x86_64
Found initrd image: /boot/initramfs-3.10.0-514.el7.x86_64.img
Found linux image: /boot/vmlinuz-0-rescue-66bc7c210909401584fe486451278072
Found initrd image: /boot/initramfs-0-rescue-66bc7c210909401584fe486451278072.img
done

4. Reboot
5. Check it's booted into correct kernel. 
[root@desktop ~]# uname -a
Linux desktop 3.10.0-514.el7.x86_64 #1 SMP Wed Oct 19 11:24:13 EDT 2016 x86_64 x86_64 x86_64 GNU/Linux

6. NB!!! grub2-efi* are NOT installed
7. Install grub2-efi*

[root@desktop ~]# yum install grub2-efi*
Loaded plugins: langpacks, product-id, search-disabled-repos, subscription-manager
Package grub2-efi-modules is obsoleted by grub2-efi-x64-modules, trying to install 1:grub2-efi-x64-modules-2.02-0.65.el7_4.2.noarch instead
Package grub2-efi is obsoleted by grub2-efi-x64, trying to install 1:grub2-efi-x64-2.02-0.65.el7_4.2.x86_64 instead
Resolving Dependencies
--> Running transaction check
---> Package grub2-efi-ia32.x86_64 1:2.02-0.65.el7_4.2 will be installed
---> Package grub2-efi-ia32-modules.noarch 1:2.02-0.65.el7_4.2 will be installed
---> Package grub2-efi-x64.x86_64 1:2.02-0.65.el7_4.2 will be installed
---> Package grub2-efi-x64-modules.noarch 1:2.02-0.65.el7_4.2 will be installed
--> Finished Dependency Resolution

Dependencies Resolved

========================================================================================================================
 Package                          Arch             Version                          Repository                     Size
========================================================================================================================
Installing:
 grub2-efi-ia32                   x86_64           1:2.02-0.65.el7_4.2              rhel-7-desktop-rpms           1.1 M
 grub2-efi-ia32-modules           noarch           1:2.02-0.65.el7_4.2              rhel-7-desktop-rpms           1.0 M
 grub2-efi-x64                    x86_64           1:2.02-0.65.el7_4.2              rhel-7-desktop-rpms           1.1 M
 grub2-efi-x64-modules            noarch           1:2.02-0.65.el7_4.2              rhel-7-desktop-rpms           1.1 M

Transaction Summary
========================================================================================================================
Install  4 Packages

Total download size: 4.2 M
Installed size: 16 M
Is this ok [y/d/N]: y
Downloading packages:
(1/4): grub2-efi-ia32-modules-2.02-0.65.el7_4.2.noarch.rpm                                       | 1.0 MB  00:00:01     
(2/4): grub2-efi-ia32-2.02-0.65.el7_4.2.x86_64.rpm                                               | 1.1 MB  00:00:01     
(3/4): grub2-efi-x64-2.02-0.65.el7_4.2.x86_64.rpm                                                | 1.1 MB  00:00:00     
(4/4): grub2-efi-x64-modules-2.02-0.65.el7_4.2.noarch.rpm                                        | 1.1 MB  00:00:00     
------------------------------------------------------------------------------------------------------------------------
Total                                                                                   1.7 MB/s | 4.2 MB  00:00:02     
Running transaction check
Running transaction test
Transaction test succeeded
Running transaction
  Installing : 1:grub2-efi-ia32-modules-2.02-0.65.el7_4.2.noarch                                                    1/4 
  Installing : 1:grub2-efi-ia32-2.02-0.65.el7_4.2.x86_64                                                            2/4 
  Installing : 1:grub2-efi-x64-2.02-0.65.el7_4.2.x86_64                                                             3/4 
  Installing : 1:grub2-efi-x64-modules-2.02-0.65.el7_4.2.noarch                                                     4/4 
  Verifying  : 1:grub2-efi-x64-modules-2.02-0.65.el7_4.2.noarch                                                     1/4 
  Verifying  : 1:grub2-efi-x64-2.02-0.65.el7_4.2.x86_64                                                             2/4 
  Verifying  : 1:grub2-efi-ia32-2.02-0.65.el7_4.2.x86_64                                                            3/4 
  Verifying  : 1:grub2-efi-ia32-modules-2.02-0.65.el7_4.2.noarch                                                    4/4 

Installed:
  grub2-efi-ia32.x86_64 1:2.02-0.65.el7_4.2              grub2-efi-ia32-modules.noarch 1:2.02-0.65.el7_4.2             
  grub2-efi-x64.x86_64 1:2.02-0.65.el7_4.2               grub2-efi-x64-modules.noarch 1:2.02-0.65.el7_4.2              

Complete!

8. Set again default entry to #2 => third in the list (3.10.0-514.el7.x86_64)
[root@desktop ~]# grub2-set-default 2
[root@desktop ~]# grub2-mkconfig -o /boot/grub2/grub.cfg
Generating grub configuration file ...
Found linux image: /boot/vmlinuz-3.10.0-693.11.1.el7.x86_64
Found initrd image: /boot/initramfs-3.10.0-693.11.1.el7.x86_64.img
Found linux image: /boot/vmlinuz-3.10.0-693.2.2.el7.x86_64
Found initrd image: /boot/initramfs-3.10.0-693.2.2.el7.x86_64.img
Found linux image: /boot/vmlinuz-3.10.0-514.el7.x86_64
Found initrd image: /boot/initramfs-3.10.0-514.el7.x86_64.img
Found linux image: /boot/vmlinuz-0-rescue-66bc7c210909401584fe486451278072
Found initrd image: /boot/initramfs-0-rescue-66bc7c210909401584fe486451278072.img
done
[root@desktop ~]# reboot 


Actual results:
Server boots into recent kernel version
[root@desktop ~]# uname -a
Linux desktop 3.10.0-693.11.1.el7.x86_64 #1 SMP Fri Oct 27 05:39:05 EDT 2017 x86_64 x86_64 x86_64 GNU/Linux

Expected results:
Server boots into correct kernel entry


Additional info:
Might be related to https://bugzilla.redhat.com/show_bug.cgi?id=1157397
Workaround - remove efi packages and redo  grub2-set-default & grub2-mkconfig


Note You need to log in before you can comment on or make changes to this bug.