Bug 112825

Summary: Can't create rpm dependent on particular kernel release
Product: [Retired] Red Hat Linux Reporter: Peter Fales <redhat.com>
Component: rpmAssignee: Jeff Johnson <jbj>
Status: CLOSED NOTABUG QA Contact: Mike McLean <mikem>
Severity: medium Docs Contact:
Priority: medium    
Version: 9CC: mitr
Target Milestone: ---   
Target Release: ---   
Hardware: All   
OS: Linux   
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2004-01-03 07:00:28 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---

Description Peter Fales 2004-01-02 22:33:22 UTC
Description of problem:

I'm trying to create an rpm which can only be installed if the 
matching kernel version (including release is installed).  My spec
file contains:

    Requires:       kernel = 2.4.20-24.9

However, the "24.9" part seems to ignored.  I've traced this through
the source a bit, and it seems that what happens is when an installed
rpm has a provides that does not include a release, then the release
is also ignored in the package that is being installed.   According
to the command:

    # rpm -q --queryformat '[%{PROVIDENAME} %{PROVIDEVERSION}\n]\n'
    kernel 2.4.20
    kernel-drm 4.1.0
    kernel-drm 4.2.0
    kernel-drm 4.3.0
    kernel 2.4.20-27.9

the kernel rpm provides both "kernel 2.4.20" and "kernel 2.4.20-27.9"

When my rpm is installed, the first one it finds is "kernel 2.4.20" -
this causes it to ignore the "-24.9" in my rpm, and the rpm gets
installed even though the release doesn't match.  

This may be a bug in the packaging of kernel.  It seems to me that 
providing only "kernel 2.4.20-27.9" should be sufficient.  If a
package is being installed that only depends on 2.4.20, then it should
 match, and if it specifically needs 2.4.20-27.9, then that should
match also.   However, it seems surprising that this hasn't arisen
before, so perhaps there is some workaround in rpm I'm not aware of.

How reproducible:


Steps to Reproduce:
1.  Create an rpm which includes
    Requires:       kernel = 2.4.20-24.9

2.  Install this package on kernel 2.4.20-27.9
Actual results:

Install completes

Expected results:

Install should fail due to kernel version mismatch

Additional info:

Comment 1 Jeff Johnson 2004-01-03 07:00:28 UTC
Use a file, not a package, dependency.

For example
    Requires: /lib/modules/2.6.0-0.1.14
will be satisfied iff the kernel-2.6.0-0.1.14 package is installed.