Bug 1450577 - [RFE] Enforce kernel-devel >= uname-r if any kernel-devel
Summary: [RFE] Enforce kernel-devel >= uname-r if any kernel-devel
Keywords:
Status: CLOSED WONTFIX
Alias: None
Product: Fedora
Classification: Fedora
Component: kernel
Version: rawhide
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: ---
Assignee: Kernel Maintainer List
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
: 1298126 (view as bug list)
Depends On:
Blocks: depchain 1294173
TreeView+ depends on / blocked
 
Reported: 2017-05-13 10:53 UTC by Nicolas Chauvet (kwizart)
Modified: 2019-07-03 17:31 UTC (History)
9 users (show)

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2019-07-02 13:08:40 UTC
Type: Bug


Attachments (Terms of Use)
Current WIP suggested patch (802 bytes, patch)
2017-05-13 10:57 UTC, Nicolas Chauvet (kwizart)
no flags Details | Diff

Description Nicolas Chauvet (kwizart) 2017-05-13 10:53:25 UTC
Description of problem:
When compiling out of tree kernel modules one can run into a situation where there is a version miss-match from any kernel and the related kernel-devel.

Version-Release number of selected component (if applicable):
long standing issue on fedora (so all version up to now).

How reproducible:
all version on fedora kernel (where a strict ABI is enforced based on exact uname -r).

Steps to Reproduce:
1. Install systemtap-devel (akmods, dkms, or any OOT modules).
2. Install the needed kernel-devel
3. Fetch "only" an updated kernel using updates-testing or fedora-rawhide-kernel-nodebug

Actual results:
The kernel is missing the needed kernel-devel at the right version.

Expected results:
The kernel-devel should be installed along the kernel to satisfy the condition:
"kernel-devel-uname-r == $(uname -r)"
Where uname -r is the last kernel installed.

Additional info:
This was initially tough to have a yum/dnf plugin to handle this:
https://bugzilla.rpmfusion.org/show_bug.cgi?id=3386

But with the rpm boolean dependencies I expect it should be possible to fix this issue in two steps:

First step is to have dkms/akmods to install the appropriate kernel-devel variant based on kernel package name.

Second step is to have the kernel package enable a boolean dependency to enforce  the right version when a given kernel-devel variant is installed:

Suggests: (kernel-devel-uname-r == %{KVERREL}%{?variant}%{?1:+%{1}} if kernel-devel-uname-r)

Comment 1 Nicolas Chauvet (kwizart) 2017-05-13 10:57:34 UTC
Created attachment 1278409 [details]
Current WIP suggested patch

This patch is yet un-tested, but should implement the suggested idea.

Comment 2 Nicolas Chauvet (kwizart) 2017-05-13 14:19:27 UTC
FYI, using boolean deps for installing the appropriate kernel-devel variant was initially suggested here: https://bugzilla.redhat.com/show_bug.cgi?id=1420754#c0

I'm currently working on this solution for akmods (untested yet).
For arched packages (systemtap), it's probably possible to %ifarch as appropriate

----
Requires: kernel-devel-uname-r
%if 0{?fedora:
Suggests: (kernel-devel if kernel)
Suggests: (kernel-debug-devel if kernel-debug)
Suggests: (kernel-PAE-devel if kernel-PAE)
Suggests: (kernel-PAEdebug-devel if kernel-PAEdebug)
Suggests: (kernel-lpae-devel if kernel-lpae)
Suggests: (kernel-rt-devel if kernel-rt)
}
----
But I wonder if kernel-rt implements kernel-devel-uname-r

Comment 3 Nicolas Chauvet (kwizart) 2017-07-24 13:23:23 UTC
Updated patch in the kernel mailing list:
https://lists.fedoraproject.org/archives/list/kernel@lists.fedoraproject.org/thread/6KCGSOP77VEGRC5UNC2FMRFEPEY2WSQ5/

This patch does not handle: 
- The installation of the appropriate variant. 
This can be handled elsewhere by using Requires: (kernel-devel if kernel) , etc.
- The case where the installed kernel-devel-uname-r is already higher than the kernel package been installed.

The reason is that I need to use >= instead of = for the dependency to avoid having the 3 kernel (last + 2 failbacks) to emit each one a dependency on a kernel-devel-uname when only the last one is installed. (the older ones are likely not available anymore from the repos).

Comment 4 Nicolas Chauvet (kwizart) 2017-12-18 20:53:46 UTC
*** Bug 1298126 has been marked as a duplicate of this bug. ***

Comment 5 Nicolas Chauvet (kwizart) 2019-07-02 13:08:40 UTC
FYI, I'm dropping this RFE, despite the current patch works fine in most common cases, it's way too much a problem in few corner cases (IIRC, like downgrading kernel, switching to kernel-rt or else...)

Comment 6 Raphael Groner 2019-07-03 17:31:32 UTC
Indeed, this request doesn't seem relevant any more due to VirtualBox (see bug #1294173, now EOL) made its dependency to DKMS as optional.


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