Bug 610896 - [RHEL6] Kernel rpm -Uvh is installed but grub was not updated properly
[RHEL6] Kernel rpm -Uvh is installed but grub was not updated properly
Status: CLOSED CURRENTRELEASE
Product: Red Hat Enterprise Linux 6
Classification: Red Hat
Component: kernel (Show other bugs)
6.0
All Linux
low Severity medium
: rc
: ---
Assigned To: Aristeu Rozanski
Petr Beňas
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2010-07-02 13:13 EDT by Jeff Burke
Modified: 2015-01-04 17:59 EST (History)
5 users (show)

See Also:
Fixed In Version: kernel-2.6.32-44.el6
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2010-11-10 15:56:05 EST
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)

  None (edit)
Description Jeff Burke 2010-07-02 13:13:52 EDT
Description of problem:
 While testing a RHEL6 kernel. I manually did an rpm -Uvh rather then a rpm -ivh doing that resulted in a broken system

Version-Release number of selected component (if applicable):
2.6.32-37.el6

How reproducible:
Always

Steps to Reproduce:
1. Manually upgrade a kenrel using rpm -Uvh
  
Actual results:

This seems to be what happened.
1.) It did upgrade the kernel to -42.el6 to -37.el6 -42.el6 rpm was installed and -37.el6 was removed.
2.) It did not update grub.conf, It still points to -37.el6 Even thought it installed the kernel rpm, It didn't update grub.conf. So if I would have rebooted the system would have been broken.
new-kernel-pkg runs in %posttrans which should run after upgrades too
it also runs on %preun, which would run prior an uninstall, to remove the last
entry.

[root@localhost]# uname -a
Linux  2.6.32-37.el6.i686 #1 SMP Sun Jun 20 19:59:42 EDT 2010 i686 i686 i386 GNU/Linux

[root@localhost]# rpm -Uvh  http://download.lab.bos.redhat.com/brewroot/packages/kernel/2.6.32/42.el6/i686/kernel-2.6.32-42.el6.i686.rpm http://download.lab.bos.redhat.com/brewroot/packages/kernel/2.6.32/42.el6/noarch/kernel-firmware-2.6.32-42.el6.noarch.rpm
Retrieving  
http://download.lab.bos.redhat.com/brewroot/packages/kernel/2.6.32/42.el6/i686/kernel-2.6.32-42.el6.i686.rpm
Retrieving  
http://download.lab.bos.redhat.com/brewroot/packages/kernel/2.6.32/42.el6/noarch/kernel-firmware-2.6.32-42.el6.noarch.rpm
Preparing...                ###########################################  [100%]
   1:kernel-firmware        ###########################################  [ 50%]
   2:kernel                 ###########################################  [100%]
grubby fatal error: unable to find a suitable template
grubby: doing this would leave no kernel entries. Not writing out new config.
grubby: kernel not found
grubby fatal error: unable to find a suitable template

[root@intel-piketon-01 20100331]# ls -larth /boot
 total 18M
 -rw-r--r--.  1 root root  163 Jun 30 16:08 .vmlinuz-2.6.32-42.el6.i686.hmac
 -rwxr-xr-x.  1 root root 3.6M Jun 30 16:08 vmlinuz-2.6.32-42.el6.i686
 -rw-r--r--.  1 root root 1.7M Jun 30 16:08 System.map-2.6.32-42.el6.i686
 -rw-r--r--.  1 root root 101K Jun 30 16:08 config-2.6.32-42.el6.i686
 -rw-r--r--.  1 root root 155K Jun 30 16:09 symvers-2.6.32-42.el6.i686.gz
 drwx------.  2 root root  12K Jul  1 15:40 lost+found
 drwxr-xr-x.  3 root root 1.0K Jul  1 15:43 efi
 drwxr-xr-x.  2 root root 1.0K Jul  1 15:44 grub
 dr-xr-xr-x. 24 root root 4.0K Jul  1 16:46 ..
 dr-xr-xr-x.  5 root root 1.0K Jul  2 11:50 .
 -rw-r--r--.  1 root root  12M Jul  2 11:50 initramfs-2.6.32-42.el6.i686.img

