Bug 125156

Summary: grubby: Unable to find a suitable template
Product: [Fedora] Fedora Reporter: Ivan Gyurdiev <ivg231>
Component: mkinitrdAssignee: Jeremy Katz <katzj>
Status: CLOSED RAWHIDE QA Contact:
Severity: high Docs Contact:
Priority: medium    
Version: rawhideCC: dlr, walter
Target Milestone: ---   
Target Release: ---   
Hardware: athlon   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2004-08-17 14:20:17 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 Ivan Gyurdiev 2004-06-03 07:42:58 UTC
From Bugzilla Helper:
User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.6)
Gecko/20040518 Firefox/0.8

Description of problem:
Grubby has never worked for me, so I started wondering why. It always
says: Unable to find a suitable template.

That's because it's trying to --copy-default, and fails here:

if (access(fullName, R_OK)) return 0;
in function suitableImage in grubby.c
...which happens because fullName looks like this:

/boot(hd0,0)/vmlinuz-2.6.6-1.403

which I assume access does not like.

And here's the config entry I have for the default kernel:

title Fedora Linux (2.6.6 Vanilla 403)
     root (hd0,6)
     kernel (hd0,0)/vmlinuz-2.6.6-1.403 ro selinux=0 enforcing=0
root=/dev/hda7 rootflags=quota
     initrd (hd0,0)/initrd-2.6.6-1.403.img

It seems that grubby should resolve the device reference, mount it if
not mounted, and not append /boot prefix everywhere..




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

How reproducible:
Always

Steps to Reproduce:
1. Put device reference in default kernel path line
2. Run grubby
3.
    

Additional info:

Comment 1 Ivan Gyurdiev 2004-07-21 03:10:47 UTC
This is still broken and has been about 50 days since filed. Why?
It doesn't seem hard to fix...



Comment 2 Jeremy Katz 2004-07-27 03:34:27 UTC
Accepting patches :)

This isn't the default way we configure things and my todo list is on
the long side.  I'll hopefully get to it before FC3 is released, but
it's not something I can really promise.

Comment 3 Jeremy Katz 2004-08-04 19:44:48 UTC
Should be fixed in mkinitrd-4.0.2

Comment 4 Walter Moar 2004-08-09 20:53:36 UTC
Great to hear that this has been resolved. Will there be a new RPM (or
a patch) for those of us on RHEL using mkinitrd-3.5.13-1?

Comment 5 Ivan Gyurdiev 2004-08-09 21:24:25 UTC
Still doesn't work AFAICS. 
RPM is mkinitrd-4.0.2-1

[root@cobra tmp]# /sbin/grubby --default-kernel
[root@cobra tmp]# 

(btw this should print out a warning rather than just exit)

with this entry:

title Fedora Core (2.6.7-1.503)
     root (hd0,6)
     kernel (hd0,0)/vmlinuz-2.6.7-1.503 ro root=/dev/hda7
rootflags=quota selinux=1 enforcing=0
     initrd (hd0,0)/initrd-2.6.7-1.503.img

while it works fine with this entry:

[root@cobra tmp]# /sbin/grubby --default-kernel
/boot/vmlinuz-2.6.7-1.503
[root@cobra tmp]#

title Fedora Core (2.6.7-1.503)
     root (hd0,0)
     kernel /vmlinuz-2.6.7-1.503 ro root=/dev/hda7 rootflags=quota
selinux=1 enforcing=0
     initrd /initrd-2.6.7-1.503.img
                                                                     
                                                       ==============

Comment 6 Ivan Gyurdiev 2004-08-09 21:32:32 UTC
By the way I realize now that the root directive is for internal grub
use and not for setting the root fs, so I can use that to make it
work, but that doesn't mean it's right the way it is... but I can see
why it's low priority for you.

I tried looking at the code some time ago but the bootPrefix stuff
didn't make sense to me - it just gets ignored by most of the functions. 



Comment 7 Jeremy Katz 2004-08-10 18:27:30 UTC
Added handling for --default-kernel bit.

Comment 8 Ivan Gyurdiev 2004-08-12 18:02:34 UTC
That's good, but it still doesn't work.
You can't --remove-kernel by path when prefixed with the device label.
You can only remove it by "TITLE=". Since you can remove kernels by
path when not prefixed, this is a bug.






Comment 9 Ivan Gyurdiev 2004-08-17 14:20:17 UTC
Ok I'm happy (for now). 
Fixed.