Red Hat Bugzilla – Bug 982839
grub2 config not updated after upgrading kernels
Last modified: 2013-10-17 23:46:56 EDT
Description of problem:
Grub menu doesn't contain newest kernel after an upgrade. Things were working until I ran grub2-mkconfig manually to flush out a lot of old, stale entries from a partition I nuked. Is there some flag I triggered by mistake? grub2-mkconfig makes valid configs for me.
Version-Release number of selected component (if applicable):
kernel-3.10.0-0.rc7.git0.3.fc20.x86_64 (occurred with a custom-built variant of this version)
FWIW, it properly updates on my netbook, also running rawhide.
This is still happening. The latest 3.12.0-0.rc0.git11.2.fc21 kernel did not update the grub.cfg. Is there some way to debug what's going wrong?
you can see what the kernel rpms do by running something like:
[root@fante ~]# rpm -q --scripts kernel-3.11.0-2.fc21.x86_64
postinstall scriptlet (using /bin/sh):
if [ `uname -i` == "x86_64" -o `uname -i` == "i386" ] &&
[ -f /etc/sysconfig/kernel ]; then
/bin/sed -r -i -e 's/^DEFAULTKERNEL=kernel-smp$/DEFAULTKERNEL=kernel/' /etc/sysconfig/kernel || exit $?
preuninstall scriptlet (using /bin/sh):
/bin/kernel-install remove 3.11.0-2.fc21.x86_64 /boot/vmlinuz-3.11.0-2.fc21.x86_64 || exit $?
posttrans scriptlet (using /bin/sh):
/bin/kernel-install add 3.11.0-2.fc21.x86_64 /boot/vmlinuz-3.11.0-2.fc21.x86_64 || exit $?
So you're interested in the %postinstall and the %posttrans sections (especially the latter). /bin/kernel-install is a bash script, just add 'set -x' on the second line and you'll see the commands it is trying
# rpm -q kernel
# ll /boot/grub2
-rw-r--r--. 1 root root 152 Jul 19 2012 device.map
drwxr-xr-x. 2 root root 1024 Jul 19 2012 fonts
-rw-------. 1 root root 8714 Sep 7 02:00 grub.cfg
-rw-------. 1 root root 10020 Jul 1 23:04 grub.cfg.bak
-rw-------. 1 root root 12227 Jul 1 23:04 grub.cfg.tst
-rw-r--r--. 1 root root 1024 Jul 19 2012 grubenv
drwxr-xr-x. 2 root root 7168 Nov 17 2012 i386-pc
drwxr-xr-x. 2 root root 1024 Jul 19 2012 locale
drwxr-xr-x. 4 root root 1024 May 9 2012 themes
Attaching the script log of a yum upgrade (without the progress bars) of the kernel and grub2.conf.
Created attachment 795070 [details]
cleaned up `script` output for a yum upgrade with the kernel and /usr/bin/kernel-install with `-x` flag
Created attachment 795071 [details]
grub.cfg file after upgrading the kernel
This bug appears to have been reported against 'rawhide' during the Fedora 20 development cycle.
Changing version to '20'.
More information and reason for this action is here:
I am now seeing this:
grubby fatal error: unable to find a suitable template
Seems to be fixed. Not sure what resolved it since grubby hasn't had an update.