Bug 509918

Summary: grubby copies the wrong grub.conf stanza
Product: Red Hat Enterprise Linux 5 Reporter: Aron Griffis <aron.griffis>
Component: mkinitrdAssignee: Peter Jones <pjones>
Status: CLOSED WONTFIX QA Contact: Release Test Team <release-test-team-automation>
Severity: medium Docs Contact:
Priority: low    
Version: 5.4CC: adaora.onyia, bzeranski, ddumas, martine.silbermann, rick.hester, shengliang.lv
Target Milestone: rc   
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard: hp:dl785solblk
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2010-07-02 03:25:04 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Aron Griffis 2009-07-06 20:38:44 UTC
Description of problem:
Updated from RHEL5.4 alpha to beta using yum.  Yes I realize this isn't supported but it serves to demonstrate a bug in grubby.

I originally had two config stanzas in grub.conf:

title Red Hat Enterprise Linux Server (2.6.18-152.el5xen)
	root (hd0,1)
	kernel /xen.gz-2.6.18-152.el5 com2=115200 console=com2
	module /vmlinuz-2.6.18-152.el5xen ro root=/dev/vg0/rhel5.4 console=ttyS0,115200
	module /initrd-2.6.18-152.el5xen.img
	savedefault
title Red Hat Enterprise Linux Server-base (2.6.18-152.el5)
	root (hd0,1)
	kernel /vmlinuz-2.6.18-152.el5 ro root=/dev/vg0/rhel5.4 console=ttyS1,115200
	initrd /initrd-2.6.18-152.el5.img
	savedefault

The yum upgrade prepended the following two, which is correct:

title Red Hat Enterprise Linux Server (2.6.18-155.el5xen)
    root (hd0,1)
    kernel /xen.gz-2.6.18-155.el5 com2=115200 console=com2
    module /vmlinuz-2.6.18-155.el5xen ro root=/dev/vg0/rhel5.4 console=ttyS0,115200
    module /initrd-2.6.18-155.el5xen.img
    savedefault
title Red Hat Enterprise Linux Server (2.6.18-155.el5)
    root (hd0,1)
    kernel /vmlinuz-2.6.18-155.el5 ro root=/dev/vg0/rhel5.4 console=ttyS0,115200
    initrd /initrd-2.6.18-155.el5.img
    savedefault

The problem here is the difference in the serial console lines:

    module /vmlinuz-2.6.18-152.el5xen ro root=/dev/vg0/rhel5.4 console=ttyS0,115200
    kernel /vmlinuz-2.6.18-152.el5 ro root=/dev/vg0/rhel5.4 console=ttyS1,115200
    module /vmlinuz-2.6.18-155.el5xen ro root=/dev/vg0/rhel5.4 console=ttyS0,115200
    kernel /vmlinuz-2.6.18-155.el5 ro root=/dev/vg0/rhel5.4 console=ttyS0,115200

Note that in the non-Xen case, the 152.el5 kernel has console=ttyS1,115200 and the 155.el5 kernel has console=ttyS0,115200.  Grubby seems to have copied the config from 152.el5xen to 155.el5, which leaves the serial console inoperable.  This results in extra reboots and manual edits to get things working right.

Version-Release number of selected component (if applicable):
RHEL 5.4 beta
mkinitrd-5.1.19.6-54.x86_64
kernel-2.6.18-152.el5.x86_64
kernel-2.6.18-155.el5.x86_64

Expected results:
-    kernel /vmlinuz-2.6.18-155.el5 ro root=/dev/vg0/rhel5.4 console=ttyS0,115200
+    kernel /vmlinuz-2.6.18-155.el5 ro root=/dev/vg0/rhel5.4 console=ttyS1,115200

Additional info:
(confession) I (re)wrote the grubby code related to this a couple releases ago, so I'm somewhat responsible.  If I can find time to look into the bug, I will.

Comment 1 Denise Dumas 2009-07-06 21:02:48 UTC
Hi Aron, 
Given the 5.4 schedule and resource constraints here, and since this doesn't appear to be a regression, I'm going to propose this for 5.5. If you come up with a patch in the next week, we could maybe squeak it in, but unlikely. Thanks for the good description. 
Denise

Comment 2 RHEL Program Management 2010-07-02 03:25:04 UTC
Development Management has reviewed and declined this request.  You may appeal
this decision by reopening this request.