Bug 308151 - kernel gets a mysterious error message on removal
Summary: kernel gets a mysterious error message on removal
Keywords:
Status: CLOSED RAWHIDE
Alias: None
Product: Fedora
Classification: Fedora
Component: kexec-tools
Version: rawhide
Hardware: All
OS: Linux
low
low
Target Milestone: ---
Assignee: Neil Horman
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2007-09-26 22:25 UTC by Michal Jaegermann
Modified: 2007-11-30 22:12 UTC (History)
1 user (show)

Fixed In Version:
Clone Of:
Environment:
Last Closed: 2007-10-03 17:37:32 UTC
Type: ---
Embargoed:


Attachments (Terms of Use)

Description Michal Jaegermann 2007-09-26 22:25:11 UTC
Description of problem:

While applying 20070926 updates I got never seen before message:

  Cleanup   : kernel                       ##################### [229/316]
ls: cannot access /boot/initrd*kdump.img: No such file or directory

Apparently something tries to use 'ls' to check an existence of
a file with name pattern of "/boot/initrd*kdump.img".  This is
an obviously wrong approach but I cannot figure out which of
kernel installation tools does something like that.  It does not
look like directly kernel package scripts so something called
there.  Ideas?

Comment 1 Dave Jones 2007-09-27 19:05:57 UTC
something broke in new-kernel-pkg maybe?   Peter ?

Comment 2 Michal Jaegermann 2007-09-28 16:49:14 UTC
I found what is broken.  While removing some kernel with 'rpm -evv ...':
....
D:     erase: %postun(kexec-tools-1.102pre-1.fc8.x86_64) asynchronous scriptlet
start
D:     erase: %trigger(kexec-tools-1.102pre-1.fc8.x86_64)       execv(/bin/sh)
pid 10916
++ ls '/boot/initrd*kdump.img'
ls: cannot access /boot/initrd*kdump.img: No such file or directory
.....

and 'rpm -q --triggers kexec-tools' shows

#start by getting a list of all the kdump initrds
for i in `ls /boot/initrd*kdump.img`
do
   KDVER=`echo $i | sed -e's/^.*initrd-//' -e's/kdump.*$//'`
   ....
done

That is clearly wrong.  That loop should read

for i in /boot/initrd*kdump.img ; do
    [ -e "$i" ] || continue
    KDVER=`echo $i | sed -e's/^.*initrd-//' -e's/kdump.*$//'`
     ....
done

unless you want to use 'shopt -s nullglob' and make an existence
test redundant.

Setting KDVER also does not require external programs.

   KDVER="${i##*initrd-}" ; KDVER="${KDVER%%kdump*}"

The abvove with kexec-tools-1.102pre-1.fc8.

Comment 3 Neil Horman 2007-10-01 13:16:17 UTC
Yep you're right.  Thanks for the catch.  Commited to the fedora devel branch. 
Thanks!


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