summaryrefslogtreecommitdiffstats
path: root/doc
diff options
context:
space:
mode:
authorWilliam Cohen <wcohen@redhat.com>2010-03-12 14:00:38 -0500
committerWilliam Cohen <wcohen@redhat.com>2010-03-12 14:17:11 -0500
commitcd4d1d39af22d4a06ebe48209feb0b408c331887 (patch)
tree2099a74738cfd4b5a652f0b105ac0ba5e5084402 /doc
parentfd1f88e7b9ce8524e0d9059cf0428a16ceda2552 (diff)
downloadsystemtap-steved-cd4d1d39af22d4a06ebe48209feb0b408c331887.tar.gz
systemtap-steved-cd4d1d39af22d4a06ebe48209feb0b408c331887.tar.xz
systemtap-steved-cd4d1d39af22d4a06ebe48209feb0b408c331887.zip
Make the stap-prep script available in the RPM.
Diffstat (limited to 'doc')
-rwxr-xr-xdoc/SystemTap_Beginners_Guide/en-US/extras/stapprep.sh39
1 files changed, 0 insertions, 39 deletions
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 3c6bf785..00000000
--- 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