Bug 308151 - kernel gets a mysterious error message on removal
kernel gets a mysterious error message on removal
Product: Fedora
Classification: Fedora
Component: kexec-tools (Show other bugs)
All Linux
low Severity low
: ---
: ---
Assigned To: Neil Horman
Fedora Extras Quality Assurance
Depends On:
  Show dependency treegraph
Reported: 2007-09-26 18:25 EDT by Michal Jaegermann
Modified: 2007-11-30 17:12 EST (History)
1 user (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Last Closed: 2007-10-03 13:37:32 EDT
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---

Attachments (Terms of Use)

  None (edit)
Description Michal Jaegermann 2007-09-26 18:25:11 EDT
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 15:05:57 EDT
something broke in new-kernel-pkg maybe?   Peter ?
Comment 2 Michal Jaegermann 2007-09-28 12:49:14 EDT
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
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`
   KDVER=`echo $i | sed -e's/^.*initrd-//' -e's/kdump.*$//'`

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.*$//'`

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 09:16:17 EDT
Yep you're right.  Thanks for the catch.  Commited to the fedora devel branch. 

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