From: Herton R. Krzesinski <herton@xxxxxxxxxx> rpmspec: build debug-* meta-packages if debug builds are disabled During upstream git snapshot builds, Fedora uses the debug configs to build the main kernels, and drops the *-debug package variants. However if someone installs a kernel-debug package for example it'll not update until the next non-snapshot build. So add support to keep the debug packages around even for snapshot builds, however in this case, they will be just meta-packages requiring the main kernel-* packages built with debug configs. Signed-off-by: Herton R. Krzesinski <herton@xxxxxxxxxx> diff a/redhat/kernel.spec.template b/redhat/kernel.spec.template --- a/redhat/kernel.spec.template +++ b/redhat/kernel.spec.template @@ -1039,9 +1039,9 @@ This is required to use SystemTap with %{name}%{?1:-%{1}}-%{KVERREL}.\ # # This macro creates a kernel-<subpackage>-devel package. -# %%kernel_devel_package <subpackage> <pretty-name> +# %%kernel_devel_package [-m] <subpackage> <pretty-name> # -%define kernel_devel_package() \ +%define kernel_devel_package(m) \ %package %{?1:%{1}-}devel\ Summary: Development package for building kernel modules to match the %{?2:%{2} }kernel\ Provides: kernel%{?1:-%{1}}-devel-%{_target_cpu} = %{version}-%{release}\ @@ -1058,6 +1058,9 @@ Requires: bison\ Requires: flex\ Requires: make\ Requires: gcc\ +%if %{-m:1}%{!-m:0}\ +Requires: kernel-devel-uname-r = %{KVERREL}\ +%endif\ %description %{?1:%{1}-}devel\ This package provides kernel headers and makefiles sufficient to build modules\ against the %{?2:%{2} }kernel package.\ @@ -1098,9 +1101,9 @@ This package provides kernel modules for the %{?2:%{2} }kernel package for Red H # # This macro creates a kernel-<subpackage>-modules-extra package. -# %%kernel_modules_extra_package <subpackage> <pretty-name> +# %%kernel_modules_extra_package [-m] <subpackage> <pretty-name> # -%define kernel_modules_extra_package() \ +%define kernel_modules_extra_package(m) \ %package %{?1:%{1}-}modules-extra\ Summary: Extra kernel modules to match the %{?2:%{2} }kernel\ Provides: kernel%{?1:-%{1}}-modules-extra-%{_target_cpu} = %{version}-%{release}\ @@ -1110,6 +1113,9 @@ Provides: installonlypkg(kernel-module)\ Provides: kernel%{?1:-%{1}}-modules-extra-uname-r = %{KVERREL}%{?1:+%{1}}\ Requires: kernel-uname-r = %{KVERREL}%{?1:+%{1}}\ Requires: kernel%{?1:-%{1}}-modules-uname-r = %{KVERREL}%{?1:+%{1}}\ +%if %{-m:1}%{!-m:0}\ +Requires: kernel-modules-extra-uname-r = %{KVERREL}\ +%endif\ AutoReq: no\ AutoProv: yes\ %description %{?1:%{1}-}modules-extra\ @@ -1118,9 +1124,9 @@ This package provides less commonly used kernel modules for the %{?2:%{2} }kerne # # This macro creates a kernel-<subpackage>-modules package. -# %%kernel_modules_package <subpackage> <pretty-name> +# %%kernel_modules_package [-m] <subpackage> <pretty-name> # -%define kernel_modules_package() \ +%define kernel_modules_package(m) \ %package %{?1:%{1}-}modules\ Summary: kernel modules to match the %{?2:%{2}-}core kernel\ Provides: kernel%{?1:-%{1}}-modules-%{_target_cpu} = %{version}-%{release}\ @@ -1129,6 +1135,9 @@ Provides: kernel-modules = %{version}-%{release}%{?1:+%{1}}\ Provides: installonlypkg(kernel-module)\ Provides: kernel%{?1:-%{1}}-modules-uname-r = %{KVERREL}%{?1:+%{1}}\ Requires: kernel-uname-r = %{KVERREL}%{?1:+%{1}}\ +%if %{-m:1}%{!-m:0}\ +Requires: kernel-modules-uname-r = %{KVERREL}\ +%endif\ AutoReq: no\ AutoProv: yes\ %description %{?1:%{1}-}modules\ @@ -1152,22 +1161,27 @@ 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>] <subpackage> +# %%kernel_variant_package [-n <pretty-name>] [-m] <subpackage> # -%define kernel_variant_package(n:) \ +%define kernel_variant_package(n:m) \ %package %{?1:%{1}-}core\ Summary: %{variant_summary}\ Provides: kernel-%{?1:%{1}-}core-uname-r = %{KVERREL}%{?1:+%{1}}\ Provides: installonlypkg(kernel)\ +%if %{-m:1}%{!-m:0}\ +Requires: kernel-core-uname-r = %{KVERREL}\ +%endif\ %{expand:%%kernel_reqprovconf}\ %if %{?1:1} %{!?1:0} \ %{expand:%%kernel_meta_package %{?1:%{1}}}\ %endif\ -%{expand:%%kernel_devel_package %{?1:%{1}} %{!?{-n}:%{1}}%{?{-n}:%{-n*}}}\ -%{expand:%%kernel_modules_package %{?1:%{1}} %{!?{-n}:%{1}}%{?{-n}:%{-n*}}}\ -%{expand:%%kernel_modules_extra_package %{?1:%{1}} %{!?{-n}:%{1}}%{?{-n}:%{-n*}}}\ +%{expand:%%kernel_devel_package %{?1:%{1}} %{!?{-n}:%{1}}%{?{-n}:%{-n*}} %{-m:%{-m}}}\ +%{expand:%%kernel_modules_package %{?1:%{1}} %{!?{-n}:%{1}}%{?{-n}:%{-n*}} %{-m:%{-m}}}\ +%{expand:%%kernel_modules_extra_package %{?1:%{1}} %{!?{-n}:%{1}}%{?{-n}:%{-n*}} %{-m:%{-m}}}\ +%if %{-m:0}%{!-m:1}\ %{expand:%%kernel_modules_internal_package %{?1:%{1}} %{!?{-n}:%{1}}%{?{-n}:%{-n*}}}\ %{expand:%%kernel_debuginfo_package %{?1:%{1}}}\ +%endif\ %{nil} # Now, each variant package. @@ -1190,7 +1204,11 @@ zfcpdump infrastructure. %endif %define variant_summary The Linux kernel compiled with extra debugging enabled +%if !%{debugbuildsenabled} +%kernel_variant_package -m debug +%else %kernel_variant_package debug +%endif %description debug-core The kernel package contains the Linux kernel (vmlinuz), the core of any Linux operating system. The kernel handles the basic functions @@ -2529,8 +2547,10 @@ fi\ %kernel_variant_post -v lpae -r (kernel|kernel-smp) %endif +%if %{with_debug} %kernel_variant_preun debug %kernel_variant_post -v debug +%endif %if %{with_zfcpdump} %kernel_variant_preun zfcpdump @@ -2755,6 +2775,13 @@ fi %kernel_variant_files %{_use_vdso} %{with_up} %kernel_variant_files %{_use_vdso} %{with_debug} debug +%if !%{debugbuildsenabled} +%files debug +%files debug-core +%files debug-devel +%files debug-modules +%files debug-modules-extra +%endif %kernel_variant_files %{use_vdso} %{with_pae} lpae %kernel_variant_files %{_use_vdso} %{with_zfcpdump} zfcpdump -- https://gitlab.com/cki-project/kernel-ark/-/merge_requests/1133 _______________________________________________ kernel mailing list -- kernel@xxxxxxxxxxxxxxxxxxxxxxx To unsubscribe send an email to kernel-leave@xxxxxxxxxxxxxxxxxxxxxxx Fedora Code of Conduct: https://docs.fedoraproject.org/en-US/project/code-of-conduct/ List Guidelines: https://fedoraproject.org/wiki/Mailing_list_guidelines List Archives: https://lists.fedoraproject.org/archives/list/kernel@xxxxxxxxxxxxxxxxxxxxxxx Do not reply to spam on the list, report it: https://pagure.io/fedora-infrastructure