-
Notifications
You must be signed in to change notification settings - Fork 1.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix kmodtool for packaging mainline Linux #14617
Conversation
scripts/kmodtool
Outdated
@@ -333,7 +333,7 @@ print_customrpmtemplate () | |||
{ | |||
for kernel in ${1} | |||
do | |||
if [[ -e "${buildroot}/usr/src/kernels/${kernel}" ]] ; then | |||
if [[ -e "${buildroot}/usr/src/kernels/${kernel}" ]] && [[ "${kernel}" =~ el|fc ]]; then |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Unfortunately this is going to break some RedHat derivatives. Could we instead invert the conditional and check for a user-build-kernel and then a Fedora/RH kernel.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Inverting the conditional seems like it could work. I'll test it out and update this PR when I get the chance. Thanks!
kmodtool currently incorrectly identifies offical RHEL kernels, as opposed to custom kernels. This can cause the openZFS kmod RPM build to break. The issue can be reproduced by building a set of mainline Linux RPMs, installing them, and then attempting to build the openZFS kmod package against them. Signed-off-by: Timothy Day <timday@amazon.com>
This got closed/re-opened when I refreshed my Github fork. I need to find a better workflow for updating Github PRs. But I tested flipping the conditional on a few setups (based on CentOS specifically) and everything seemed to work well. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good, this passed my testing as well.
kmodtool currently incorrectly identifies official RHEL kernels, as opposed to custom kernels. This can cause the openZFS kmod RPM build to break. The issue can be reproduced by building a set of mainline Linux RPMs, installing them, and then attempting to build the openZFS kmod package against them. Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov> Signed-off-by: Timothy Day <timday@amazon.com> Closes openzfs#14617
kmodtool currently incorrectly identifies official RHEL kernels, as opposed to custom kernels. This can cause the openZFS kmod RPM build to break. The issue can be reproduced by building a set of mainline Linux RPMs, installing them, and then attempting to build the openZFS kmod package against them. Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov> Signed-off-by: Timothy Day <timday@amazon.com> Closes openzfs#14617
Motivation and Context
I built a kernel.org 5.15.94 using Clang for some work on a Lustre patch (https://review.whamcloud.com/c/fs/lustre-release/+/50063). I needed to build the openZFS kernel modules as well. The build failed because kmodtool was incorrectly identifying my kernel as a RHEL/CentOS one.
Description
Changing the order of the checks in kmodtool allows the kernel to be identified correctly. The custom kernel has the Makefile under
/lib/modules/${kernel}/build
, whereas the RHEL distributed kernel does not.How Has This Been Tested?
The kmod package builds on both my default system and the system with the custom kernel. I ran this though shellcheck and it didn't return any errors. The change isn't POSIX, but kmodtool is using bash in the shebang anyway.
Types of changes
Checklist:
Signed-off-by
.