Bug 142346 - Grubby inserts new yaboot.conf kernel config in wrong spot
Grubby inserts new yaboot.conf kernel config in wrong spot
Status: CLOSED RAWHIDE
Product: Fedora
Classification: Fedora
Component: mkinitrd (Show other bugs)
rawhide
powerpc Linux
medium Severity medium
: ---
: ---
Assigned To: Peter Jones
:
: 164980 (view as bug list)
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2004-12-08 23:10 EST by W. Michael Petullo
Modified: 2007-11-30 17:10 EST (History)
1 user (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2005-12-27 18:01:13 EST
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)
Patch (664 bytes, patch)
2005-08-03 09:54 EDT, David Woodhouse
no flags Details | Diff
Patch to fix test cases (2.79 KB, patch)
2005-08-04 07:56 EDT, David Woodhouse
no flags Details | Diff
Patch to make grubby pass the newly-modified tests. (3.15 KB, patch)
2005-08-04 07:59 EDT, David Woodhouse
no flags Details | Diff
Patch to make grubby pass the newly-modified tests. (3.15 KB, patch)
2005-08-04 08:00 EDT, David Woodhouse
no flags Details | Diff

  None (edit)
Description W. Michael Petullo 2004-12-08 23:10:18 EST
From Bugzilla Helper:
User-Agent: Mozilla/5.0 (X11; U; Linux ppc; en-US; rv:1.7.3)
Gecko/20041027 Epiphany/1.4.4

Description of problem:
Grubby does not seem to insert kernel configurations into yaboot.conf
correctly.  Though the contents inserted are right, they are placed in
the wrong place.

Version-Release number of selected component (if applicable):
mkinitrd-4.1.19-1

How reproducible:
Always

Steps to Reproduce:
1.  Install a new kernel, ie kernel-2.6.9-1.1020_FC4: 
2.  Inspect /etc/yaboot.conf
    

Actual Results:  The new definition for vmlinuz-2.6.9-1.1020_FC4 was
placed in the middle of the global definitions, between magicboot= and
macosx=.  Also, a second default= line was added.

#boot=/dev/hda2
#device=/pci@f2000000/mac-io@17/ata-4@1f000/disk@0:
boot=/dev/sda2
ofboot=/pci@f2000000/usb@1b,1/disk@1:2
init-message="Welcome to imp!\nHit <TAB> for boot options.\n\n"
#partition=4
partition=2
timeout=30
install=/usr/lib/yaboot/yaboot
magicboot=/usr/lib/yaboot/ofboot
default=linux
image=/vmlinuz-2.6.9-1.1020_FC4
        label=2.6.9-1.1020_FC
        append="enforcing=0"
        root=/dev/mapper/root
        initrd=/initrd-2.6.9-1.1020_FC4.img
        read-only

macosx=/dev/hda7
enablecdboot
default=linux
defaultos=linux
delay=10

image=/vmlinuz
        label=linux
        append="enforcing=1"
        root=/dev/hda5
        initrd=/initrd.gz
        read-only

Expected Results:  The new definition should go at the bottom of the file:

#boot=/dev/hda2
#device=/pci@f2000000/mac-io@17/ata-4@1f000/disk@0:
boot=/dev/sda2
ofboot=/pci@f2000000/usb@1b,1/disk@1:2
init-message="Welcome to imp!\nHit <TAB> for boot options.\n\n"
#partition=4
partition=2
timeout=30
install=/usr/lib/yaboot/yaboot
magicboot=/usr/lib/yaboot/ofboot
macosx=/dev/hda7
enablecdboot
default=linux
defaultos=linux
delay=10

image=/vmlinuz
        label=linux
        append="enforcing=1"
        root=/dev/hda5
        initrd=/initrd.gz
        read-only

image=/vmlinuz-2.6.9-1.1020_FC4
        label=2.6.9-1.1020_FC
        append="enforcing=0"
        root=/dev/mapper/root
        initrd=/initrd-2.6.9-1.1020_FC4.img
        read-only


Additional info:

