Bug 157108 - rpm install issues "cpio: MD5 sum mismatch" for symlinks that generated prelink error during build
rpm install issues "cpio: MD5 sum mismatch" for symlinks that generated preli...
Product: Fedora
Classification: Fedora
Component: rpm (Show other bugs)
i386 Linux
medium Severity low
: ---
: ---
Assigned To: Paul Nasrat
Mike McLean
Depends On:
  Show dependency treegraph
Reported: 2005-05-06 17:43 EDT by Chris Cogdon
Modified: 2007-11-30 17:11 EST (History)
1 user (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Last Closed: 2005-11-04 07:52:05 EST
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---

Attachments (Terms of Use)

  None (edit)
Description Chris Cogdon 2005-05-06 17:43:51 EDT
From Bugzilla Helper:
User-Agent: Mozilla/5.0 (Macintosh; U; PPC Mac OS X Mach-O; en-US; rv:1.7.6) Gecko/20050331 Camino/0.8.3

Description of problem:
During the 'package' phase of building an RPM, when packaging a symlink that points to a library, and the 'prelink check' phase generates the following error on that symlink:

"prelink: <full-path-to-symlink>: at least one of file�s dependencies has changed since prelinking"

Then attempting to install the resulting rpm file will generate the following error:

error: unpacking of archive failed on file <path to symlink>;<some number>: cpio: MD5 sum mismatch

Version-Release number of selected component (if applicable):

How reproducible:

Steps to Reproduce:
1. Create a 'build root' tree that may or may not contain several files. However, copy at least one library file into this tree, and create a symlink in the tree that points to the library. (My example used libtermcap.so.2, and the symlink was simply libtermcap.so).
2. Create a very simple .spec file that does nothing but package up that tree, setting the BuildRoot to the top of the tree. For example:

--- --- ---
Summary: Test Package
Name: test-package
Version: 1.0
Release: 1
License: Public Domain
Group: Applications/Development
AutoReqProv: off
BuildRoot: %{inbuildroot}

Simple Test






%defattr(-, root, root)
--- --- ---

3. Run the specfile. (Notice the warning message from prelink)
4. Attempt to install the package.

Actual Results:  Installation Generates "error: unpacking of archive failed on file <path to symlink>;<some number>: cpio: MD5 sum mismatch"

Expected Results:  Installation should complete without error.

Additional info:

I SUSPECT what is happening is that the warning from the prelink check is confusing RPM somewhat, and causing RPM to generate an incorrect md5 for the affected symlink.

--nomd5 during the install allows rpm --install to complete, and DOES save the symlink correctly.

As a workaround, add the following to the top of the SPEC file that's giving problems:

%define __prelink_undo_cmd %{nil}

This will turn off the prelink check during packaging, and the resulting package will install fine.

I COMPLETELY understand that this is an exceptionally esoteric issue, and probably won't be fixed anytime soon. However, I spent a lot of time tracking this one down, and I'd like to save the next person from the same heartache :)
Comment 1 Jeff Johnson 2005-11-04 07:52:05 EST
Considering the complexity of the interaction of prelink and rpm --verify, I see no
meaningful way to permit prelink to change the contents of a file while rpm --verify
computes an invariant digest.

Insuring that prelink has been run, and is not actively running while building, needs
to be done by the build system, not by rpmbuild.

Note You need to log in before you can comment on or make changes to this bug.