Bug 596083

Summary: stap-prep suggest wrong kernel-debuginfo-common package to install
Product: [Fedora] Fedora Reporter: Mark Wielaard <mjw>
Component: systemtapAssignee: Frank Ch. Eigler <fche>
Status: CLOSED RAWHIDE QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: medium Docs Contact:
Priority: low    
Version: 13CC: dsmith, fche, jistone, mjw, roland, wcohen
Target Milestone: ---   
Target Release: ---   
Hardware: All   
OS: Linux   
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
: 596085 (view as bug list) Environment:
Last Closed: 2011-01-26 17:38:21 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Bug Depends On:    
Bug Blocks: 596085    

Description Mark Wielaard 2010-05-26 09:41:25 UTC
Description of problem:

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

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


How reproducible:


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


Expected results:


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 10:29:42 UTC
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
-  $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
-        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 09:44:08 UTC
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) (".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)
+# (".arch.variant", two dots)
 if [ "$#" -lt 1 ]; then
     UNAME=`uname -r` # determine the kernel running on the machine
@@ -9,7 +13,8 @@ fi
 UNAME=`echo $UNAME | sed "s/ //"` #strip out any whitespace
 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"

Comment 3 Frank Ch. Eigler 2011-01-26 17:38:21 UTC
systemtap-1.4 in rawhide etc. includes this fix.