[root@intel-piketon-01 20100331]# rpm -qa | grep kernel
 kernel-headers-2.6.32-37.el6.i686
 dracut-kernel-004-20.1.el6.noarch
 kernel-firmware-2.6.32-42.el6.noarch
 kernel-2.6.32-42.el6.i686

[root@intel-piketon-01 20100331]# more /etc/grub.conf
 # grub.conf generated by anaconda
 #
 # Note that you do not have to rerun grub after making changes to this file
 # NOTICE:  You have a /boot partition.  This means that
 #          all kernel and initrd paths are relative to /boot/, eg.
 #          root (hd0,0)
 #          kernel /vmlinuz-version ro  
 root=/dev/mapper/vg_intelpiketon01-lv_root
 #          initrd /initrd-[generic-]version.img
 #boot=/dev/sda
 default=0
 timeout=5
 serial --port=0xd050 --speed=115200
 terminal --timeout=5 serial console
 title Red Hat Enterprise Linux (2.6.32-37.el6.i686)
         root (hd0,0)
         kernel /vmlinuz-2.6.32-37.el6.i686 ro  
 root=/dev/mapper/vg_intelpiketon01-lv_root  
 rd_LVM_LV=vg_intelpiketon01/lv_root rd_LVM_LV=vg_inte
 lpiketon01/lv_swap rd_NO_LUKS rd_NO_MD rd_NO_DM LANG=en_US.UTF-8  
 SYSFONT=latarcyrheb-sun16 KEYBOARDTYPE=pc KEYTABLE=us  
 console=ttyS1,115200n81
 crashkernel=auto
         initrd /initramfs-2.6.32-37.el6.i686.img

Expected results:
 Either the kernel rpm fails to install or grub gets updated appropriately.

Additional info:

new-kernel-pkg runs in %posttrans which should run after upgrades too
it also runs on %preun, which would run prior an uninstall, to remove the last
entry.
Comment 2 Richard W.M. Jones 2010-07-07 06:40:02 EDT
Also seen on x86-64:

rpm -Uvh /tmp/kernel-*.rpm
Preparing...                ########################################### [100%]
   1:kernel-firmware        ########################################### [ 33%]
   2:kernel                 ########################################### [ 67%]
   3:kernel-headers         ########################################### [100%]
grubby fatal error: unable to find a suitable template
grubby: doing this would leave no kernel entries. Not writing out new config.
grubby: kernel not found
grubby fatal error: unable to find a suitable template


cat /etc/grub.conf 
# grub.conf generated by anaconda
#
# Note that you do not have to rerun grub after making changes to this file
# NOTICE:  You have a /boot partition.  This means that
#          all kernel and initrd paths are relative to /boot/, eg.
#          root (hd0,0)
#          kernel /vmlinuz-version ro root=/dev/mapper/vg_rhel6beta2x64-lv_root
#          initrd /initrd-[generic-]version.img
#boot=/dev/sda
default=0
timeout=5
splashimage=(hd0,0)/grub/splash.xpm.gz
hiddenmenu
title Red Hat Enterprise Linux (2.6.32-37.el6.x86_64)
	root (hd0,0)
	kernel /vmlinuz-2.6.32-37.el6.x86_64 ro root=/dev/mapper/vg_rhel6beta2x64-lv_root rd_LVM_LV=vg_rhel6beta2x64/lv_root rd_LVM_LV=vg_rhel6beta2x64/lv_swap rd_NO_LUKS rd_NO_MD rd_NO_DM LANG=en_US.UTF-8 SYSFONT=latarcyrheb-sun16 KEYBOARDTYPE=pc KEYTABLE=uk crashkernel=auto rhgb quiet
	initrd /initramfs-2.6.32-37.el6.x86_64.img
