Bug 149249 - RFE: Way to depend on a specific kernel package (including arch)
RFE: Way to depend on a specific kernel package (including arch)
Product: Fedora
Classification: Fedora
Component: kernel (Show other bugs)
All Linux
medium Severity medium
: ---
: ---
Assigned To: Rik van Riel
: FutureFeature
Depends On:
Blocks: FC4Blocker
  Show dependency treegraph
Reported: 2005-02-21 12:29 EST by Ville Skyttä
Modified: 2007-11-30 17:11 EST (History)
5 users (show)

See Also:
Fixed In Version:
Doc Type: Enhancement
Doc Text:
Story Points: ---
Clone Of:
Last Closed: 2005-05-28 04:29:57 EDT
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 Ville Skyttä 2005-02-21 12:29:59 EST
Currently, there's no way to depend on a specific kernel package in a way that
includes the kernel's arch.  Such a dependency is needed in kernel module packages.

Even N = V-R style dependencies (excluding the arch) cannot be made very
robustly now:

- Dependency on /boot/vmlinuz-$uname is not portable.

- Dependency on "kernel = version-release" is not reliable due to the broad
"Provides: kernel = version" provision (note: no release tag in it) in _all_
kernel packages, causing _any_ installed variant (SMP, etc) to satisfy the
dependency on a specific "kernel = version-release", *and* for any release that
has the required version.  IOW, a kernel-smp-V-R package has "Provides: kernel =
V", which satisfies for example "Requires: kernel = V-X" which is not desirable
in this case (think UP kernel module packages).

- Dependency on a dir below /lib/modules/$uname might be satisfied by a
non-kernel package, eg. a "buggy" module package.  Ditto (although less
probable) for files below it.  But this still doesn't include the arch.

Suggested remedy: an additional provision, something like:

  Provides: kernel(abi) = <output of "uname -r" for that kernel>-%{_target_cpu}

Using "uname -r" this way is consistent with most of the versioned things in the
kernel package.  Alternatively:

  Provides: kernel(abi) = %{version}-%{release}-%{_target_cpu}     # UP kernel
  Provides: kernel-smp(abi) = %{version}-%{release}-%{_target_cpu} # SMP kernel
  # etc...

That would work too, but I personally think it's not as easy to work with as
"uname -r".

Yes, generic arch-qualified dependencies in rpm would be a nifty feature that
could help with this issue (assuming eg. the broad "kernel = V" provision in all
kernel packages wouldn't interfere with it).  It's not needed in very many
packages outside of kernel and modules though, and the workarounds are trivial,
so I guess such a RFE would be promptly closed as WONTFIX referring to these
very workarounds.
Comment 1 Ville Skyttä 2005-02-21 12:41:04 EST
One more alternative:

   kernel-%{_target_cpu} = %{version}-%{release}
   kernel-smp-%{_target_cpu} = %{version}-%{release}

This is analoguous with the kernel*-devel-%{_target_cpu} provisions in Rawhide's
kernel*-devel packages.
Comment 2 Ville Skyttä 2005-03-15 12:18:53 EST
...one more for the road (my preferred one, I think):

  kernel-%{_target_cpu} = <uname -r output>
Comment 3 Rik van Riel 2005-03-15 12:43:07 EST
That would be:

kernel-%{_target_cpu} = %{KVERREL}

Easy enough.  I'll propose a patch today (and will probably commit it
today, too).
Comment 4 Ville Skyttä 2005-03-15 13:26:58 EST
Thanks.  But be sure to take the "variant" into account, like:

  kernel-%{_target_cpu} = %{KVERREL}
  kernel-%{_target_cpu} = %{KVERREL}smp
  kernel-%{_target_cpu} = %{KVERREL}xen0
  kernel-%{_target_cpu} = %{KVERREL}xenU
Comment 5 Rik van Riel 2005-03-15 13:35:41 EST
I now have:

Provides: kernel-%{_target_cpu} = %{rpmversion}-%{release}
Provides: kernel-smp-%{_target_cpu} = %{rpmversion}-%{release}
Provides: kernel-xen0-%{_target_cpu} = %{rpmversion}-%{release}
Provides: kernel-xenU-%{_target_cpu} = %{rpmversion}-%{release}

Chris, Ville, which do you prefer ?
Comment 6 Rik van Riel 2005-03-15 13:51:17 EST
OK, Chris prefers the variant proposed by Ville.  I'll go with that...

After all, you guys are my target audience ;)

*edits spec file and proposes new patch*
Comment 7 Rik van Riel 2005-03-15 14:51:04 EST
OK, the new patch was accepted.  I just committed a change to rawhide cvs that
adds headers of this form:

Provides: kernel-%{_target_cpu} = %{rpmversion}-%{release}smp

The next rawhide kernel build should have them.
Comment 8 Warren Togami 2005-05-16 04:29:52 EDT
Everyone satisfied?  close?
Comment 9 Chris Feist 2005-05-16 14:20:35 EDT
This will work for my module packages, thanks Rik!

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