Try to apply patch after building regular kernel

This commit is contained in:
eabdullin 2025-04-08 13:16:13 +03:00
parent c51c71d8b8
commit 2cd1b53c98

View File

@ -1751,8 +1751,6 @@ ApplyPatch 0005-Bring-back-deprecated-pci-ids-to-lpfc-driver.patch
ApplyPatch 0006-Bring-back-deprecated-pci-ids-to-qla4xxx-driver.patch
ApplyPatch 0007-Bring-back-deprecated-pci-ids-to-be2iscsi-driver.patch
ApplyPatch ppc64le-kvm-support.patch
# END OF PATCH APPLICATIONS
# Any further pre-build tree manipulations happen here.
@ -1884,6 +1882,28 @@ cd ..
###
%build
patch_command='git apply'
ApplyPatch()
{
local patch=$1
shift
if [ ! -f $RPM_SOURCE_DIR/$patch ]; then
exit 1
fi
if ! grep -E "^Patch[0-9]+: $patch\$" %{_specdir}/${RPM_PACKAGE_NAME}.spec ; then
if [ "${patch:0:8}" != "patch-%{kversion}." ] ; then
echo "ERROR: Patch $patch not listed as a source patch in specfile"
exit 1
fi
fi 2>/dev/null
case "$patch" in
*.bz2) bunzip2 < "$RPM_SOURCE_DIR/$patch" | $patch_command ${1+"$@"} ;;
*.gz) gunzip < "$RPM_SOURCE_DIR/$patch" | $patch_command ${1+"$@"} ;;
*.xz) unxz < "$RPM_SOURCE_DIR/$patch" | $patch_command ${1+"$@"} ;;
*) $patch_command ${1+"$@"} < "$RPM_SOURCE_DIR/$patch" ;;
esac
}
rm -rf %{buildroot_unstripped} || true
mkdir -p %{buildroot_unstripped}
@ -2689,10 +2709,6 @@ BuildKernel %make_target %kernel_image %{_use_vdso} zfcpdump
BuildKernel %make_target %kernel_image %{_use_vdso} 64k
%endif
%if %{with_ppc_kvm}
BuildKernel %make_target %kernel_image %{_use_vdso} kvm
%endif
%if %{with_pae}
BuildKernel %make_target %kernel_image %{use_vdso} lpae
%endif
@ -2705,6 +2721,11 @@ BuildKernel %make_target %kernel_image %{use_vdso} rt
BuildKernel %make_target %kernel_image %{_use_vdso}
%endif
%if %{with_ppc_kvm}
ApplyPatch ppc64le-kvm-support.patch
BuildKernel %make_target %kernel_image %{_use_vdso} kvm
%endif
%ifnarch noarch i686
%if !%{with_debug} && !%{with_zfcpdump} && !%{with_pae} && !%{with_up} && !%{with_arm64_64k} && !%{with_realtime} && !%{with_ppc_kvm}
# If only building the user space tools, then initialize the build environment