Comment 5 Petr Beňas 2010-07-26 08:57:14 EDT
Reproduced with 2.6.32-42.el6.i686, verified with 2.6.32-44.el6.i686
Reproduced with 2.6.32-37.el6.i686
[root@ibm-zeus-02 ~]# uname -r                                                                                             
2.6.32-37.el6.i686
[root@ibm-zeus-02 ~]# rpm -Uvh http://download.lab.bos.redhat.com/brewroot/packages/kernel/2.6.32/42.el6/i686/kernel-2.6.32-42.el6.i686.rpm http://download.lab.bos.redhat.com/brewroot/packages/kernel/2.6.32/42.el6/noarch/kernel-firmware-2.6.32-42.el6.noarch.rpm                                                                                                            
Retrieving http://download.lab.bos.redhat.com/brewroot/packages/kernel/2.6.32/42.el6/i686/kernel-2.6.32-42.el6.i686.rpm    
Retrieving http://download.lab.bos.redhat.com/brewroot/packages/kernel/2.6.32/42.el6/noarch/kernel-firmware-2.6.32-42.el6.noarch.rpm                                                                                                                  
Preparing...                ########################################### [100%]                                             
   1:kernel-firmware        ########################################### [ 50%]                                             
   2:kernel                 ########################################### [100%]                                             
grubby fatal error: unable to find a suitable template                                                                     
grubby: doing this would leave no kernel entries. Not writing out new config.                                              
grubby: kernel not found                                                                                                   
grubby fatal error: unable to find a suitable template  
[root@ibm-zeus-02 ~]# less /boot/grub/grub.conf
# grub.conf generated by anaconda
#
# Note that you do not have to rerun grub after making changes to this file
# NOTICE:  You have a /boot partition.  This means that
#          all kernel and initrd paths are relative to /boot/, eg.
#          root (hd0,0)
#          kernel /vmlinuz-version ro root=/dev/mapper/vg_ibmzeus02-lv_root
#          initrd /initrd-[generic-]version.img
#boot=/dev/sda
default=0
timeout=5
splashimage=(hd0,0)/grub/splash.xpm.gz
hiddenmenu
title Red Hat Enterprise Linux (2.6.32-37.el6.i686)
        root (hd0,0)
        kernel /vmlinuz-2.6.32-37.el6.i686 ro root=/dev/mapper/vg_ibmzeus02-lv_root rd_LVM_LV=vg_ibmzeus02/lv_root rd_LVM_LV=vg_ibmzeus02/lv_swap rd_NO_LUKS rd_NO_MD rd_NO_DM LANG=en_US.UTF-8 SYSFONT=latarcyrheb-sun16 KEYBOARDTYPE=pc KEYTABLE=us crashkernel=auto undefined  rhgb quiet
        initrd /initramfs-2.6.32-37.el6.i686.img

cleanup:

[root@ibm-zeus-02 ~]# yum install kernel-2.6.32-37.el6
Loaded plugins: rhnplugin                                                                                                  
This system is not registered with RHN.
RHN support will be disabled.
Setting up Install Process
Resolving Dependencies
--> Running transaction check
---> Package kernel.i686 0:2.6.32-37.el6 set to be installed
--> Finished Dependency Resolution

Dependencies Resolved

===========================================================================================================================
 Package                    Arch                     Version                           Repository                     Size
===========================================================================================================================
Installing:
 kernel                     i686                     2.6.32-37.el6                     beaker-os                      20 M

Transaction Summary
===========================================================================================================================
Install       1 Package(s)
Upgrade       0 Package(s)

Total download size: 20 M
Installed size: 85 M
Is this ok [y/N]: y
Downloading Packages:
kernel-2.6.32-37.el6.i686.rpm                                                                       |  20 MB     00:00     
Running rpm_check_debug
Running Transaction Test
Transaction Test Succeeded
Running Transaction
Warning: RPMDB altered outside of yum.
  Installing     : kernel-2.6.32-37.el6.i686                                                                           1/1 

Installed:
  kernel.i686 0:2.6.32-37.el6                                                                                              

Complete!
[root@ibm-zeus-02 ~]# yum remove kernel-2.6.32-42.el6
Loaded plugins: rhnplugin
This system is not registered with RHN.
RHN support will be disabled.
Setting up Remove Process
Resolving Dependencies
--> Running transaction check
---> Package kernel.i686 0:2.6.32-42.el6 set to be erased
--> Finished Dependency Resolution

Dependencies Resolved

===========================================================================================================================
 Package                    Arch                     Version                           Repository                     Size
===========================================================================================================================
Removing:
 kernel                     i686                     2.6.32-42.el6                     installed                      85 M

