Bug 769641 - Update of Fedora 16 ppc64 beta kernel fails to update /boot/etc/yaboot.conf
Summary: Update of Fedora 16 ppc64 beta kernel fails to update /boot/etc/yaboot.conf
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Fedora
Classification: Fedora
Component: grubby
Version: 16
Hardware: powerpc
OS: Linux
unspecified
unspecified
Target Milestone: ---
Assignee: Peter Jones
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks: F17Betappc
TreeView+ depends on / blocked
 
Reported: 2011-12-21 15:12 UTC by Robert Knight
Modified: 2012-03-23 17:44 UTC (History)
6 users (show)

Fixed In Version: grubby-8.11-1.fc17
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2012-03-23 17:44:01 UTC
Type: ---


Attachments (Terms of Use)
Patch to test (1.60 KB, patch)
2012-01-18 19:11 UTC, Peter Jones
no flags Details | Diff
Better patch to test. (1.60 KB, patch)
2012-01-19 18:28 UTC, Peter Jones
no flags Details | Diff

Description Robert Knight 2011-12-21 15:12:09 UTC
Description of problem:
Update of kernel fails on Fedora 16 ppc64 Beta installation because /boot/etc/yaboot.conf image path does not start with a '/'

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


How reproducible:
always

Steps to Reproduce:
1. Install Fedora 16 Beta ppc64 beta.
2. yum update
3.
  
Actual results:
Update does not alter /boot/etc/yaboot.conf.

Expected results:
Update does add new kernel to /boot/etc/yaboot.conf

Additional info:

Comment 1 will schmidt 2012-01-17 18:40:26 UTC
Snippets from a recreate attempt:

 ~]# yum update kernel.ppc64
Loaded plugins: langpacks, presto, refresh-packagekit
Setting up Update Process
Resolving Dependencies
--> Running transaction check
---> Package kernel.ppc64 0:3.1.5-6.fc16 will be installed
--> Finished Dependency Resolution

...

Setting up and reading Presto delta metadata
kernel-3.1.5-6.fc16.ppc64.rpm                                                                                  |  27 MB     00:56     
warning: rpmts_HdrFromFdno: Header V3 RSA/SHA1 Signature, key ID 10d90a9e: NOKEY
Public key for kernel-3.1.5-6.fc16.ppc64.rpm is not installed
Retrieving key from file:///etc/pki/rpm-gpg/RPM-GPG-KEY-fedora-ppc64

...
Running Transaction Check
Running Transaction Test
Transaction Test Succeeded
Running Transaction
  Installing : kernel-3.1.5-6.fc16.ppc64                                                                                          1/1 
grubby fatal error: unable to find a suitable template

Installed:
  kernel.ppc64 0:3.1.5-6.fc16                                                                                                         

Complete!


And per inspection, the 3.1.5-6.fc16 kernel is _not_ added to yaboot.conf.

Comment 2 will schmidt 2012-01-17 21:58:34 UTC
Enabled verbose, and dded a set -x ; set +x to /sbin/new-kernel-package to debug a bit deeper.   Failing command looks like so:

 /sbin/new-kernel-pkg --package kernel --install 3.1.5-6.fc16.ppc64
initrdfile is /boot/initrd-3.1.5-6.fc16.ppc64.img
making it the default based on config
 does not exist, not running grubby for grub 0.97
 does not exist, not running grubby for grub 2
 does not exist, not running grubby for grub 2 with UEFI
adding 3.1.5-6.fc16.ppc64 to /etc/yaboot.conf
+ /sbin/grubby --add-kernel=/boot/vmlinuz-3.1.5-6.fc16.ppc64 --copy-default --make-default --title 3.1.5-6.fc16.ppc64 '--args=root=/dev/mapper/vg_9590145-lv_root ' --remove-kernel=TITLE=3.1.5-6.fc16.ppc64 --yaboot
grubby fatal error: unable to find a suitable template
+ set +x
running /sbin/ybin


running grubby under strace shows:
strace -e trace=file /sbin/grubby --add-kernel=/boot/vmlinuz-3.1.5-6.fc16.ppc64 --copy-default --make-default --title 3.1.5-6.fc16.ppc64 '--args=root=/dev/mapper/vg_9590145-lv_root ' --remove-kernel=TITLE=3.1.5-6.fc16.ppc64 --yaboot
execve("/sbin/grubby", ["/sbin/grubby", "--add-kernel=/boot/vmlinuz-3.1.5"..., "--copy-default", "--make-default", "--title", "3.1.5-6.fc16.ppc64", "--args=root=/dev/mapper/vg_95901"..., "--remove-kernel=TITLE=3.1.5-6.fc"..., "--yaboot"], [/* 25 vars */]) = 0
[snip...]
stat("/boot", {st_mode=S_IFDIR|0555, st_size=1024, ...}) = 0
open("/etc/yaboot.conf", O_RDONLY)      = 3
access("/bootvmlinuz-3.1.0-7.fc16.ppc64", R_OK) = -1 ENOENT (No such file or directory)
access("/bootvmlinuz-3.1.0-7.fc16.ppc64", R_OK) = -1 ENOENT (No such file or directory)
grubby fatal error: unable to find a suitable template

This access entry in particular looks bad:
access("/bootvmlinuz-3.1.0-7.fc16.ppc64", R_OK) = -1 ENOENT (No such file or directory)

looks like a "/" got lost on a strcat operation?

Comment 3 Dan Horák 2012-01-18 16:37:43 UTC
ha, I see the same grubby error on s390, will check the strace output ...

Comment 4 Will Woods 2012-01-18 19:01:46 UTC
By the way, grubby now has a --debug flag for sorting these things out...

Anyway, yes, the missing '/' is the problem. pjones has a patch that should land in grubby shortly.

Comment 5 Peter Jones 2012-01-18 19:11:39 UTC
Created attachment 556094 [details]
Patch to test

Here's a patch to test.

Comment 6 Peter Jones 2012-01-19 18:28:53 UTC
Created attachment 556362 [details]
Better patch to test.

Previous patch had a logic error; this one should work better.

Comment 7 Fedora Update System 2012-03-15 16:53:59 UTC
grubby-8.10-1.fc17 has been submitted as an update for Fedora 17.
https://admin.fedoraproject.org/updates/grubby-8.10-1.fc17

Comment 8 Fedora Update System 2012-03-16 02:45:14 UTC
Package grubby-8.10-1.fc17:
* should fix your issue,
* was pushed to the Fedora 17 testing repository,
* should be available at your local mirror within two days.
Update it with:
# su -c 'yum update --enablerepo=updates-testing grubby-8.10-1.fc17'
as soon as you are able to.
Please go to the following url:
https://admin.fedoraproject.org/updates/FEDORA-2012-3892/grubby-8.10-1.fc17
then log in and leave karma (feedback).

Comment 9 Fedora Update System 2012-03-21 19:14:25 UTC
grubby-8.11-1.fc17 has been submitted as an update for Fedora 17.
https://admin.fedoraproject.org/updates/grubby-8.11-1.fc17

Comment 10 Fedora Update System 2012-03-23 17:44:01 UTC
grubby-8.11-1.fc17 has been pushed to the Fedora 17 stable repository.  If problems still persist, please make note of it in this bug report.


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