RPM Community Forums

Mailing List Message of <rpm-users>

Re: Adding rpm software to platform - cpio: MD5 sum mismatch when installing rpm's

From: Jeff Johnson <n3npq@mac.com>
Date: Tue 09 Nov 2010 - 20:46:53 CET
Message-id: <58B790D9-81F2-43FE-9C93-9944CFAD1675@mac.com>

On Nov 9, 2010, at 1:57 PM, Andy Furtado wrote:

> Hello, 
> 
> I'm adding the RPM software to our linux platform. It builds and almost appears to work but I'm seeing the following.
> 
> I'm having a problem with installing rpm's. More details are below but the most recent thing I've discovered is the call to NSS_NoDB_Init fails with -5925 during RPMBUILD and RPM installs, so I'm wondering if this could be my problem. 
> 

Hmmm ... what version of RPM? All I can tell is _NOT_ rpm-5.3.6,
which is opening the NSS database to test the FIP 140-2 bit.

(i.e. rpm-5.3.4 (iirc) and later is _NOT_ calling NSS_NoDB_Init() but rather NSS_Init() ...)

> I've also tried installing a fairly simple rpm ...
> rpm -ivv --nodeps nano-2.0.6-4.fc9.i386.rpm
> But have the same checksum problem. 
> 

Checksim problems ... hmmm ...

Is the RPM package just re-bundling already compiled libraries?

If do, you need to make sure the libraries are _NOT_ prelinked
when re-bundling.


All you really need to do is run
	prelink --undo
on any library (or copy) that you choose to rebundle.

> Any help, or info on other resources would be greatly appreciated. 
> 
> Here are more details...
> I'm having a problem installing an RPM that I created that only contains %files section to be installled on a i386 platform. 
> The rpm database is currently empty so this is the first thing going in.
> 
> The problem is ...
>   $ rpm -i /rpm/RPMS/i386/axis-4.0-1.i386.rpm 
> error: unpacking of archive failed on file /device_handlers/axis/axis.so;4cd1a2a6: cpio: MD5 sum mismatch
> 

In addition to the (quite subtle) prelinking issue I just mentiopned,
ther's also the switch from MD5 -> SHA256 in Fedora (and RHEL6) that
has legacy compatibility issues.

> What is actually being checksum'd during an install?
> 


RPM does a checksum on file content while installing, that's the failure you are seeing.

Adding --nofidigest (the oleder name is --nomd5sums) to disable the content digest
can be done: no guarantees whatsoever what happens if you disable with --nofdigests.

> The target platform is based on FC10 but not a complete distribution.

FC10 is _BEFORE the switch from MD5 to SHA256.

> I'm adding RPM to our platform, and the rpm source from rpm-4.6.1-3.fc10.src.rpm is built in an isolated build area using chroot. 

FYI: You're on the wrong list for rpm-4.6.1 issues.

> I'm also running rpm and rpmbuild from the same isolated build environment. 
> My spec file is included below.
> 
> I'd like to perform an rpm install in this same isolated area, but having the problem above. 
> I believe I've satisfied all of the dependencies required, and manually verifying the md5sums have proven successful. 
> 
> My searches on the internet have found instances about incompatible libs needed for the packaged file but I don't think that is the case since I'm building everything against the same set of libs. I've also tried the prelink suggestions that I've found. 
> I feel like maybe I'm missing something (executable) that rpm needs for the checksum.
> 
> RPM VERIFY ...
> $ rpm -Kvv /rpm/RPMS/i386/axis-4.0-1.i386.rpm
> D: loading keyring from pubkeys in /var/lib/rpm/pubkeys/*.key
> D: couldn't find any keys in /var/lib/rpm/pubkeys/*.key
> D: loading keyring from rpmdb
> D: opening  db environment /var/lib/rpm/Packages cdb:mpool:joinenv
> D: opening  db index       /var/lib/rpm/Packages rdonly mode=0x0
> D: locked   db index       /var/lib/rpm/Packages
> D: opening  db index       /var/lib/rpm/Name rdonly mode=0x0
> D: Expected size:       458122 = lead(96)+sigs(120)+pad(0)+data(457906)
> D:   Actual size:       458122
> /rpm/RPMS/i386/axis-4.0-1.i386.rpm:
>     MD5 digest: NOKEY
> D: closed   db index       /var/lib/rpm/Name
> D: closed   db index       /var/lib/rpm/Packages
> D: closed   db environment /var/lib/rpm/Packages
> 
> Any information would be greatly appreciated.
> 
> Best Regards, 
> Andy
> 
> //THE SPEC FILE
> Summary: Device Handler
> Name: axis
> Version: 4.0
> Release: 1
> License: GPL
> BuildRoot: /device_handlers/%{name}
> BuildArch: i386
> 
> %define buildroot_dest %buildroot/device_handlers/%name
> 
> %prep
> 
> %description
> RPM to install handler.
> 
> %install
> mkdir -p %buildroot_dest
> cp -rv %_builddir/%name/* %buildroot_dest
> 
> %files
> %defattr(-,root,root)
> /device_handlers/%{name}/axis.so
> /device_handlers/%{name}/lib/libdhimpl.so.1
> 

These are binary libraries. Make sure that prelinking is removed by running
	prelink --undo
on these images. There's details in "man prelink", and you might
want to just blacklist (i.e. disable prelinking on those specific libraries)
globally (its in /etc/prelink.conf, I fergit, see the man page).

hth

73 de Jeff
> 
> 
Received on Tue Nov 9 20:47:37 2010
Driven by Jeff Johnson and the RPM project team.
Hosted by OpenPKG and Ralf S. Engelschall.
Powered by FreeBSD and OpenPKG.