Transaction Summary
===========================================================================================================================
Remove        1 Package(s)
Reinstall     0 Package(s)
Downgrade     0 Package(s)

Is this ok [y/N]: y
Downloading Packages:
Running rpm_check_debug
Running Transaction Test
Transaction Test Succeeded
Running Transaction
  Erasing        : kernel-2.6.32-42.el6.i686                                                                           1/1 

Removed:
  kernel.i686 0:2.6.32-42.el6                                                                                              

Complete!
[root@ibm-zeus-02 ~]# rpm -qa kernel
kernel-2.6.32-37.el6.i686
[root@ibm-zeus-02 ~]# ll /boot/
total 17405
-rw-r--r--. 1 root root   102404 Jun 20 20:36 config-2.6.32-37.el6.i686
drwxr-xr-x. 3 root root     1024 Jul 26 03:48 efi
drwxr-xr-x. 2 root root     1024 Jul 26 08:46 grub
-rw-r--r--. 1 root root 12043087 Jul 26 08:45 initramfs-2.6.32-37.el6.i686.img
drwx------. 2 root root    12288 Jul 26 03:44 lost+found
-rw-r--r--. 1 root root   158526 Jun 20 20:36 symvers-2.6.32-37.el6.i686.gz
-rw-r--r--. 1 root root  1769509 Jun 20 20:36 System.map-2.6.32-37.el6.i686
-rwxr-xr-x. 1 root root  3723680 Jun 20 20:36 vmlinuz-2.6.32-37.el6.i686
[root@ibm-zeus-02 ~]# less /boot/grub/grub.conf 
# grub.conf generated by anaconda
#
# Note that you do not have to rerun grub after making changes to this file
# NOTICE:  You have a /boot partition.  This means that
#          all kernel and initrd paths are relative to /boot/, eg.
#          root (hd0,0)
#          kernel /vmlinuz-version ro root=/dev/mapper/vg_ibmzeus02-lv_root
#          initrd /initrd-[generic-]version.img
#boot=/dev/sda
default=0
timeout=5
splashimage=(hd0,0)/grub/splash.xpm.gz
hiddenmenu
title Red Hat Enterprise Linux Server (2.6.32-37.el6.i686)
        root (hd0,0)
        kernel /vmlinuz-2.6.32-37.el6.i686 ro root=/dev/mapper/vg_ibmzeus02-lv_root rd_LVM_LV=vg_ibmzeus02/lv_root rd_LVM_LV=vg_ibmzeus02/lv_swap rd_NO_LUKS rd_NO_MD rd_NO_DM LANG=en_US.UTF-8 SYSFONT=latarcyrheb-sun16 KEYBOARDTYPE=pc KEYTABLE=us crashkernel=auto undefined  rhgb quiet
        initrd /initramfs-2.6.32-37.el6.i686.img
title Red Hat Enterprise Linux (2.6.32-37.el6.i686)
        root (hd0,0)
        kernel /vmlinuz-2.6.32-37.el6.i686 ro root=/dev/mapper/vg_ibmzeus02-lv_root rd_LVM_LV=vg_ibmzeus02/lv_root rd_LVM_LV=vg_ibmzeus02/lv_swap rd_NO_LUKS rd_NO_MD rd_NO_DM LANG=en_US.UTF-8 SYSFONT=latarcyrheb-sun16 KEYBOARDTYPE=pc KEYTABLE=us crashkernel=auto undefined  rhgb quiet
        initrd /initramfs-2.6.32-37.el6.i686.img

manually updated grub.conf to this:
# grub.conf generated by anaconda
#
# Note that you do not have to rerun grub after making changes to this file
# NOTICE:  You have a /boot partition.  This means that
#          all kernel and initrd paths are relative to /boot/, eg.
#          root (hd0,0)
#          kernel /vmlinuz-version ro root=/dev/mapper/vg_ibmzeus02-lv_root
#          initrd /initrd-[generic-]version.img
#boot=/dev/sda
default=0
timeout=5
splashimage=(hd0,0)/grub/splash.xpm.gz
hiddenmenu
title Red Hat Enterprise Linux Server (2.6.32-37.el6.i686)
        root (hd0,0)
        kernel /vmlinuz-2.6.32-37.el6.i686 ro root=/dev/mapper/vg_ibmzeus02-lv_root rd_LVM_LV=vg_ibmzeus02/lv_root rd_LVM_LV=vg_ibmzeus02/lv_swap rd_NO_LUKS rd_NO_MD rd_NO_DM LANG=en_US.UTF-8 SYSFONT=latarcyrheb-sun16 KEYBOARDTYPE=pc KEYTABLE=us crashkernel=auto undefined  rhgb quiet
        initrd /initramfs-2.6.32-37.el6.i686.img

