From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 24287 invoked by alias); 11 Mar 2010 22:35:40 -0000 Received: (qmail 24274 invoked by uid 22791); 11 Mar 2010 22:35:39 -0000 X-SWARE-Spam-Status: No, hits=-6.9 required=5.0 tests=AWL,BAYES_00,RCVD_IN_DNSWL_HI,SPF_HELO_PASS X-Spam-Check-By: sourceware.org Received: from mx1.redhat.com (HELO mx1.redhat.com) (209.132.183.28) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Thu, 11 Mar 2010 22:35:35 +0000 Received: from int-mx01.intmail.prod.int.phx2.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) by mx1.redhat.com (8.13.8/8.13.8) with ESMTP id o2BMZX3M027900 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Thu, 11 Mar 2010 17:35:33 -0500 Received: from [10.11.9.130] (vpn-9-130.rdu.redhat.com [10.11.9.130]) by int-mx01.intmail.prod.int.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id o2BMZXqK019268; Thu, 11 Mar 2010 17:35:33 -0500 Message-ID: <4B997035.5090203@redhat.com> Date: Thu, 11 Mar 2010 22:35:00 -0000 From: William Cohen User-Agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.1.8) Gecko/20100301 Fedora/3.0.3-1.fc12 Lightning/1.0b2pre Thunderbird/3.0.3 MIME-Version: 1.0 To: Jim Keniston , SystemTAP Subject: Re: including stap-prep in the rpm References: <4B981F06.3060405@redhat.com> <20100311143903.g62m66g54wswwwsg@imap.linux.ibm.com> In-Reply-To: <20100311143903.g62m66g54wswwwsg@imap.linux.ibm.com> Content-Type: multipart/mixed; boundary="------------030607090601030405030701" X-IsSubscribed: yes Mailing-List: contact systemtap-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Post: List-Help: , Sender: systemtap-owner@sourceware.org X-SW-Source: 2010-q1/txt/msg00642.txt.bz2 This is a multi-part message in MIME format. --------------030607090601030405030701 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Content-length: 861 On 03/11/2010 02:39 PM, Jim Keniston wrote: > Quoting William Cohen : > >> Rather than attempting to run a systemtap script and getting crypic >> messages about being unable to build the kernel module or find the >> debug information, the stap-prep script list outs the needed rpms. >> >> The attached is a patch to include the stap-prep script in the >> systemtap rpm. Before checking it in I would like to get some comment >> about the patch. >> >> -Will >> > > Hi, Will. > > I don't see the stap-prep script itself in this patch or on gitweb. > > Jim > I used the "git-mv" to move doc/SystemTap_Beginners_Guide/en-US/extras/stapprep.sh to stap-prep. Apparently, the diff I used to generate the patch didn't show that. The attached is a "git diff" that shows the movement of stapprep.sh in the doc directory to stap-prep. -will --------------030607090601030405030701 Content-Type: text/plain; name="stap-prep.patch" Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename="stap-prep.patch" Content-length: 4538 diff --git a/Makefile.am b/Makefile.am index 7b655b7..7028662 100644 --- a/Makefile.am +++ b/Makefile.am @@ -17,7 +17,7 @@ dtrace.1 \ staprun.8 bin_PROGRAMS = staprun -bin_SCRIPTS = stap-report +bin_SCRIPTS = stap-report stap-prep pkglibexec_PROGRAMS = stapio pkglibexec_SCRIPTS = stap-env oldinclude_HEADERS = includes/sys/sdt.h diff --git a/Makefile.in b/Makefile.in index eaa226e..47866b2 100644 --- a/Makefile.in +++ b/Makefile.in @@ -380,7 +380,7 @@ AM_CXXFLAGS = -Wall -Werror man_MANS = stapprobes.3stap stapfuncs.3stap stapvars.3stap \ stapex.3stap dtrace.1 staprun.8 $(am__append_2) \ $(am__append_4) $(am__append_8) -bin_SCRIPTS = stap-report $(am__append_3) $(am__append_5) \ +bin_SCRIPTS = stap-report stap-prep $(am__append_3) $(am__append_5) \ $(am__append_10) pkglibexec_SCRIPTS = stap-env $(am__append_7) $(am__append_11) oldinclude_HEADERS = includes/sys/sdt.h diff --git a/doc/SystemTap_Beginners_Guide/en-US/extras/stapprep.sh b/doc/SystemTap_Beginners_Guide/en-US/extras/stapprep.sh deleted file mode 100755 index 3c6bf78..0000000 --- a/doc/SystemTap_Beginners_Guide/en-US/extras/stapprep.sh +++ /dev/null @@ -1,39 +0,0 @@ -#! /bin/bash -check_error() { if test $1 != 0; then echo $2; exit $1; fi } - -if [ "$#" -lt 1 ]; then - UNAME=`uname -r` # determine the kernel running on the machine -else - UNAME=$1 #user passed in uname value -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//` - if [ "$TMP" != "$UNAME" ]; then - UNAME=$TMP; KERNEL="kernel-$VARIANT" - fi -done -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" -NEEDED=`rpm --qf "%{name}-%{version}-%{release}.%{arch}\n" \ - -q $CANDIDATES | grep "is not installed" | awk '{print $2}'` -if [ "$NEEDED" != "" ]; then - echo -e "Need to install the following packages:\n$NEEDED" - if [ `id -u` = "0" ]; then #attempt download and install - DIR=`mktemp -d` || exit 1 - if [ ! -x /usr/bin/yumdownloader ]; then - echo "Need to first install yum-utils for yumdownloader" - yum install -y yum-utils - fi - yumdownloader --enablerepo="*debuginfo*" $NEEDED --destdir=$DIR - check_error $? "problem downloading rpm(s) $NEEDED" - rpm --force -ivh $DIR/*.rpm - check_error $? "problem installing rpm(s) $NEEDED" - rm -r $DIR #cleanup - fi -fi diff --git a/stap-prep b/stap-prep new file mode 100755 index 0000000..3c6bf78 --- /dev/null +++ b/stap-prep @@ -0,0 +1,39 @@ +#! /bin/bash +check_error() { if test $1 != 0; then echo $2; exit $1; fi } + +if [ "$#" -lt 1 ]; then + UNAME=`uname -r` # determine the kernel running on the machine +else + UNAME=$1 #user passed in uname value +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//` + if [ "$TMP" != "$UNAME" ]; then + UNAME=$TMP; KERNEL="kernel-$VARIANT" + fi +done +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" +NEEDED=`rpm --qf "%{name}-%{version}-%{release}.%{arch}\n" \ + -q $CANDIDATES | grep "is not installed" | awk '{print $2}'` +if [ "$NEEDED" != "" ]; then + echo -e "Need to install the following packages:\n$NEEDED" + if [ `id -u` = "0" ]; then #attempt download and install + DIR=`mktemp -d` || exit 1 + if [ ! -x /usr/bin/yumdownloader ]; then + echo "Need to first install yum-utils for yumdownloader" + yum install -y yum-utils + fi + yumdownloader --enablerepo="*debuginfo*" $NEEDED --destdir=$DIR + check_error $? "problem downloading rpm(s) $NEEDED" + rpm --force -ivh $DIR/*.rpm + check_error $? "problem installing rpm(s) $NEEDED" + rm -r $DIR #cleanup + fi +fi diff --git a/systemtap.spec b/systemtap.spec index d29dac5..a65868a 100644 --- a/systemtap.spec +++ b/systemtap.spec @@ -410,6 +410,7 @@ exit 0 %{_bindir}/stap %{_bindir}/stap-report +%{_bindir}/stap-prep %{_mandir}/man1/* %{_mandir}/man3/* --------------030607090601030405030701--