Bug 308151

Summary: kernel gets a mysterious error message on removal
Product: [Fedora] Fedora Reporter: Michal Jaegermann <michal>
Component: kexec-toolsAssignee: Neil Horman <nhorman>
Status: CLOSED RAWHIDE QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: low Docs Contact:
Priority: low    
Version: rawhideCC: pjones
Target Milestone: ---   
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2007-10-03 17:37:32 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 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!