Bug 1058331

Summary: kernel-modules-extra provides change - tracking bug
Product: [Fedora] Fedora Reporter: Bruno Wolff III <bruno>
Component: kernelAssignee: Kernel Maintainer List <kernel-maint>
Status: CLOSED CANTFIX QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: rawhideCC: bruno, franta, gansalmon, itamar, jonathan, kernel-maint, madhu.chinakonda, pahan, peterm, robatino, solo
Target Milestone: ---Keywords: Tracking
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2021-09-14 01:14:26 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On: 1056190, 1056191, 1056192, 1058330, 1096349    
Bug Blocks:    
Attachments:
Description Flags
yum output
none
yum output none

Description Bruno Wolff III 2014-01-27 14:58:19 UTC
Description of problem:
Dropping the provides of kernel-modules-extra in kernel-PAE-modules-extra has caused a few packages that need either the PAE or non-PAE version to start pulling in non-PAE kernel and kernel-modules-extra packages.

While installonlypkg(kernel-module) is provided by both modules-extra packages, it isn't intended to be used this way and would bring back the problem that was intended to be solved by dropping the provides in the first place.

There is a plan to do automated provides for all *.ko files. This would actually be better, as a package owner doesn't need to worry about whether that driver is in kernel or kernel-modules-extra. (There could still be issues about whether the PAE or non-PAE versions are preferred, as you'd want to match the installed kernel. (Well actually runtime kernel, but the package manager can't really do that.))

So for now people will need to install kernel-PAE-modules-extra manually when needed and live with kernel and kernel-modules-extra being unnecessarily installed in some cases.

Comment 1 Bruno Wolff III 2014-01-27 15:31:45 UTC
The macros to faciliate the change have already been incorporated in rpm (bug 1025513). It may be in the kernel spec shortly.

Comment 2 Josh Boyer 2014-03-03 14:11:38 UTC
*** Bug 1071521 has been marked as a duplicate of this bug. ***

Comment 3 Josh Boyer 2014-05-02 18:32:57 UTC
OK, so I enabled this locally.  The good news is that it works:

[jwboyer@vader 0.rc3.git4.6.fc21.1]$ rpm -qp --provides kernel-core-3.15.0-0.rc3.git4.6.fc21.1.x86_64.rpm | tail -n 4
kmod(zlib.ko)
kmod(zlib_deflate.ko)
kmod(zlib_inflate.ko)
kmod(zram.ko)
[jwboyer@vader 0.rc3.git4.6.fc21.1]$ 

The good yet not good news is that it works for all modules in all kernel flavor packages:

[jwboyer@vader 0.rc3.git4.6.fc21.1]$ rpm -qp --provides kernel-debug-core-3.15.0-0.rc3.git4.6.fc21.1.x86_64.rpm | tail -n 4
kmod(zlib.ko)
kmod(zlib_deflate.ko)
kmod(zlib_inflate.ko)
kmod(zram.ko)
[jwboyer@vader 0.rc3.git4.6.fc21.1]$

What that shows is that both the kernel-core and kernel-debug-core packages e.g. Provides:kmod(zram.ko).  This would be similarly true for any kernel package that has modules, so i686 and PAE, PAEdebug, etc.  It would also mean that if you had both the x86_64 and i686 versions in the same repo, they would both satisfy a Requires: kmod(zram.ko).  I don't believe this is what we actually want.

If a package such as gfs2-utils has:

Requires: kmod(gfs2.ko)

we want it to resolve to the kernel that is going to be installed or is already installed in the case of a missing kernel-modules or kernel-modules-extra package, not whatever comes first according to yum.  If we make the Provides more explicit like:

Provides: kmod(gfs2.ko)-uname-r = 3.15.0-0.rc3.git4.6.fc21

or

Provides: kmod(gfs2.ko)-uname-r = 3.15.0-0.rc3.git4.6.fc21+debug

(similar to the kernel-uname-r provides), then a package can't generically say "I want the gfs2 module installed".

I'm not sure how exactly to solve this as we originally intended.

Comment 4 Bruno Wolff III 2014-05-02 18:40:42 UTC
I don't think there is a way to perfectly solve the problem. I think this is still better than requiring kernel-modules-extra since in theory modules can switch between kernel-modules and kernel-modules-extra.

If the dep solver tries to bring in the minimum number of packages to provide the dep, then this will normally work as expected. For depsolves that grab everything, then you'll need to exclude stuff, but we do that already for spins.

Comment 5 Josh Boyer 2014-05-02 18:49:57 UTC
(In reply to Bruno Wolff III from comment #4)
> I don't think there is a way to perfectly solve the problem. I think this is
> still better than requiring kernel-modules-extra since in theory modules can
> switch between kernel-modules and kernel-modules-extra.

Yeah, that's a fair point.  I believe we already have an identical problem with just Requires: kernel-modules-extra anyway.

> If the dep solver tries to bring in the minimum number of packages to
> provide the dep, then this will normally work as expected. For depsolves
> that grab everything, then you'll need to exclude stuff, but we do that
> already for spins.

I'm mostly concerned about fresh installs.  I'm not sure how anaconda will resolve the deps if a user were to include a package that has a Requires: kmod(foo.ko) and both i686 and PAE are avaiable.  Perhaps the PAE install criteria would kick in and it would select the PAE flavor appropriately.

Comment 6 Josh Boyer 2014-05-02 20:25:37 UTC
I've created a copr with the autoprov enabled and the impacted packages switched over to doing Requires: kmod(whatever) instead of kernel-modules-extra.  Once the kernel build finishes, we can play around with it and see how things look.

http://copr-fe.cloud.fedoraproject.org/coprs/jwboyer/kernel-kmod-autoprov/

Comment 7 Bruno Wolff III 2014-05-02 20:41:22 UTC
Thanks for the heads up. I'll play with this over the weekend.

Comment 8 Bruno Wolff III 2014-05-03 20:26:18 UTC
Created attachment 892188 [details]
yum output

I am unable to update to kernel-PAE from the copr repo.

Comment 9 Josh Boyer 2014-05-04 00:14:42 UTC
(In reply to Bruno Wolff III from comment #8)
> Created attachment 892188 [details]
> yum output
> 
> I am unable to update to kernel-PAE from the copr repo.

Yeah, I fixed that bug this morning in rawhide.  I've started another build in the copr that hopefully fixes that issue.

Comment 10 Bruno Wolff III 2014-05-04 08:16:59 UTC
Created attachment 892262 [details]
yum output

So the upgrade to 3.15.0-0.rc3.git5.7.fc21.2 went OK. When I tried to install joystick-support, yum did ended up pulling in kernel-PAE-modules-extra to match the installed PAE kernel. However, kernel-PAE-modules-extra couldn't be installed.

Comment 11 Josh Boyer 2014-05-04 11:41:14 UTC
(In reply to Bruno Wolff III from comment #10)
> Created attachment 892262 [details]
> yum output
> 
> So the upgrade to 3.15.0-0.rc3.git5.7.fc21.2 went OK. When I tried to
> install joystick-support, yum did ended up pulling in
> kernel-PAE-modules-extra to match the installed PAE kernel. However,
> kernel-PAE-modules-extra couldn't be installed.

Yeah.  Same bug, different flavor.  I'll get it right eventually.  New build started.  Sadly, none of the issues you're seeing have anything to do with this bug.  Thanks for your patience.

Comment 12 Bruno Wolff III 2014-05-05 03:15:29 UTC
With 3.15.0-0.rc3.git5.8.fc21.2 things work as expected using yum to install joystick-support without already having kernel-PAE-modules-extra installed. It installs the PAE version to match the installed kernel. However, it doesn't install it for the running kernel, instead using the latest kernel. That's expected as a limitation with how kernel installs work.
Removing kernel-PAE-modules-extra triggered the removal of joystick-support.
I tested the same using dnf and it worked the same way.
I want to test using livecd-creator and an anaconda install to see if they work as expected with respect to PAE / non-PAE kernels, but I am not going to get to that tonight.

Comment 13 Bruno Wolff III 2014-05-14 15:18:51 UTC
Auto provides for kernel modules has been enabled in kernel-3.15.0-0.rc5.git2.8.fc21, which should show up in tomorrow's rawhide barring unexpected issues.
You can now use contructs like kmod(joydev.ko) to make sure the joystick driver is installed, instead of requiring kernel-modules-extra. This also makes packages proofed against modules moving between kernel-modules and kernel-modules-extra.

Comment 14 Josh Boyer 2014-05-14 17:32:19 UTC
I have patches to attach to each of the bugs blocking this one.  I'll try and do so later today.

Comment 15 Aleksey Avdeev 2014-12-23 15:41:34 UTC
In local assembly I correct this problem so the patch -- https://github.com/solooboroten/fedora-kernel/commit/78ed1231503d10c8d7f6582c02e99c8ccab1be3b. This solution is not as beautiful as pridlagaemoe, but it can satisfy the dependence existing in the repository packages without recompiling.

Comment 16 Aleksey Avdeev 2014-12-23 15:45:22 UTC
In local assembly I correct this problem so the patch -- https://github.com/solooboroten/fedora-kernel/commit/78ed1231503d10c8d7f6582c02e99c8ccab1be3b. This solution is not as nice as suggested, but it can satisfy the dependence existing in the repository packages without recompiling.

PS: This is a corrected version https://bugzilla.redhat.com/show_bug.cgi?id=1058331#c15.

Comment 17 Josh Boyer 2015-01-06 14:02:14 UTC
(In reply to Aleksey Avdeev from comment #16)
> In local assembly I correct this problem so the patch --
> https://github.com/solooboroten/fedora-kernel/commit/
> 78ed1231503d10c8d7f6582c02e99c8ccab1be3b. This solution is not as nice as
> suggested, but it can satisfy the dependence existing in the repository
> packages without recompiling.
> 
> PS: This is a corrected version
> https://bugzilla.redhat.com/show_bug.cgi?id=1058331#c15.

That patch doesn't seem to have anything to do with this specific bug, and I have no idea why it's necessary.  Could you explain the problem you're having?  If it isn't with the automated .ko provides, you should probably open a new bug.

Comment 18 Bruno Wolff III 2021-09-14 01:14:26 UTC
Issues with PAE vs non-PAE kernels have been moot for a while now.