Add weak-modules packaging back for not-Fedora

The weak-module scripts are used in EL, but have been problematic for
Fedora, so only include them if the build target isn't Fedora.

Signed-off-by: Jeremy Cline <jcline@redhat.com>
This commit is contained in:
Jeremy Cline 2020-03-12 11:41:51 -04:00
parent fc7e20c59e
commit 2027ad30fb

View File

@ -1883,6 +1883,9 @@ BuildKernel() {
mkdir -p $RPM_BUILD_ROOT/lib/modules/$KernelVer/extra
mkdir -p $RPM_BUILD_ROOT/lib/modules/$KernelVer/internal
mkdir -p $RPM_BUILD_ROOT/lib/modules/$KernelVer/updates
%if 0%{!?fedora:1}
mkdir -p $RPM_BUILD_ROOT/lib/modules/$KernelVer/weak-updates
%endif
# CONFIG_KERNEL_HEADER_TEST generates some extra files in the process of
# testing so just delete
find . -name *.h.s -delete
@ -2677,6 +2680,12 @@ fi\
#
%define kernel_variant_posttrans() \
%{expand:%%posttrans %{?1:%{1}-}core}\
%if 0%{!?fedora:1}\
if [ -x %{_sbindir}/weak-modules ]\
then\
%{_sbindir}/weak-modules --add-kernel %{KVERREL}%{?1:+%{1}} || exit $?\
fi\
%endif\
/bin/kernel-install add %{KVERREL}%{?1:+%{1}} /lib/modules/%{KVERREL}%{?1:+%{1}}/vmlinuz || exit $?\
%{nil}
@ -2706,6 +2715,12 @@ fi}\
%define kernel_variant_preun() \
%{expand:%%preun %{?1:%{1}-}core}\
/bin/kernel-install remove %{KVERREL}%{?1:+%{1}} /lib/modules/%{KVERREL}%{?1:+%{1}}/vmlinuz || exit $?\
%if 0%{!?fedora:1}\
if [ -x %{_sbindir}/weak-modules ]\
then\
%{_sbindir}/weak-modules --remove-kernel %{KVERREL}%{?1:+%{1}} || exit $?\
fi\
%endif\
%{nil}
%kernel_variant_preun
@ -2913,6 +2928,9 @@ fi
/lib/modules/%{KVERREL}%{?3:+%{3}}/source\
/lib/modules/%{KVERREL}%{?3:+%{3}}/updates\
/lib/modules/%{KVERREL}%{?3:+%{3}}/bls.conf\
%if 0%{!?fedora:1}\
/lib/modules/%{KVERREL}%{?3:+%{3}}/weak-updates\
%endif\
%{_datadir}/doc/kernel-keys/%{KVERREL}%{?3:+%{3}}/kernel-signing-ca.cer\
%ifarch s390x ppc64le\
%if 0%{!?4:1}\