Bug 596083 - stap-prep suggest wrong kernel-debuginfo-common package to install
stap-prep suggest wrong kernel-debuginfo-common package to install
Status: CLOSED RAWHIDE
Product: Fedora
Classification: Fedora
Component: systemtap (Show other bugs)
13
All Linux
low Severity medium
: ---
: ---
Assigned To: Frank Ch. Eigler
Fedora Extras Quality Assurance
:
Depends On:
Blocks: 596085
  Show dependency treegraph
 
Reported: 2010-05-26 05:41 EDT by Mark Wielaard
Modified: 2011-01-26 12:38 EST (History)
6 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
: 596085 (view as bug list)
Environment:
Last Closed: 2011-01-26 12:38:21 EST
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)

  None (edit)
Description Mark Wielaard 2010-05-26 05:41:25 EDT
Description of problem:

Wrong kernel-debuginfo-common package suggested by stap-prep.

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

systemtap-1.2-1.fc13.i686

How reproducible:

Always

Steps to Reproduce:
1. Run $ stap-prep
2. See it suggest kernel-debuginfo-common-2.6.33.4-95.fc13.i686
3. Don't find that package (it is missing the -i686 substring in the name)
  
Actual results:

kernel-debuginfo-common-2.6.33.4-95.fc13.i686

Expected results:

kernel-debuginfo-common-i686-2.6.33.4-95.fc13.i686

Additional info:

This is a minor issue, since the main kernel-debuginfo package does pull in the right -common package, but it is confusing since it looks like you won't be able to satisfy the requirements (and stap-prep keeps saying you are missing a package).
Comment 1 Mark Wielaard 2010-05-26 06:29:42 EDT
Upstream git bugfix:

commit 928c149cfb5fef2dbdfc1c9d071e949dc67e8685
Author: Mark Wielaard <mjw@redhat.com>
Date:   Wed May 26 12:24:21 2010 +0200

    rhbz #596083 Make stap-prep resolve kernel-debuginfo-common package name.
    
    The kernel-debuginfo-common package name is slightly different on different
    distros. But the correct name is always required by the kernel-debuginfo
    package. So don't add it to the CANDIDATES list, but let the yumdowloader
    --resolve it. Tested on f13, rhel5 and rhel6 beta.
    
    * stap-prep: Remove kernel-debuginfo-common from CANDIDATES, add --resolve
      to yumdownloader.

diff --git a/stap-prep b/stap-prep
index 3c6bf78..7f8099f 100755
--- a/stap-prep
+++ b/stap-prep
@@ -18,8 +18,7 @@ KERN_ARCH=`uname -m`
 KERN_REV=`echo $UNAME | sed s/.$KERN_ARCH//` # strip arch from uname
 CANDIDATES="$KERNEL-$KERN_REV.$KERN_ARCH \
   $KERNEL-devel-$KERN_REV.$KERN_ARCH \
-  $KERNEL-debuginfo-$KERN_REV.$KERN_ARCH \
-  kernel-debuginfo-common-$KERN_REV.$KERN_ARCH"
+  $KERNEL-debuginfo-$KERN_REV.$KERN_ARCH"
 NEEDED=`rpm --qf "%{name}-%{version}-%{release}.%{arch}\n" \
     -q $CANDIDATES | grep "is not installed" | awk '{print $2}'`
 if [ "$NEEDED" != "" ]; then
@@ -30,7 +29,8 @@ if [ "$NEEDED" != "" ]; then
             echo "Need to first install yum-utils for yumdownloader"
             yum install -y yum-utils
         fi
-        yumdownloader --enablerepo="*debuginfo*" $NEEDED --destdir=$DIR
+        yumdownloader --enablerepo="*debuginfo*" $NEEDED --destdir=$DIR \
+                      --resolve
         check_error $? "problem downloading rpm(s) $NEEDED"
         rpm --force -ivh $DIR/*.rpm
         check_error $? "problem installing rpm(s) $NEEDED"
Comment 2 Mark Wielaard 2010-06-01 05:44:08 EDT
There was a slight bug also in the variant processing. Fixed upstream as:

commit 6f6a731f169d44e0a45d46224de34429cf3252ff
Author: Mark Wielaard <mjw@redhat.com>
Date:   Tue Jun 1 11:37:59 2010 +0200

    rhbz #596083 Account for dot and dotless kernel variant in stap-prep.
    
    uname -r can produce different kinds of output:
    2.6.32-30.el6.x86_64 (no variant, but including ".arch")
    2.6.18-194.3.1.el5debug ("variant", without dot, no arch)
    2.6.33.4-95.fc13.i686.PAE (".arch.variant", two dots)
    We didn't handle the dot before the variant used in newer distros.
    
    * stap-prep: Remove either ".variant" or "variant" from the end of release
      uname string.

diff --git a/stap-prep b/stap-prep
index 7f8099f..2ee40ea 100755
--- a/stap-prep
+++ b/stap-prep
@@ -1,6 +1,10 @@
 #! /bin/bash
 check_error() { if test $1 != 0; then echo $2; exit $1; fi }
 
+# uname -r can produce different kinds of output:
+# 2.6.32-30.el6.x86_64 (no variant, but including ".arch")
+# 2.6.18-194.3.1.el5debug ("variant", without dot, no arch)
+# 2.6.33.4-95.fc13.i686.PAE (".arch.variant", two dots)
 if [ "$#" -lt 1 ]; then
     UNAME=`uname -r` # determine the kernel running on the machine
 else
@@ -9,7 +13,8 @@ fi
 UNAME=`echo $UNAME | sed "s/ //"` #strip out any whitespace
 KERNEL="kernel"
 for VARIANT in debug kdump PAE xen; do
-  TMP=`echo $UNAME | sed s/$VARIANT//`
+  # strip out ".variant" or else "variant" at end.
+  TMP=`echo $UNAME | sed s/\\\\.$VARIANT\$// | sed s/$VARIANT\$//`
   if [ "$TMP" != "$UNAME" ]; then
       UNAME=$TMP; KERNEL="kernel-$VARIANT"
   fi
Comment 3 Frank Ch. Eigler 2011-01-26 12:38:21 EST
systemtap-1.4 in rawhide etc. includes this fix.

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