I do have somewhat of a non-standard yaboot.conf.
Comment 1 Jeremy Katz 2004-12-20 12:25:14 EST
Should be fixed in mkinitrd-4.1.20
Comment 2 W. Michael Petullo 2004-12-21 12:17:35 EST
This still seems to be too fragile (see "unable to find suitable
template"):

[root@imp mike]# rpm -ivh /tmp/kernel-2.6.9-1.1047_FC4.ppc.rpm
WARNING: Multiple same specifications for /var/run/dbus(/.*)?.
Preparing...               
########################################### [100%]
   1:kernel                
########################################### [100%]
WARNING: /lib/modules/2.6.9-1.1047_FC4/kernel/drivers/video/vga16fb.ko
needs unknown symbol vgacon_remap_base
grubby fatal error: unable to find a suitable template
[root@imp mike]# rpm -q mkinitrd
mkinitrd-4.1.20-1

What is grubby looking for in /etc/yaboot.conf?  Here is mine:

boot=/dev/sda2
ofboot=/pci@f2000000/usb@1b,1/disk@1:2
init-message="Welcome to imp!\nHit <TAB> for boot options.\n\n"
partition=3
timeout=30
install=/usr/lib/yaboot/yaboot
default=2.6.9-1.1021_FC
magicboot=/usr/lib/yaboot/ofboot
macosx=/dev/hda7
enablecdboot
delay=10
defaultos=linux
default=2.6.9-1.1021_FC
image=/vmlinuz-2.6.9-1.1021_FC4
        label=2.6.9-1.1021_FC
        append="enforcing=1"
        root=/dev/hda5
        initrd=/initrd-2.6.9-1.1021_FC4.img
        read-only
image=/vmlinuz-2.6.9-1.1020_FC4
        label=2.6.9-1.1020_FC
        append="enforcing=0"
        root=/dev/hda5
        initrd=/initrd-2.6.9-1.1020_FC4.img
        read-only
Comment 3 W. Michael Petullo 2004-12-21 12:36:50 EST
I think you can scratch comment #2.  I am doing some unrelated work
with mkinitrd that goofed up my results.  I still see the same things
as documented in the initial report.
Comment 4 David Woodhouse 2005-08-03 09:52:26 EDT
*** Bug 164980 has been marked as a duplicate of this bug. ***
Comment 5 David Woodhouse 2005-08-03 09:54:46 EDT
Created attachment 117403 [details]
Patch

The problem is that grubby thinks that a whole bunch of generic config options
which live at the top of the file are in fact selections in the boot menu, like
'other' in Grub. This includes 'magicboot=', 'macosx=', etc. 

This patch should fix it.
Comment 6 Peter Jones 2005-08-03 14:16:42 EDT
Dave, can you add test case fixes that are appropriate for both the correct way
and the regressions?

Currently the patch you have doesn't match the testcases, and I don't know what
yaboot.conf _should_ look like in these cases.
Comment 7 David Woodhouse 2005-08-04 06:19:55 EDT
Hm, when the generic (first-stage) options like 'macosx=' are mixed in with the
kernel choices for the second stage, as they are in test/yaboot.1, grubby is
assuming that the 'macosx=' line is part of the image definition and is
reproducing it when it adds a new kernel based on the one which is above the
'macosx=' line.

It also _removes_ the macosx= option if it happens to come after a kernel which
is being removed.

Unfortunately this bug is going to have created config files which look like
that, so fixing it this way isn't really going to work. 

We possibly need to add a new line type for generic config options which
_aren't_ part of an image definition.
Comment 8 David Woodhouse 2005-08-04 07:56:04 EDT
Created attachment 117440 [details]
Patch to fix test cases

This makes the expected output of the test cases saner, with generic (or
first-stage) options collected at the top of the file instead of in the middle
of the kernel images for the second stage yaboot.
Comment 9 David Woodhouse 2005-08-04 07:59:56 EDT
Created attachment 117441 [details]
Patch to make grubby pass the newly-modified tests.

This makes grubby move generic config options up to the top of the file, before
the kernel images start.
Comment 10 David Woodhouse 2005-08-04 08:00:01 EDT
Created attachment 117442 [details]
Patch to make grubby pass the newly-modified tests.

This makes grubby move generic config options up to the top of the file, before
the kernel images start.
Comment 11 W. Michael Petullo 2005-12-27 18:01:13 EST
I have not had this problem with Raw Hide grubby for quite some time.  Marking
as resolved.

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