Bug 982839

Summary: grub2 config not updated after upgrading kernels
Product: [Fedora] Fedora Reporter: Ben Boeckel <fedora>
Component: grubbyAssignee: Peter Jones <pjones>
Status: CLOSED RAWHIDE QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 20CC: bcl, gansalmon, itamar, jonathan, kernel-maint, madhu.chinakonda, michele, pjones
Target Milestone: ---   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2013-10-18 03:46:56 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:
Description Flags
cleaned up `script` output for a yum upgrade with the kernel and /usr/bin/kernel-install with `-x` flag
none
grub.cfg file after upgrading the kernel none

Description Ben Boeckel 2013-07-10 02:23:20 UTC
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)
kernel-3.11.0-0.rc0.git2.2.fc20.x86_64

Comment 1 Ben Boeckel 2013-07-10 02:46:38 UTC
FWIW, it properly updates on my netbook, also running rawhide.

Comment 2 Ben Boeckel 2013-09-06 03:43:14 UTC
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 07:17:28 UTC
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 $?
fi
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

hth,
Michele

Comment 4 Ben Boeckel 2013-09-07 06:08:05 UTC
# rpm -q kernel
kernel-3.11.0-0.rc4.git0.2.fc20.x86_64
kernel-3.12.0-0.rc0.git11.2.fc21.x86_64
kernel-3.12.0-0.rc0.git13.2.fc21.x86_64
# 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 06:09:30 UTC
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 06:27:34 UTC
Created attachment 795071 [details]
grub.cfg file after upgrading the kernel

Comment 7 Fedora End Of Life 2013-09-16 14:27:28 UTC
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:
https://fedoraproject.org/wiki/BugZappers/HouseKeeping/Fedora20

Comment 8 Ben Boeckel 2013-09-27 00:36:13 UTC
I am now seeing this:

grubby fatal error: unable to find a suitable template

grubby-8.28-1.fc20.x86_64

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