Bug 457488 - Grubby on F9 in livecd environ truncates kernel/initrd paths
Grubby on F9 in livecd environ truncates kernel/initrd paths
Status: CLOSED NOTABUG
Product: Fedora
Classification: Fedora
Component: mkinitrd (Show other bugs)
9
All Linux
medium Severity medium
: ---
: ---
Assigned To: Jeremy Katz
Fedora Extras Quality Assurance
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2008-07-31 18:19 EDT by Michael DeHaan
Modified: 2009-05-05 15:11 EDT (History)
4 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2009-05-05 15:11:41 EDT
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)

  None (edit)
Description Michael DeHaan 2008-07-31 18:19:32 EDT
Description of problem:

I'm using the koan liveCD (from fresh checkout of koan's git, with options: 

koan --server=mdehaan --livecd --replace-self

which calls grubby as follows:

/sbin/grubby --add-kernel /boot/vmlinuz --initrd /boot/initrd.img --args
"ksdevice=eth0 lang= text ks=http://mdehaan/cblr/svc/op/ks/system/loaner
syslog=mdehaan:25150 kssendmac " --copy-default --make-default
--title=kick1217541082 --bad-image-okay ---boot-filesystem=/dev/sda1
--config-file=/tmp/boot/boot/grub/grub.conf

The purpose of this is to use the Live CD to simulate PXE in environs that
cannot support it, by looking up the mac and manipulating grub.  This worked
pretty well in F8 but now I am getting truncation in the grub.conf

# grub.conf
default=0
timeout=5
#splashimage=blah
hiddenmenu
title kick121blah
  root (hd0,0)
  kernel inuz ksdevice=eth0 lang= text ... blah
  initrd trd.img ... blah

So you will notice that the two filenames above that should be /boot/vmlinuz and
/boot/initrd.img are truncated.  This prevents the OS from installing on the
next boot as it can't find the files in question.

When run simply with just "--add-kernel" under a normal OS, I do not have a problem.

As shown in koan's checkout (koan/live) I am using the following repos to build
the live CD image:

repo --name=todos
--baseurl=http://download.fedora.redhat.com/pub/fedora/linux/releases/9/Everything/i386/os/
repo --name=updatez
--baseurl=http://download.fedora.redhat.com/pub/fedora/linux/updates/9/i386/
repo --name=newkoan --baseurl=file:///tmp/newkoan/


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

grubby 6.0.52 (from -v under livecd environment)

  The following command run from the liveCD environment, does work:

grubby --add-kernel /boot/vmlinuz --initrd /boot/initrd.img --title dumb
--config-file=/tmp/boot/boot/grub/grub.conf

Upon further testing of various combinations, I narrowed down --bad-image-okay
as the option that is causing the truncation.  When using grubby to install into
an unconventional location you seem to need this option.

So, this defect is about finding out what is going on when --bad-image-okay is
truncating the paths.
Comment 1 Michael DeHaan 2008-07-31 18:25:08 EDT
I'll simplify this.  This can be reproduced on a normal F9 system.

[root@localhost cobbler]# /sbin/grubby --add-kernel /boot/vmlinuz --initrd
/boot/initrd.img --args "ksdevice=eth0 lang= text
ks=http://mdehaan/cblr/svc/op/ks/system/loaner syslog=mdehaan:25150 kssendmac "
--copy-default --make-default --title=kick1217541082 --bad-image-okay
--boot-filesystem=/dev/sda1 --config-file=/boot/grub/grub.conf 


This will write truncated file paths just like the above into the normal grub
file.   Should be very easy to repro that way.

Comment 2 Michael DeHaan 2009-01-12 11:30:39 EST
Any update on this one?
Comment 3 Jeremy Katz 2009-05-04 10:52:54 EDT
grubby is part of mkinitrd, but will take a look at this.  I can reproduce it
Comment 4 Jeremy Katz 2009-05-05 15:11:41 EDT
Aha!  Figured it out

the problem is you should be passing --boot-filesystem=/boot (or /) depending on whether /boot is a separate filesystem or not.  Not the device name

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