Bug 1959914

Summary: Adopt kernel macros and scripts from redhat-rpm-config
Product: Red Hat Enterprise Linux 9 Reporter: Michal Domonkos <mdomonko>
Component: kernel-srpm-macrosAssignee: Michal Domonkos <mdomonko>
Status: CLOSED CURRENTRELEASE QA Contact: Radek Bíba <rbiba>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 9.0Keywords: Triaged
Target Milestone: beta   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: kernel-srpm-macros-1.0-7.el9 Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2021-12-07 21:50:14 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:

Description Michal Domonkos 2021-05-12 15:43:35 UTC
Consolidate the kernel-specific RPM macros and build scripts from redhat-rpm-config into this component.  This will (hopefully) make life easier for everybody, both the Kernel and RPM folks.

Specifically, this involves the adoption of the following items:

* The kernel-rpm-macros subpackage
* The kmod.attr macro file

The kmod.attr file is currently shipped via the binary redhat-rpm-config package itself, so to avoid a file conflict on upgrades, we'll also need to add an explicit Conflicts to the new kernel-rpm-macros version.

Oh, and speaking of versions - we'll also need to make sure kernel-rpm-macros actually is NVR-newer than the current release, so we'll also adopt the same versioning scheme from redhat-rpm-config.  This may not be optimal in the long run, but will prevent breakage for now.

Note that there still remain some kernel-specific bits in redhat-rpm-config, specifically in the find-provides and find-requires scripts; those are not subject of this BZ and may be moved later.

Comment 1 Michal Domonkos 2021-05-12 17:27:40 UTC
CentOS Stream MR:
https://gitlab.com/redhat/centos-stream/rpms/kernel-srpm-macros/-/merge_requests/1

Comment 2 Michal Domonkos 2021-05-13 11:05:31 UTC
One quick way to verify that the union of the files installed by the three affected packages remains the same before vs. after this change:

$ rpm -q redhat-rpm-config kernel-rpm-macros kernel-srpm-macros
redhat-rpm-config-184-1.el9.noarch
kernel-rpm-macros-184-1.el9.noarch
kernel-srpm-macros-1.0-5.el9.noarch

$ rpm -q --qf '[%{FILENAMES} %{FILESIZES} %{FILEDIGESTS}\n]' redhat-rpm-config kernel-rpm-macros kernel-srpm-macros | sort > old.list

$ dnf upgrade ...

$ rpm -q redhat-rpm-config kernel-rpm-macros kernel-srpm-macros
redhat-rpm-config-185-1.el9.noarch
kernel-rpm-macros-185-6.el9.el9.noarch
kernel-srpm-macros-1.0-6.el9.noarch

$ rpm -q --qf '[%{FILENAMES} %{FILESIZES} %{FILEDIGESTS}\n]' redhat-rpm-config kernel-rpm-macros kernel-srpm-macros | sort > new.list

$ diff old.list new.list  # shouldn't print anything