Bug 1314479

Summary: upgrade broke my /boot/grub2/grub.cfg
Product: Red Hat Enterprise Linux 7 Reporter: Matěj Cepl <mcepl>
Component: grubbyAssignee: Peter Jones <pjones>
Status: CLOSED DUPLICATE QA Contact: Release Test Team <release-test-team-automation>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 7.2CC: aquini, hkrzesin, jarod, jburke, jstancek, mhruscak
Target Milestone: rc   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2016-08-22 21:37:34 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
fuller report by jstancek none

Description Matěj Cepl 2016-03-03 17:08:13 UTC
Created attachment 1132868 [details]
fuller report by jstancek

Description of problem:
When upgrading from regular 7.2 system to the nightly of http://download.eng.brq.redhat.com/nightly/RHEL-7.3-20160229.n.0/ my /boot/grub2/grub.cfg gets badly mangled. jstancek found this for me:

You start with RHEL7.2, new kernel is installed, then redhat-release-workstation is installed (you go from 7.2 to 7.3).

When all packages are installed, some kernel post install script runs and generates initrd. However grubby fails to update grub.cfg because title doesn't match (7.2 vs 7.3):

new_kernel_pkg --package kernel --mkinitrd --dracut --depmod --update 3.10.0-356.el7.x86_64
runs
/sbin/grubby --grub2 -c /boot/grub2/grub.cfg --update-kernel=/boot/vmlinuz-3.10.0-356.el7.x86_64 --initrd /boot/initramfs-3.10.0-356.el7.x86_64.img '--args= LANG=en_US.UTF-8' '--title=Red Hat Enterprise Linux Server (3.10.0-356.el7.x86_64) 7.3 (Maipo)' -> FAILS to add initrd line to grub.cfg

but in grub.cfg is:

menuentry 'Red Hat Enterprise Linux Server (3.10.0-356.el7.x86_64) 7.2 (Maipo)' --class red --class gnu-linux --class gnu --class os --unrestricted $menuentry_id_option 'gnulinux-3.10.0-327.10.1.el7.x86_64-advanced-7669efd2-2832-4d5c-af6c-419a4c8db7cb' {
        load_video
        set gfxpayload=keep
        insmod gzio
        insmod part_msdos
        insmod xfs
        set root='hd0,msdos1'
        if [ x$feature_platform_search_hint = xy ]; then
          search --no-floppy --fs-uuid --set=root --hint-bios=hd0,msdos1 --hint-efi=hd0,msdos1 --hint-baremetal=ahci0,msdos1 --hint='hd0,msdos1'  824f188c-8019-4ffa-bd17-ece8ff317df9
        else
          search --no-floppy --fs-uuid --set=root 824f188c-8019-4ffa-bd17-ece8ff317df9
        fi
        linux16 /vmlinuz-3.10.0-356.el7.x86_64 root=/dev/mapper/rhel_dell--pem520--03-root ro oops=panic crashkernel=auto rd.lvm.lv=rhel_dell-pem520-03/root rd.lvm.lv=rhel_dell-pem520-03/swap console=ttyS0,115200n81 LANG=en_US.UTF-8
}

Version-Release number of selected component (if applicable):
grubby-8.28-17.el7.x86_64

Comment 3 Herton R. Krzesinski 2016-08-22 21:37:34 UTC
The description here points to the same issue as was discussed/fixed on bug 1289314, thus marking this one as duplicate. It's fixed on kernel package starting with version kernel-3.10.0-468.el7

*** This bug has been marked as a duplicate of bug 1289314 ***