cas soon to be in fedora/epel
by Adam Stokes
I've been approved as a packager for Fedora and CAS has been approved
for both Fedora and EPEL.
I am currently pushing packages for all branches so expect to see cas
in the repo's soon!
Thanks
--
__ __
.-----.| |_.-----.| |--.-----.-----.
|__ --|| _| _ || <| -__|__ --|
|_____||____|_____||__|__|_____|_____|
.----------------------------------.
( ajs(a)redhat.com || 919.754.4187 )
`----------------------------------'
15 years, 3 months
cas cas.spec
by Adam Stokes
cas | 6 +++---
cas.spec | 2 +-
2 files changed, 4 insertions(+), 4 deletions(-)
New commits:
commit b5e91eed39187d786569cf5e9ba0e13ab93d8143
Author: Adam Stokes <ajs(a)redhat.com>
Date: Wed Jan 14 13:28:04 2009 -0500
- extended timestamp for directory hierarchy
diff --git a/cas b/cas
index 057b383..319ca7b 100755
--- a/cas
+++ b/cas
@@ -121,7 +121,7 @@ class TimestampHandler(object):
debugKernel, timestamp = coreObj
if timestamp and coreTimestamp in timestamp:
return (k, debugKernel)
- self.casLog.debug("Unable to match timestamp %s/%s" % (timestamp,debugKernel))
+ self.casLog.debug("Unable to match timestamp %s" % (coreTimestamp,))
sys.exit(1)
class CasApplication(object):
@@ -156,9 +156,9 @@ class CasApplication(object):
self.email = self.opts.email
self.extractKernelModules = self.opts.kernel_modules
# we want to allow for multiple cores under same identifier
- # so we base the hierarchy /workDirectory/identifyer/datetime
+ # so we base the hierarchy /workDirectory/identifier/datetime
datenow = datetime.now()
- dateFormatted = datenow.strftime("%I.%M.%S")
+ dateFormatted = datenow.strftime("%m.%d.%y.%I.%M.%S")
self.storagePath = os.path.join(WORKDIRECTORY, self.identifier)
self.storagePath = os.path.join(self.storagePath, dateFormatted)
diff --git a/cas.spec b/cas.spec
index 8f97070..b0ab6ef 100644
--- a/cas.spec
+++ b/cas.spec
@@ -3,7 +3,7 @@
Name: cas
Summary: Tool to analyze and configure core file environment
Version: 0.13
-Release: 117%{?dist}
+Release: 118%{?dist}
Source0: https://fedorahosted.org/releases/c/a/cas/%{name}-%{version}.tar.gz
License: GPLv3+
Group: Development/Libraries
15 years, 3 months
cas cas.conf cas.spec
by Adam Stokes
cas | 6 ++++++
cas.conf | 4 +++-
cas.spec | 7 ++++++-
3 files changed, 15 insertions(+), 2 deletions(-)
New commits:
commit d03a3204406c1ffdf97f8cbc62185662897185a4
Author: Adam Stokes <ajs(a)redhat.com>
Date: Thu Jan 8 20:56:46 2009 -0500
- enabled a deep hierachy for more than one core
under the same identifier
diff --git a/cas b/cas
index d4bec50..057b383 100755
--- a/cas
+++ b/cas
@@ -21,6 +21,7 @@ import ConfigParser
import smtplib
from subprocess import Popen, PIPE
+from datetime import datetime
from cas.network import Download
from cas.core import CoreBase, CoreException
@@ -154,7 +155,12 @@ class CasApplication(object):
self.identifier = self.opts.identifier
self.email = self.opts.email
self.extractKernelModules = self.opts.kernel_modules
+ # we want to allow for multiple cores under same identifier
+ # so we base the hierarchy /workDirectory/identifyer/datetime
+ datenow = datetime.now()
+ dateFormatted = datenow.strftime("%I.%M.%S")
self.storagePath = os.path.join(WORKDIRECTORY, self.identifier)
+ self.storagePath = os.path.join(self.storagePath, dateFormatted)
# build logger object to deal with logging per job and keep things
# clean and easy to debug
diff --git a/cas.conf b/cas.conf
index 89af903..6ce4579 100644
--- a/cas.conf
+++ b/cas.conf
@@ -41,5 +41,7 @@ mailServer=mail.example.com
[advanced]
# if running a x86_64 system and wish to analyze 32bit
# cores, define the location of 32bit crash binary
+# EXAMPLE USAGE:
+# rpm --relocate /usr/bin=/usr/local/i386 -ivh crash*i386.rpm
-# crash_32=/usr/local/i386/bin/crash
+# crash_32=/usr/local/i386/crash
diff --git a/cas.spec b/cas.spec
index dfe5cd7..8f97070 100644
--- a/cas.spec
+++ b/cas.spec
@@ -3,7 +3,7 @@
Name: cas
Summary: Tool to analyze and configure core file environment
Version: 0.13
-Release: 115%{?dist}
+Release: 117%{?dist}
Source0: https://fedorahosted.org/releases/c/a/cas/%{name}-%{version}.tar.gz
License: GPLv3+
Group: Development/Libraries
@@ -42,6 +42,11 @@ rm -rf ${RPM_BUILD_ROOT}
%doc LICENSE README PKG-INFO
%changelog
+* Wed Jan 7 2009 Adam Stokes <ajs at redhat dot com> - 0.13-116
+- support for extracting kernel modules
+- support for analyzing x86 cores on x86_64 system
+- consistent macro usage in spec
+
* Mon Dec 29 2008 Adam Stokes <ajs at redhat dot com> - 0.13-114
- changed license to gplv3 or later
- removed source requirements as these are handled by python manifest
15 years, 3 months
cas cas.spec
by Adam Stokes
cas | 72 ++++++++++++++++++++++++++++++++++++++++++++-------------------
cas.spec | 4 +--
2 files changed, 53 insertions(+), 23 deletions(-)
New commits:
commit 7d155560f42983447893d8dd1d17ae470b33ea89
Author: Adam Stokes <ajs(a)redhat.com>
Date: Wed Jan 7 08:03:48 2009 -0500
- final preparations complete to include into fedora
rhbz#477190
- initial support for module extraction
- initial support for analyzing x86 cores on x86_64
machines
diff --git a/cas b/cas
index 004d9a0..d4bec50 100755
--- a/cas
+++ b/cas
@@ -137,9 +137,12 @@ class CasApplication(object):
help="Unique ID for core")
parser.add_option("-f","--file", dest="filename",
help="Filename")
- parser.add_option("-m","--email", dest="email",
+ parser.add_option("-e","--email", dest="email",
help="Define email for results (must be valid!)",
- action="store", default="root(a)localhost.localdomain")
+ action="store")
+ parser.add_option("-m","--modules", dest="kernel_modules",
+ help="Extract associated kernel modules",
+ action="store_true")
self.opts, args = parser.parse_args()
if not self.opts.identifier:
@@ -150,6 +153,7 @@ class CasApplication(object):
self.filename = self.opts.filename
self.identifier = self.opts.identifier
self.email = self.opts.email
+ self.extractKernelModules = self.opts.kernel_modules
self.storagePath = os.path.join(WORKDIRECTORY, self.identifier)
# build logger object to deal with logging per job and keep things
@@ -184,14 +188,27 @@ class CasApplication(object):
currentMachineArch = currentMachineArch.stdout.read().strip()
# Check if we have installed crash 32bit on system
if debugKernelArch == "i686" and CRASH_32 is not None:
- pass
- # TODO: re-write crash output library to take into account
+ # DONE: re-write crash output library to take into account
# 32bit crash on same system.
self.util.buildCrashFile(self.storagePath, corefile, debugKernel,
CRASH_32)
self.casLog.info("Current machine suitable for processing 32 bit core, "\
"running crash.")
cmd = os.path.join(self.storagePath,"crash")
+ cmdPipe = Popen([cmd], stdout=PIPE, stderr=PIPE)
+ cmdData = cmdPipe.communicate()
+ # pull status code to verify crash even ran to completeness
+ sts, out, err = (cmdPipe.returncode, cmdData[0].strip(),
+ cmdData[1].strip())
+ if sts:
+ self.casLog.debug("crash problem: err: %s, out: %s" % (err, out))
+ elif debugKernelArch == currentMachineArch:
+ import platform
+ # Define current machine hostname, mainly used for email results.
+ casProcessMachine = platform.uname()[1]
+ # The machine is suitable for processing the core through crash.
+ self.casLog.info("Current machine suitable for processing core, running crash.")
+ cmd = os.path.join(self.storagePath,"crash")
# DONE: capture any errors returned from crash when processing core.
cmdPipe = Popen([cmd], stdout=PIPE, stderr=PIPE)
cmdData = cmdPipe.communicate()
@@ -200,7 +217,7 @@ class CasApplication(object):
cmdData[1].strip())
if sts:
self.casLog.debug("crash problem: err: %s, out: %s" % (err, out))
- if debugKernelArch != currentMachineArch:
+ else:
# The machine running cas isn't capable of processing this core, lets
# attempt with Func. Assuming Func is installed and a server database
# is configured we attempt to process the core at another machine.
@@ -236,23 +253,36 @@ class CasApplication(object):
"and http://fedorahosted.org/func is not installed/configured properly.")
self.casLog.info("Finishing job without processing the core, please find a suitable %s "\
"machine in order to view this core in crash." % (debugKernelArch,))
- else:
- import platform
- # Define current machine hostname, mainly used for email results.
- casProcessMachine = platform.uname()[1]
- # The machine is suitable for processing the core through crash.
- self.casLog.info("Current machine suitable for processing core, running crash.")
- cmd = os.path.join(self.storagePath,"crash")
- # DONE: capture any errors returned from crash when processing core.
- cmdPipe = Popen([cmd], stdout=PIPE, stderr=PIPE)
- cmdData = cmdPipe.communicate()
- # pull status code to verify crash even ran to completeness
- sts, out, err = (cmdPipe.returncode, cmdData[0].strip(),
- cmdData[1].strip())
- if sts:
- self.casLog.debug("crash problem: err: %s, out: %s" % (err, out))
crashOutFile = os.path.join(self.storagePath,"crash.out")
- if os.path.isfile(crashOutFile):
+ if os.path.isfile(crashOutFile) and self.extractKernelModules:
+ self.casLog.info("Extracting loaded kernels modules. This will " \
+ "take several minutes.")
+ # Here we extract kernel modules processed from crash.out
+ # this is usually desired during filesystem, storage
+ # analysis of a core.
+ crashOutFH = open(crashOutFile, 'r')
+ crashOutData = crashOutFH.readlines()
+ # search for MODULE NAME SIZE OBJECT FILE line
+ for item in enumerate(crashOutData):
+ idx, txt = item
+ if 'MODULE' in txt:
+ index = idx
+ moduleList = []
+ # we have our index of above, now we obtain
+ # the loaded modules from the list
+ for item in crashOutData[index+1:]:
+ moduleList.append(item.split()[1])
+ # shift through moduleList extracting from
+ # kernel as we go
+ for module in moduleList:
+ # This will extract all modules for each kernel within
+ # the debuginfo.
+ # TODO: Only extract the module for the debug kernel in use.
+ moduleFilter = "*/"+module+".ko*"
+ self.rpmTool.extract(debuginfo, self.storagePath,
+ filter=moduleFilter,
+ return_results=False)
+ if os.path.isfile(crashOutFile) and self.email:
self.casLog.info("Crash output processed, sending email to %s" % (self.email,))
try:
# Compose email msg of results
diff --git a/cas.spec b/cas.spec
index 41b7542..dfe5cd7 100644
--- a/cas.spec
+++ b/cas.spec
@@ -3,7 +3,7 @@
Name: cas
Summary: Tool to analyze and configure core file environment
Version: 0.13
-Release: 114%{?dist}
+Release: 115%{?dist}
Source0: https://fedorahosted.org/releases/c/a/cas/%{name}-%{version}.tar.gz
License: GPLv3+
Group: Development/Libraries
@@ -26,7 +26,7 @@ types to core dumps are automatically detected and processed.
%install
rm -rf ${RPM_BUILD_ROOT}
-%{__python} setup.py install -O1 --skip-build --root $RPM_BUILD_ROOT
+%{__python} setup.py install -O1 --skip-build --root ${RPM_BUILD_ROOT}
%clean
rm -rf ${RPM_BUILD_ROOT}
15 years, 3 months
2 commits - cas cas.conf cas.spec lib/cas Makefile MANIFEST.in version
by Adam Stokes
MANIFEST.in | 1
Makefile | 5 -
cas | 26 ++++++
cas.conf | 6 +
cas.spec | 33 +++++---
lib/cas/grabcoretools.py | 186 -----------------------------------------------
lib/cas/util.py | 7 +
version | 1
8 files changed, 58 insertions(+), 207 deletions(-)
New commits:
commit a6774cb9567c1b0500e7ed5c939b6699299d8550
Author: Adam Stokes <ajs(a)redhat.com>
Date: Tue Jan 6 06:48:57 2009 -0500
- initial work to support 32bit crash on x86_64 systems
diff --git a/cas b/cas
index 2854f72..004d9a0 100755
--- a/cas
+++ b/cas
@@ -43,6 +43,14 @@ DEBUGLEVEL = config.get("settings","debugLevel")
SERVERS = config.get("settings", "servers")
SMTPHOST = config.get("settings", "mailServer")
+# Check for some advanced configurations
+# Test to see if we provide a 32bit crash binary
+# mainly used for x86_64 system who wish to analyze
+# 32bit cores.
+CRASH_32=None
+if config.has_option("advanced", "crash_32"):
+ CRASH_32=config.get("advanced", "crash_32")
+
class CoreHandler(object):
def __init__(self, filename, dst, logger):
self.filename = filename
@@ -174,6 +182,24 @@ class CasApplication(object):
# with processing the core on the current machine
currentMachineArch = Popen(["uname","-m"], stdout=PIPE, stderr=PIPE)
currentMachineArch = currentMachineArch.stdout.read().strip()
+ # Check if we have installed crash 32bit on system
+ if debugKernelArch == "i686" and CRASH_32 is not None:
+ pass
+ # TODO: re-write crash output library to take into account
+ # 32bit crash on same system.
+ self.util.buildCrashFile(self.storagePath, corefile, debugKernel,
+ CRASH_32)
+ self.casLog.info("Current machine suitable for processing 32 bit core, "\
+ "running crash.")
+ cmd = os.path.join(self.storagePath,"crash")
+ # DONE: capture any errors returned from crash when processing core.
+ cmdPipe = Popen([cmd], stdout=PIPE, stderr=PIPE)
+ cmdData = cmdPipe.communicate()
+ # pull status code to verify crash even ran to completeness
+ sts, out, err = (cmdPipe.returncode, cmdData[0].strip(),
+ cmdData[1].strip())
+ if sts:
+ self.casLog.debug("crash problem: err: %s, out: %s" % (err, out))
if debugKernelArch != currentMachineArch:
# The machine running cas isn't capable of processing this core, lets
# attempt with Func. Assuming Func is installed and a server database
diff --git a/cas.conf b/cas.conf
index 5a49447..89af903 100644
--- a/cas.conf
+++ b/cas.conf
@@ -37,3 +37,9 @@ jobs=/var/db/cas/jobs.db
# Mail server, e.g. mail.example.com
# Provides job results via email
mailServer=mail.example.com
+
+[advanced]
+# if running a x86_64 system and wish to analyze 32bit
+# cores, define the location of 32bit crash binary
+
+# crash_32=/usr/local/i386/bin/crash
diff --git a/lib/cas/util.py b/lib/cas/util.py
index 3ed4fff..cc4d834 100755
--- a/lib/cas/util.py
+++ b/lib/cas/util.py
@@ -141,7 +141,8 @@ class UtilBase(object):
return supportArch[k]
return False
- def buildCrashFile(self, dst, vmcore, debug, file_in="crash.in"):
+ def buildCrashFile(self, dst, vmcore, debug, file_in="crash.in",
+ crash_bin="/usr/bin/crash"):
""" build crash file with predefined debug
commands
"""
@@ -169,8 +170,8 @@ class UtilBase(object):
crashInputFH.close()
vmcorePath = os.path.join(dst, vmcore)
- crashCmd = "#!/bin/sh\ncrash %s %s -s < %s\n" % (vmcorePath, debug,
- crashInputPath)
+ crashCmd = "#!/bin/sh\n%s %s %s -s < %s\n" % (crash_bin, vmcorePath,
+ debug, crashInputPath)
crashExe = os.path.join(dst,"crash")
fh = open(crashExe,"w")
fh.write(crashCmd)
commit 2a4994f7f990983dcabdbeca07e14036b570f00c
Author: Adam Stokes <ajs(a)redhat.com>
Date: Mon Dec 29 08:20:07 2008 -0500
- remove uneeded python lib
- remove version as we rely on spec file for version info
- updated makefile
diff --git a/MANIFEST.in b/MANIFEST.in
index 4b3ea3a..ab1c592 100644
--- a/MANIFEST.in
+++ b/MANIFEST.in
@@ -3,4 +3,3 @@ include cas.1.gz
include cas-admin.1.gz
include LICENSE
include README
-include version
diff --git a/Makefile b/Makefile
index 8cd102e..412097c 100644
--- a/Makefile
+++ b/Makefile
@@ -1,8 +1,8 @@
# cas Makefile
NAME = cas
-VERSION = $(shell echo `awk '{ print $$1 }' version`)
-RELEASE = $(shell echo `awk '{ print $$2 }' version`)
+VERSION = $(shell echo `awk '/^Version:/ {print $$2}' cas.spec`)
+RELEASE = $(shell echo `awk '/^Release:/ {gsub(/\%.*/,""); print $2}' cas.spec`)
MANPAGE1 = $(PWD)/cas.1
MANPAGE2 = $(PWD)/cas-admin.1
SOURCE1 = version
@@ -21,7 +21,6 @@ tarball: clean
@mkdir /tmp/$(NAME)
@mv /tmp/$(NAME) /tmp/$(NAME)-$(VERSION)
@python setup.py sdist -d /tmp/$(NAME)-$(VERSION)
- @cp {$(SOURCE1),$(SOURCE2),$(SOURCE3),$(SOURCE4)} /tmp/$(NAME)-$(VERSION)
@mkdir $(PWD)/dist
@mv /tmp/$(NAME)-$(VERSION)/* $(PWD)/dist
@echo " "
diff --git a/cas.spec b/cas.spec
index 7a8c923..41b7542 100644
--- a/cas.spec
+++ b/cas.spec
@@ -1,27 +1,22 @@
%{!?python_sitelib: %define python_sitelib %(%{__python} -c "from distutils.sysconfig import get_python_lib; print get_python_lib()")}
Name: cas
-Summary: Tool to analyze and configure core file environment.
-Source1: version
-Version: %(echo `awk '{print $1 }' %{SOURCE1}`)
-Release: %(echo `awk '{print $2 }' %{SOURCE1}`)%{?dist}
-Source0: %{name}-%{version}.tar.gz
-Source2: cas-admin.1.gz
-Source3: cas.1.gz
-Source4: cas.conf
-License: GPL
+Summary: Tool to analyze and configure core file environment
+Version: 0.13
+Release: 114%{?dist}
+Source0: https://fedorahosted.org/releases/c/a/cas/%{name}-%{version}.tar.gz
+License: GPLv3+
Group: Development/Libraries
BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-buildroot
BuildArch: noarch
Url: http://fedorahosted.org/cas
BuildRequires: python-devel
-Requires: python >= 2.4
Requires: crash
%description
-CAS provides a support engineer the ability to configure an environment for
-core analysis quickly. All the hassles of configuring architecture specific
-boxes, finding machines suitable for a particular core is now taken care of.
+CAS provides a user the ability to configure an environment for core analysis
+quickly. All the hassles of matching kernel versions and machine architecture
+types to core dumps are automatically detected and processed.
%prep
%setup -q
@@ -47,6 +42,18 @@ rm -rf ${RPM_BUILD_ROOT}
%doc LICENSE README PKG-INFO
%changelog
+* Mon Dec 29 2008 Adam Stokes <ajs at redhat dot com> - 0.13-114
+- changed license to gplv3 or later
+- removed source requirements as these are handled by python manifest
+- removed python requirement
+- updated description
+
+* Fri Dec 19 2008 Adam Stokes <ajs at redhat dot com> - 0.13-113
+- rpmlint verified
+- manually set version/release in spec
+- license tag fix
+- added full path to upstream source release
+
* Mon Dec 15 2008 Adam Stokes <ajs at redhat dot com> - 0.13-94
- no replace on config file
- cas now processes locally and remotely via func
diff --git a/lib/cas/grabcoretools.py b/lib/cas/grabcoretools.py
deleted file mode 100755
index cef0081..0000000
--- a/lib/cas/grabcoretools.py
+++ /dev/null
@@ -1,186 +0,0 @@
-#!/usr/bin/env python
-
-from ftplib import FTP
-from time import sleep, time
-import cPickle
-import cas.utilities
-import commands
-import logging
-import os
-import re
-import subprocess
-import sys
-
-build_sys={'i686' : 'core-i386.gsslab.rdu.redhat.com',
- 'x86_64' : 'megatron.gsslab.rdu.redhat.com',
- 'ia32e' : 'megatron.gsslab.rdu.redhat.com',
- 'ia64' : 'core-ia64.gsslab.rdu.redhat.com',
- 'ppc64' : 'core-ppc.gsslab.rdu.redhat.com'}
-
-class Grabcoretools(casui.cas.utilities.Utilities):
- ''' utilites for grabcore
- '''
- def getBacktrace(self,server,path,fname):
- ''' obtain initial backtrace from core
- requires expect package to be installed on system
- '''
- escPath=re.escape(path)
- crashCommands = ['bt -a','sys','sys -c',
- 'kmem -f', 'log', 'mod']
- cmd = '''#!/usr/bin/expect -f
-set timeout -1
-spawn %s
-match_max 100000
-''' % ('/'.join((path,fname)))
- for i in crashCommands:
- cmd +='''expect -re 'crash> '
-send -- '%s > %s\\/%s\\r'
-expect -exact '%s > %s\\/%s\\r'
-''' % (i,escPath,i.replace(' ',''),
- i,escPath,i.replace(' ',''))
- cmd +='''expect -re 'crash> '
-send -- 'quit\\r'
-expect -exact 'quit\\r'
-expect eof
-'''
- fd=open(path+'/expect-core','w')
- fd.write(cmd)
- fd.close()
- self._exec('ssh root@%s expect %s/expect-core' %
- (server, path))
- sleep(10)
- out = commands.getoutput('cat %s/{sys,bt-a,kmem-f,log,mod}' % (path,))
- return out
-
- def crash(self, workpath):
- ''' create crash wrapper
- This is accomplished by generating a list of files in
- workpath and building the wrapper based on vmlinux and
- the corefile.
- '''
- fd=open(os.path.join(workpath,'/crash'), 'w')
- dir_listing=self.dirList(workpath)
- vmlinux_list=[]
- for a in dir_listing:
- ftype = commands.getoutput('file -bi %s' % (a,))
- if self.filetype(ftype):
- vmlinux_list.append('%s' % (a))
- wrapper_txt='''#!/bin/bash
-crash %s
-''' \
- % (' '.join(vmlinux_list))
- fd.write(wrapper_txt)
- self.make_exe(os.path.join(workpath,'/crash'))
- fd.close()
- return
-
- def checkFingerprint(self, path):
- ''' captures fingerprint from core
- '''
- match='Linux\sversion.*\d{1,4}|#1\s.*20\d{1,2}'
- try:
- fd=open('%s' % (path))
- except IOError: return False
- fd.seek(0)
- b = fd.read(54000000)
- self.out = self.regexFindall(match, b)
- if not out:
- self.log(logging.ERROR, 'Unable to detect ' \
- 'fingerprint in %s' % (path,))
- return False
- return self.out
-
- def getFingerprint(self, db, txt):
- ''' return rpm->vmlinux for fingerprint
- '''
- self.flist=self.unpickleMe(db)
- self.out=[]
- for k, v in self.flist.iteritems():
- for i in v:
- for a, b in i.iteritems():
- if b == txt or txt in b:
- self.out.append(k)
- self.out.append(a)
- return self.out
- # If we get here we didnt find a fingerprint
- self.log(logging.ERROR, 'No matching fingerprint %s' % (txt,))
- return False
-
- def coreServer(self, vmname):
- ''' Map server for given core/vmlinux
- '''
- for k, v in build_sys.iteritems():
- for a in vmname:
- reg = self.regexFindall(r'.*%s.*' % (k,), a)
- if reg:
- return v
- return False
-
- def filetype(self, txt):
- ''' Determine if filetype is acceptable
- to process in work directory
- '''
- items = ['application/x-coredump',
- 'application/octet-stream',
- 'application/x-executable']
- for i in items:
- if i in txt and 'reports' not in txt:
- return True
- return False
-
- def isRHEL3(self, vmname):
- ''' Test version for RHEL3
- '''
- for i in vmname:
- if '2.4.21' in i: return True
- else: return False
-
- def extractDebug(self, vmname):
- ''' Extract debugging symbols from associated kernel rpms
- '''
- cmd = 'rpm2cpio %s | cpio -idv --quiet %s' % (vmname[0], vmname[1])
- print cmd
- self._exec([cmd])
- if self.isRHEL3(vmname):
- # FIXME: crazy ass regex search and replace to capture
- # proper rhel3 debuginfo package
- p = re.compile('(kernel-(smp|hugemem)-|kernel-)')
- begindebug = re.compile('(./boot/)')
- enddebug = re.compile('($)')
- a = p.sub('kernel-debuginfo-', vmname[0])
- b = begindebug.sub('./usr/lib/debug/boot/', vmname[1])
- c = enddebug.sub('.debug', b)
- self._exec(['rpm2cpio %s | cpio -idv --quiet %s'
- % (a, c)])
- return
-
- def getLoadedKernelModules(self, modfile):
- ''' list kernel modules based on `mod` output in crash
- '''
- self.mod = modfile
- if os.path.isfile(self.mod):
- fd = open(self.mod,'r').read()
- self.mod_list = fd.split('\n')[1:-1]
- self.mod_list_final = []
- for item in self.mod_list:
- self.mod_list_final.append(item.split()[1])
- return self.mod_list_final
-
- def getLoadedKernelModulesPath(self, modlist, fingerprint):
- ''' list full module paths
- '''
- self.fingerprint = fingerprint
- self.modlist = modlist
- self.search_path = '/'.join(self.fingerprint[1].split('/')[:-1])
- self.pattern = re.escape(self.search_path)
- self.module_path = []
- for module in self.modlist:
- cpio_grep = commands.getoutput('rpm2cpio %s|cpio -tv|grep %s.*%s' %
- (self.fingerprint[0],
- self.pattern,
- module))
- cpio_grep_split = cpio_grep.split('\n')[1:]
- for item in cpio_grep_split:
- self.module_path.append(item.split()[-1])
- return self.module_path
-
diff --git a/version b/version
deleted file mode 100644
index d13d5c2..0000000
--- a/version
+++ /dev/null
@@ -1 +0,0 @@
-0.13 112
15 years, 3 months