Bug 982839 - grub2 config not updated after upgrading kernels
grub2 config not updated after upgrading kernels
Product: Fedora
Classification: Fedora
Component: grubby (Show other bugs)
Unspecified Unspecified
unspecified Severity unspecified
: ---
: ---
Assigned To: Peter Jones
Fedora Extras Quality Assurance
Depends On:
  Show dependency treegraph
Reported: 2013-07-09 22:23 EDT by Ben Boeckel
Modified: 2013-10-17 23:46 EDT (History)
8 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Last Closed: 2013-10-17 23:46:56 EDT
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---

Attachments (Terms of Use)
cleaned up `script` output for a yum upgrade with the kernel and /usr/bin/kernel-install with `-x` flag (18.14 KB, text/plain)
2013-09-07 02:09 EDT, Ben Boeckel
no flags Details
grub.cfg file after upgrading the kernel (8.51 KB, text/plain)
2013-09-07 02:27 EDT, Ben Boeckel
no flags Details

  None (edit)
Description Ben Boeckel 2013-07-09 22:23:20 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)
Comment 1 Ben Boeckel 2013-07-09 22:46:38 EDT
FWIW, it properly updates on my netbook, also running rawhide.
Comment 2 Ben Boeckel 2013-09-05 23:43:14 EDT
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?
Comment 3 Michele Baldessari 2013-09-06 03:17:28 EDT
Hi Ben,

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

Comment 4 Ben Boeckel 2013-09-07 02:08:05 EDT
# rpm -q kernel
# ll /boot/grub2
total 52
-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.
Comment 5 Ben Boeckel 2013-09-07 02:09:30 EDT
Created attachment 795070 [details]
cleaned up `script` output for a yum upgrade with the kernel and /usr/bin/kernel-install with `-x` flag
Comment 6 Ben Boeckel 2013-09-07 02:27:34 EDT
Created attachment 795071 [details]
grub.cfg file after upgrading the kernel
Comment 7 Fedora End Of Life 2013-09-16 10:27:28 EDT
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:
Comment 8 Ben Boeckel 2013-09-26 20:36:13 EDT
I am now seeing this:

grubby fatal error: unable to find a suitable template

Comment 9 Ben Boeckel 2013-10-17 23:46:56 EDT
Seems to be fixed. Not sure what resolved it since grubby hasn't had an update.

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