From: Herton R. Krzesinski <herton(a)redhat.com>
redhat: make kernel-zfcpdump-core to not provide kernel-core/kernel
Upstream Status: RHEL only
As reported on bug 2027654*, when doing dnf install kernel on s390x it
might pull kernel-zfcpdump-core which should not be a choice for a
generic kernel. Adjust the kernel_variant_package macro to add an
option allowing adding provides or not and use it for the zfcpdump
variant.
v2: - fix if condition to not hide kernel-<flavour>-core-uname-r which is
required by the kernel-<flavour> meta package.
- wrap kernel provides in kernel_reqprovconf macro as well
- rename the macro option from -p to -o as suggested by Daniel Horak
v3: - fix kernel_reqprovconf expansion as noted by Bruno Goncalves/Jan Stancek
v4: - do not wrap installonlypkg since that should be only a hint to
yum/dnf to allow multiple versions of same packages installed
This same change was applied to centos stream 9, and is being forwarded
ported now to ARK/Fedora.
*https://bugzilla.redhat.com/show_bug.cgi?id=2027654
Signed-off-by: Herton R. Krzesinski <herton(a)redhat.com>
diff --git a/redhat/kernel.spec.template b/redhat/kernel.spec.template
index blahblah..blahblah 100755
--- a/redhat/kernel.spec.template
+++ b/redhat/kernel.spec.template
@@ -871,12 +871,14 @@ The kernel meta package
#
# This macro does requires, provides, conflicts, obsoletes for a kernel package.
-# %%kernel_reqprovconf <subpackage>
+# %%kernel_reqprovconf [-o] <subpackage>
# It uses any kernel_<subpackage>_conflicts and
kernel_<subpackage>_obsoletes
# macros defined above.
#
-%define kernel_reqprovconf \
+%define kernel_reqprovconf(o) \
+%if %{-o:0}%{!-o:1}\
Provides: kernel = %{specversion}-%{pkg_release}\
+%endif\
Provides: kernel-%{_target_cpu} = %{specversion}-%{pkg_release}%{?1:+%{1}}\
Provides: kernel-drm-nouveau = 16\
Provides: kernel-uname-r = %{KVERREL}%{?1:+%{1}}\
@@ -1270,9 +1272,9 @@ The meta-package for the %{1} kernel\
#
# This macro creates a kernel-<subpackage> and its -devel and -debuginfo too.
# %%define variant_summary The Linux kernel compiled for <configuration>
-# %%kernel_variant_package [-n <pretty-name>] [-m] <subpackage>
+# %%kernel_variant_package [-n <pretty-name>] [-m] [-o] <subpackage>
#
-%define kernel_variant_package(n:m) \
+%define kernel_variant_package(n:m:o) \
%package %{?1:%{1}-}core\
Summary: %{variant_summary}\
Provides: kernel-%{?1:%{1}-}core-uname-r = %{KVERREL}%{?1:+%{1}}\
@@ -1280,7 +1282,7 @@ Provides: installonlypkg(kernel)\
%if %{-m:1}%{!-m:0}\
Requires: kernel-core-uname-r = %{KVERREL}\
%endif\
-%{expand:%%kernel_reqprovconf}\
+%{expand:%%kernel_reqprovconf %{?1:%{1}} %{-o:%{-o}}}\
%if %{?1:1} %{!?1:0} \
%{expand:%%kernel_meta_package %{?1:%{1}}}\
%endif\
@@ -1330,7 +1332,7 @@ Cortex-A15 devices with LPAE and HW virtualisation support
%if %{with_zfcpdump}
%define variant_summary The Linux kernel compiled for zfcpdump usage
-%kernel_variant_package zfcpdump
+%kernel_variant_package -o zfcpdump
%description zfcpdump-core
The kernel package contains the Linux kernel (vmlinuz) for use by the
zfcpdump infrastructure.
--
https://gitlab.com/cki-project/kernel-ark/-/merge_requests/1908