[Crash-utility] building an RPM w/ LZO support

Dave Anderson anderson at redhat.com
Thu Sep 25 17:38:42 UTC 2014



----- Original Message -----
> I've been using crash 6.x for some time on Centos6, a binary RPM installed from a yum repo.
> Yesterday I realized I didn't have the crash extensions installed.  And a yum
> search found no listing for crash-extensions in my current repos.
> 
> So I downloaded a 7.0.8 source RPM from crash-utility.com, built and::
> installed it:
> 
> $ rpmbuild -vv --rebuild crash-7.0.8-0.src.rpm
> $ cd ~/rpmbuild/RPMS/x86
> $ sudo yum localinstall --nogpgcheck crash-7.0.8-0.rpm
> 
> But when I tested it on a previously working set of vmlinux/vmcore files,
> I got the following error:
> 
> crash: compressed kdump: uncompress failed: no lzo compression support
> 
> I eventually ended up extracting the source rpm and doing:
> 
> $ cd ~/dev/src/crash-7.0.8
> $ make lzo
> 
> and this copy of crash works.

Right -- that's all correct.
 
> However, I really wanted to make a new RPM out of this, but everything I tried
> always ended up reverting to no LZO.  Looking at the configure.c source, I see
> that 'make release' has a different method for building the Makefile which does
> not seem to allow for LZO. Is it possible to build an lzo-enabled rpm using
> crash configure and make?  Or with rpmbuild?  If so, how?

You can modify the crash.spec file by adding

  < BuildRequires: ncurses-devel zlib-devel bison
  > BuildRequires: ncurses-devel zlib-devel lzo-devel bison snappy-devel

  < make RPMPKG="%{version}"
  > make RPMPKG="%{version}" lzo snappy

And then create a new src.rpm with rpmbuild.

Alternatively, you could add this patch to the crash.spec file, which
is taken from the Fedora and RHEL7 distros: 

--- crash-7.0.2/diskdump.c.orig
+++ crash-7.0.2/diskdump.c
@@ -23,6 +23,8 @@
  * GNU General Public License for more details.
  */

+#define LZO
+#define SNAPPY
 #include "defs.h"
 #include "diskdump.h"

--- crash-7.0.2/Makefile.orig
+++ crash-7.0.2/Makefile
@@ -223,7 +223,7 @@ all: make_configure
 gdb_merge: force
        @if [ ! -f ${GDB}/README ]; then \
          make --no-print-directory gdb_unzip; fi
-       @echo "${LDFLAGS} -lz -ldl -rdynamic" > ${GDB}/gdb/mergelibs
+       @echo "${LDFLAGS} -lz -llzo2 -lsnappy -ldl -rdynamic" > ${GDB}/gdb/mergelibs
        @echo "../../${PROGRAM} ../../${PROGRAM}lib.a" > ${GDB}/gdb/mergeobj
        @rm -f ${PROGRAM}
        @if [ ! -f ${GDB}/config.status ]; then \

Dave




More information about the Crash-utility mailing list