From: "Justin M. Forbes" <jforbes@xxxxxxxxxxxxxxxxx> --- redhat/genspec.sh | 13 ++++++++++++- redhat/kernel.spec.template | 12 ++++++++++++ 2 files changed, 24 insertions(+), 1 deletion(-) diff --git a/redhat/genspec.sh b/redhat/genspec.sh index 1e60bd31c06b..6b618f89f669 100755 --- a/redhat/genspec.sh +++ b/redhat/genspec.sh @@ -28,6 +28,9 @@ clogf="$SOURCES/changelog" HIDE_REDHAT=1; # hide entries for unsupported arches HIDE_UNSUPPORTED_ARCH=1; +# Set up for broken out patches +plistf="$SOURCES/Patchlist" +pnum=2 # override LC_TIME to avoid date conflicts when building the srpm LC_TIME= STAMP=$(echo $MARKER | cut -f 1 -d '-' | sed -e "s/v//"); @@ -260,6 +263,7 @@ Used to set the RHEL version. 2.26.0\n " "$(date "+%a, %d %b %Y %R:%S %z")" "$RHELVER" > "$SOURCES/patch-$RPMVERSION-redhat.patch" + truncate -s 0 $plistf COMMITS=$(git log --reverse --pretty=format:"%h" --no-merges "$MARKER".. \ ":(exclude,top).get_maintainer.conf" \ ":(exclude,top).gitattributes" \ @@ -269,8 +273,15 @@ Used to set the RHEL version. ":(exclude,top)Makefile.rhelver" \ ":(exclude,top)redhat") for c in $COMMITS; do - git format-patch --stdout -1 "$c" >> "$SOURCES/patch-$RPMVERSION-redhat.patch" + patch=$(git format-patch -1 "$c") + echo "$patch" >> $plistf + mv $patch $SOURCES/ + sed -i "s/PATCHLIST/Patch$pnum: $patch\nPATCHLIST/" $SPECFILE + sed -i "s/APPLYPATCH/ApplyOptionalPatch $patch\nAPPLYPATCH/" $SPECFILE + ((pnum++)) done + sed -i "s/PATCHLIST//" $SPECFILE + sed -i "s/APPLYPATCH//" $SPECFILE fi for opt in $BUILDOPTS; do diff --git a/redhat/kernel.spec.template b/redhat/kernel.spec.template index bb1b7f6d220a..58af5635935b 100644 --- a/redhat/kernel.spec.template +++ b/redhat/kernel.spec.template @@ -697,6 +697,7 @@ Source2001: cpupower.config # source tree, but in the mean time we carry this to support the legacy workflow Source3000: merge.pl Source3001: kernel-local +Source3002: Patchlist Source4000: README.rst @@ -704,6 +705,11 @@ Source4000: README.rst Patch1: patch-%{rpmversion}-redhat.patch +%if !%{nopatches} + +PATCHLIST +%endif + # empty final patch to facilitate testing of kernel patches Patch999999: linux-kernel-test.patch @@ -1202,6 +1208,12 @@ mv linux-%%TARBALL_VERSION%% linux-%{KVERREL} cd linux-%{KVERREL} ApplyOptionalPatch patch-%{rpmversion}-redhat.patch + +%if !%{nopatches} + +APPLYPATCH +%endif + ApplyOptionalPatch linux-kernel-test.patch # END OF PATCH APPLICATIONS -- 2.26.2 _______________________________________________ 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