Verified with 2.6.32-44.el6.i686
[root@ibm-zeus-02 ~]# rpm -Uvh http://download.lab.bos.redhat.com/brewroot/packages/kernel/2.6.32/44.el6/i686/kernel-2.6.32-44.el6.i686.rpm http://download.lab.bos.redhat.com/brewroot/packages/kernel/2.6.32/44.el6/noarch/kernel-firmware-2.6.32-44.el6.noarch.rpm
Retrieving http://download.lab.bos.redhat.com/brewroot/packages/kernel/2.6.32/44.el6/i686/kernel-2.6.32-44.el6.i686.rpm
Retrieving http://download.lab.bos.redhat.com/brewroot/packages/kernel/2.6.32/44.el6/noarch/kernel-firmware-2.6.32-44.el6.noarch.rpm
Preparing...                ########################################### [100%]
   1:kernel-firmware        ########################################### [ 50%]
   2:kernel                 ########################################### [100%]
[root@ibm-zeus-02 ~]# rpm -qa kernel
kernel-2.6.32-44.el6.i686
[root@ibm-zeus-02 ~]# ll /boot/
total 17401
-rw-r--r--. 1 root root   102656 Jul  7 16:07 config-2.6.32-44.el6.i686
drwxr-xr-x. 3 root root     1024 Jul 26 03:48 efi
drwxr-xr-x. 2 root root     1024 Jul 26 08:52 grub
-rw-r--r--. 1 root root 12040634 Jul 26 08:52 initramfs-2.6.32-44.el6.i686.img
drwx------. 2 root root    12288 Jul 26 03:44 lost+found
-rw-r--r--. 1 root root   157921 Jul  7 16:08 symvers-2.6.32-44.el6.i686.gz
-rw-r--r--. 1 root root  1769592 Jul  7 16:07 System.map-2.6.32-44.el6.i686
-rwxr-xr-x. 1 root root  3721504 Jul  7 16:07 vmlinuz-2.6.32-44.el6.i686
[root@ibm-zeus-02 ~]# less /boot/grub/grub.conf 
# grub.conf generated by anaconda
#
# Note that you do not have to rerun grub after making changes to this file
# NOTICE:  You have a /boot partition.  This means that
#          all kernel and initrd paths are relative to /boot/, eg.
#          root (hd0,0)
#          kernel /vmlinuz-version ro root=/dev/mapper/vg_ibmzeus02-lv_root
#          initrd /initrd-[generic-]version.img
#boot=/dev/sda
default=0
timeout=5
splashimage=(hd0,0)/grub/splash.xpm.gz
hiddenmenu
title Red Hat Enterprise Linux Server (2.6.32-44.el6.i686)
        root (hd0,0)
        kernel /vmlinuz-2.6.32-44.el6.i686 ro root=/dev/mapper/vg_ibmzeus02-lv_root rd_LVM_LV=vg_ibmzeus02/lv_root rd_LVM_LV=vg_ibmzeus02/lv_swap rd_NO_LUKS rd_NO_MD rd_NO_DM LANG=en_US.UTF-8 SYSFONT=latarcyrheb-sun16 KEYBOARDTYPE=pc KEYTABLE=us crashkernel=auto undefined  rhgb quiet
        initrd /initramfs-2.6.32-44.el6.i686.img
Comment 6 releng-rhel@redhat.com 2010-11-10 15:56:05 EST
Red Hat Enterprise Linux 6.0 is now available and should resolve
the problem described in this bug report. This report is therefore being closed
with a resolution of CURRENTRELEASE. You may reopen this bug report if the
solution does not work for you.

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