RHEL Engineering is moving the tracking of its product development work on RHEL 6 through RHEL 9 to Red Hat Jira (issues.redhat.com). If you're a Red Hat customer, please continue to file support cases via the Red Hat customer portal. If you're not, please head to the "RHEL project" in Red Hat Jira and file new tickets here. Individual Bugzilla bugs in the statuses "NEW", "ASSIGNED", and "POST" are being migrated throughout September 2023. Bugs of Red Hat partners with an assigned Engineering Partner Manager (EPM) are migrated in late September as per pre-agreed dates. Bugs against components "kernel", "kernel-rt", and "kpatch" are only migrated if still in "NEW" or "ASSIGNED". If you cannot log in to RH Jira, please consult article #7032570. That failing, please send an e-mail to the RH Jira admins at rh-issues@redhat.com to troubleshoot your issue as a user management inquiry. The email creates a ServiceNow ticket with Red Hat. Individual Bugzilla bugs that are migrated will be moved to status "CLOSED", resolution "MIGRATED", and set with "MigratedToJIRA" in "Keywords". The link to the successor Jira issue will be found under "Links", have a little "two-footprint" icon next to it, and direct you to the "RHEL project" in Red Hat Jira (issue links are of type "https://issues.redhat.com/browse/RHEL-XXXX", where "X" is a digit). This same link will be available in a blue banner at the top of the page informing you that that bug has been migrated.
Bug 2002887 - kmod package build macros are broken (cannot build OpenZFS)
Summary: kmod package build macros are broken (cannot build OpenZFS)
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Enterprise Linux 9
Classification: Red Hat
Component: kernel-srpm-macros
Version: CentOS Stream
Hardware: Unspecified
OS: Unspecified
urgent
urgent
Target Milestone: rc
: ---
Assignee: Eugene Syromiatnikov
QA Contact: Ziqian SUN (Zamir)
URL:
Whiteboard:
Depends On: 1975927
Blocks:
TreeView+ depends on / blocked
 
Reported: 2021-09-09 22:34 UTC by Neal Gompa
Modified: 2022-05-17 13:24 UTC (History)
10 users (show)

Fixed In Version: kernel-srpm-macros-1.0-10.el9
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2022-05-17 13:05:24 UTC
Type: Bug
Target Upstream Version:
Embargoed:
pm-rhel: mirror+


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Red Hat Issue Tracker RHELPLAN-96714 0 None None None 2021-09-09 22:35:53 UTC
Red Hat Product Errata RHEA-2022:2452 0 None None None 2022-05-17 13:05:34 UTC

Description Neal Gompa 2021-09-09 22:34:09 UTC
Description of problem:
I'm trying to build OpenZFS against CentOS Stream 9, and for some reason, the package build fails trying to detect the kernel to build against.

This package builds perfectly fine on CentOS Stream 8 using the centos-stream-8-x86_64 Mock configuration, but fails on CentOS Stream 9.

I expect this to still work, given that this is the standard macros for packaging kernel modules as RPMs.

Version-Release number of selected component (if applicable):
1.0-8.el9

How reproducible:
Always

Steps to Reproduce:
1. git clone https://pagure.io/openzfs-linux-packaging.git
2. cd openzfs-linux-packaging && git checkout 45b956a27a4cb9858c61348856fcda84c5325f0a
3. spectool -g zfs.spec
4. mock -r centos-stream-9 --sources . --spec zfs.spec

Actual results:
The build fails at the configure stage with the following error:

checking kernel source directory... /usr/src/kernels/2.1.0-1.el9.x86_64
configure: error:
        *** Please make sure the kernel devel package for your distribution
        *** is installed and then try again.  If that fails, you can specify the
        *** location of the kernel source with the '--with-linux=PATH' option.
RPM build errors:
error: Bad exit status from /var/tmp/rpm-tmp.QNtS6j (%build)
    /builddir/build/originals/zfs.spec: line 240: Macro %kmp_release defined but not used within scope
    /builddir/build/originals/zfs.spec: line 240: Macro %kmp_version defined but not used within scope
    Bad exit status from /var/tmp/rpm-tmp.QNtS6j (%build)
Child return code was: 1


Expected results:
The build should pass and produce all the necessary packages.

Comment 1 Neal Gompa 2021-09-30 19:59:54 UTC
I've determined that the problem is that somehow the %kernel_version macro is being defined incorrectly: https://gitlab.com/redhat/centos-stream/rpms/kernel-srpm-macros/-/blob/2625834549b16a87399be350c03d3874cd1c5135/macros.kmp#L19

When I use a local redefinition of %kernel_version, the options are correctly passed and it attempts to build. The local definition I put in my spec:

> %define kernel_version %(rpm -q --qf '%%{VERSION}-%%{RELEASE}' `rpm -q kernel-devel | /usr/lib/rpm/redhat/rpmsort -r | head -n 1` | head -n 1)

The build still fails, but it gets past the original issue.

Comment 2 Neal Gompa 2021-09-30 20:17:38 UTC
I think I've got a fix for this proposed: https://gitlab.com/redhat/centos-stream/rpms/kernel-srpm-macros/-/merge_requests/4

Comment 3 Neal Gompa 2021-09-30 22:02:51 UTC
Nope, it was more severe than I thought, and it looks like there were fixes done in RHEL 8 that were never synced into Fedora, so I'm updating the MR accordingly.

Comment 4 Neal Gompa 2021-09-30 22:30:42 UTC
I've also synced the changes to Fedora: https://src.fedoraproject.org/rpms/kernel-srpm-macros/pull-request/4

Comment 5 Neal Gompa 2021-09-30 22:41:51 UTC
(In reply to Neal Gompa from comment #2)
> I think I've got a fix for this proposed:
> https://gitlab.com/redhat/centos-stream/rpms/kernel-srpm-macros/-/merge_requests/4

I can confirm this works with commit b6bcc92b7f6b2a4596a59a59481d0ee8dadd6caa from my OpenZFS packaging repo. I needed to upgrade to ZFS 2.1.1 to make it work with Linux 5.14 after including the updated kernel-srpm-macros and kernel-rpm-macros packages in my local buildroot.

Comment 7 Neal Gompa 2021-11-02 21:49:29 UTC
Is there any progress on this yet? I haven't seen anything happen with my merge request since I proposed it...

Comment 16 errata-xmlrpc 2022-05-17 13:05:24 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory (new packages: kernel-srpm-macros), and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

https://access.redhat.com/errata/RHEA-2022:2452


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