This service will be undergoing maintenance at 00:00 UTC, 2016-08-01. It is expected to last about 1 hours

Bug 769641

Summary: Update of Fedora 16 ppc64 beta kernel fails to update /boot/etc/yaboot.conf
Product: [Fedora] Fedora Reporter: Robert Knight <knight>
Component: grubbyAssignee: Peter Jones <pjones>
Status: CLOSED ERRATA QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 16CC: bcl, dan, luke, pjones, willschm, wwoods
Target Milestone: ---   
Target Release: ---   
Hardware: powerpc   
OS: Linux   
Whiteboard:
Fixed In Version: grubby-8.11-1.fc17 Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2012-03-23 13:44:01 EDT Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Bug Depends On:    
Bug Blocks: 803329    
Attachments:
Description Flags
Patch to test
none
Better patch to test. none

Description Robert Knight 2011-12-21 10:12:09 EST
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 13:40:26 EST
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 16:58:34 EST
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 11:37:43 EST
ha, I see the same grubby error on s390, will check the strace output ...
Comment 4 Will Woods 2012-01-18 14:01:46 EST
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 14:11:39 EST
Created attachment 556094 [details]
Patch to test

Here's a patch to test.
Comment 6 Peter Jones 2012-01-19 13:28:53 EST
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 12:53:59 EDT
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-15 22:45:14 EDT
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 15:14:25 EDT
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 13:44:01 EDT
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.