[OS-BUILD PATCHv2 14/19] redhat/Makefile: Add 'duplicate' SPEC entries for user set variables

2022-05-02 Thread Prarit Bhargava (via Email Bridge)
From: Prarit Bhargava 

redhat/Makefile: Add 'duplicate' SPEC entries for user set variables

INCLUDE_FEDORA_FILES, INCLUDE_RHEL_FILES, and RELEASED_KERNEL are
specified in Makefile.variables as they can be set in userspace.

Create duplicate entries for these variables that begin with SPEC.  This
will make debugging easier and indicate that the variables are passed into
the spec file.

Signed-off-by: Prarit Bhargava 

diff --git a/redhat/Makefile b/redhat/Makefile
index blahblah..blahblah 100644
--- a/redhat/Makefile
+++ b/redhat/Makefile
@@ -26,6 +26,12 @@ ifdef SINGLE_TARBALL
 endif
 
 include Makefile.variables
+# These entries are 'duplicates' of variables specified in Makefile.variables
+# that are used in the SPEC file.  Specifying these with a SPEC prefix 
indicates
+# that the value is passed through to the spec file.
+SPECRELEASED_KERNEL=$(RELEASED_KERNEL)
+SPECINCLUDE_FEDORA_FILES=$(INCLUDE_FEDORA_FILES)
+SPECINCLUDE_RHEL_FILES=$(INCLUDE_RHEL_FILES)
 
 LANG=C
 
diff --git a/redhat/genspec.sh b/redhat/genspec.sh
index blahblah..blahblah 100755
--- a/redhat/genspec.sh
+++ b/redhat/genspec.sh
@@ -63,10 +63,10 @@ test -f "$SOURCES/$SPECFILE" &&
s/%%SPECKPATCHLEVEL%%/$SPECKPATCHLEVEL/
s/%%SPECBUILD%%/$SPECBUILD/
s/%%SPECRELEASE%%/$SPECRELEASE/
-   s/%%RELEASED_KERNEL%%/$RELEASED_KERNEL/
+   s/%%SPECRELEASED_KERNEL%%/$SPECRELEASED_KERNEL/
s/%%SPECDEBUG_BUILDS_ENABLED%%/$SPECDEBUG_BUILDS_ENABLED/
-   s/%%INCLUDE_FEDORA_FILES%%/$INCLUDE_FEDORA_FILES/
-   s/%%INCLUDE_RHEL_FILES%%/$INCLUDE_RHEL_FILES/
+   s/%%SPECINCLUDE_FEDORA_FILES%%/$SPECINCLUDE_FEDORA_FILES/
+   s/%%SPECINCLUDE_RHEL_FILES%%/$SPECINCLUDE_RHEL_FILES/
s/%%SPECPATCHLIST_CHANGELOG%%/$SPECPATCHLIST_CHANGELOG/
s/%%SPECVERSION%%/$SPECVERSION/
s/%%SPECTARFILE_RELEASE%%/$SPECTARFILE_RELEASE/" "$SOURCES/$SPECFILE"
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
@@ -4,9 +4,9 @@
 # here before the %%install macro is pre-built.
 
 # Include Fedora files
-%global include_fedora %%INCLUDE_FEDORA_FILES%%
+%global include_fedora %%SPECINCLUDE_FEDORA_FILES%%
 # Include RHEL files
-%global include_rhel %%INCLUDE_RHEL_FILES%%
+%global include_rhel %%SPECINCLUDE_RHEL_FILES%%
 # Provide Patchlist.changelog file
 %global patchlist_changelog %%SPECPATCHLIST_CHANGELOG%%
 
@@ -77,7 +77,7 @@ Summary: The Linux kernel
 #  kernel release. (This includes prepatch or "rc" releases.)
 # Set released_kernel to 0 when the upstream source tarball contains an
 #  unreleased kernel development snapshot.
-%global released_kernel %%RELEASED_KERNEL%%
+%global released_kernel %%SPECRELEASED_KERNEL%%
 
 # Set debugbuildsenabled to 1 to build separate base and debug kernels
 #  (on supported architectures). The kernel-debug-* subpackages will
diff --git a/redhat/self-test/data/centos-2585cf9dfaad.el7 
b/redhat/self-test/data/centos-2585cf9dfaad.el7
index blahblah..blahblah 100644
--- a/redhat/self-test/data/centos-2585cf9dfaad.el7
+++ b/redhat/self-test/data/centos-2585cf9dfaad.el7
@@ -56,11 +56,14 @@ SOURCES=../redhat/rpm/SOURCES
 SPECBUILD=0.rc5.6.test 
 SPECCHANGELOG=kernel.changelog-9.99 
 SPECFILE=kernel.spec 
+SPECINCLUDE_FEDORA_FILES=1 
+SPECINCLUDE_RHEL_FILES=1 
 SPECKEXTRAVERSION=-rc5 
 SPECKPATCHLEVEL=16 
 SPECKSUBLEVEL=0 
 SPECKVERSION=5 
 SPECRELEASE=0.rc5.6%{?buildid}%{?dist} 
+SPECRELEASED_KERNEL=0 
 SPECTARFILE_RELEASE=5.16.0-0.rc5.6.test 
 SPECVERSION=5.16.0 
 SRPM=../redhat/rpm/SRPMS/kernel-5.16.0-0.rc5.6.test.el7.src.rpm 
diff --git a/redhat/self-test/data/centos-2585cf9dfaad.fc25 
b/redhat/self-test/data/centos-2585cf9dfaad.fc25
index blahblah..blahblah 100644
--- a/redhat/self-test/data/centos-2585cf9dfaad.fc25
+++ b/redhat/self-test/data/centos-2585cf9dfaad.fc25
@@ -56,11 +56,14 @@ SOURCES=../redhat/rpm/SOURCES
 SPECBUILD=0.rc5.6.test 
 SPECCHANGELOG=kernel.changelog-9.99 
 SPECFILE=kernel.spec 
+SPECINCLUDE_FEDORA_FILES=1 
+SPECINCLUDE_RHEL_FILES=1 
 SPECKEXTRAVERSION=-rc5 
 SPECKPATCHLEVEL=16 
 SPECKSUBLEVEL=0 
 SPECKVERSION=5 
 SPECRELEASE=0.rc5.6%{?buildid}%{?dist} 
+SPECRELEASED_KERNEL=0 
 SPECTARFILE_RELEASE=5.16.0-0.rc5.6.test 
 SPECVERSION=5.16.0 
 SRPM=../redhat/rpm/SRPMS/kernel-5.16.0-0.rc5.6.test.fc25.src.rpm 
diff --git a/redhat/self-test/data/centos-78e36f3b0dae.el7 
b/redhat/self-test/data/centos-78e36f3b0dae.el7
index blahblah..blahblah 100644
--- a/redhat/self-test/data/centos-78e36f3b0dae.el7
+++ b/redhat/self-test/data/centos-78e36f3b0dae.el7
@@ -56,11 +56,14 @@ SOURCES=../redhat/rpm/SOURCES
 SPECBUILD=0.rc0.78e36f3b0dae586.6.test 
 SPECCHANGELOG=kernel.changelog-9.99 
 SPECFILE=kernel.spec 
+SPECINCLUDE_FEDORA_FILES=1 
+SPECINCLUDE_RHEL_FILES=1 
 SPECKEXTRAVERSION= 
 SPECKPATCHLEVEL=17 
 SPECKSUBLEVEL=0 
 SPECKVERSION=5 
 SPECRELEASE=0.rc0.78e36f3b0dae586.6%{?buildid}%{?dist} 
+SPECRELEASED_KERNEL=0 
 

[OS-BUILD PATCHv2 13/19] redhat/Makefile: Rename TARFILE_RELEASE to SPECTARFILE_RELEASE

2022-05-02 Thread Prarit Bhargava (via Email Bridge)
From: Prarit Bhargava 

redhat/Makefile: Rename TARFILE_RELEASE to SPECTARFILE_RELEASE

Change TARFILE_RELEASE to SPECTARFILE_RELEASE so that readers
understand it is passed into the spec file.

Rename TARFILE_RELEASE to SPECTARFILE_RELEASE.

Signed-off-by: Prarit Bhargava 

diff --git a/redhat/Makefile b/redhat/Makefile
index blahblah..blahblah 100644
--- a/redhat/Makefile
+++ b/redhat/Makefile
@@ -222,7 +222,7 @@ SRPM:=$(SRPMS)/$(PACKAGE_NAME)-$(RPMVERSION)$(DIST).src.rpm
 #
 ifeq ("$(DISTRO)", "fedora")
   SINGLE_TARBALL:=0
-  TARFILE_RELEASE:=$(UPSTREAM_TARBALL_NAME)
+  SPECTARFILE_RELEASE:=$(UPSTREAM_TARBALL_NAME)
   RHDISTGIT_BRANCH:=rawhide
   ifndef BUILD_SCRATCH_TARGET
 BUILD_SCRATCH_TARGET:=temp-ark-rhel-8-test
@@ -236,21 +236,21 @@ else ifeq ("$(DISTRO)", "centos")
   ifndef BUILD_SCRATCH_TARGET
 BUILD_SCRATCH_TARGET:=c$(RHEL_MAJOR)s-candidate
   endif
-  TARFILE_RELEASE:=$(RPMVERSION)
+  SPECTARFILE_RELEASE:=$(RPMVERSION)
 else
   SINGLE_TARBALL:=1
   RHDISTGIT_BRANCH:=rhel-$(RHEL_MAJOR).$(RHEL_MINOR).0
   ifndef BUILD_SCRATCH_TARGET
 BUILD_SCRATCH_TARGET:=rhel-$(RHEL_MAJOR).$(RHEL_MINOR).0-test-pesign
   endif
-  TARFILE_RELEASE:=$(RPMVERSION)
+  SPECTARFILE_RELEASE:=$(RPMVERSION)
 endif
 
 ifndef BUILD_TARGET
   BUILD_TARGET:=--scratch $(BUILD_SCRATCH_TARGET)
 endif
 
-TARFILE:=linux-$(TARFILE_RELEASE).tar.xz
+TARFILE:=linux-$(SPECTARFILE_RELEASE).tar.xz
 TARBALL:=$(REDHAT)/$(TARFILE)
 
 include Makefile.rhpkg
diff --git a/redhat/genspec.sh b/redhat/genspec.sh
index blahblah..blahblah 100755
--- a/redhat/genspec.sh
+++ b/redhat/genspec.sh
@@ -69,7 +69,7 @@ test -f "$SOURCES/$SPECFILE" &&
s/%%INCLUDE_RHEL_FILES%%/$INCLUDE_RHEL_FILES/
s/%%SPECPATCHLIST_CHANGELOG%%/$SPECPATCHLIST_CHANGELOG/
s/%%SPECVERSION%%/$SPECVERSION/
-   s/%%TARFILE_RELEASE%%/$TARFILE_RELEASE/" "$SOURCES/$SPECFILE"
+   s/%%SPECTARFILE_RELEASE%%/$SPECTARFILE_RELEASE/" "$SOURCES/$SPECFILE"
 
 # We depend on work splitting of BUILDOPTS
 # shellcheck disable=SC2086
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
@@ -690,7 +690,7 @@ BuildRequires: lld
 # exact git commit you can run
 #
 # xzcat -qq ${TARBALL} | git get-tar-commit-id
-Source0: linux-%%TARFILE_RELEASE%%.tar.xz
+Source0: linux-%%SPECTARFILE_RELEASE%%.tar.xz
 
 Source1: Makefile.rhelver
 
@@ -1382,8 +1382,8 @@ ApplyOptionalPatch()
   fi
 }
 
-%setup -q -n kernel-%%TARFILE_RELEASE%% -c
-mv linux-%%TARFILE_RELEASE%% linux-%{KVERREL}
+%setup -q -n kernel-%%SPECTARFILE_RELEASE%% -c
+mv linux-%%SPECTARFILE_RELEASE%% linux-%{KVERREL}
 
 cd linux-%{KVERREL}
 cp -a %{SOURCE1} .
diff --git a/redhat/scripts/create-tarball.sh b/redhat/scripts/create-tarball.sh
index blahblah..blahblah 100755
--- a/redhat/scripts/create-tarball.sh
+++ b/redhat/scripts/create-tarball.sh
@@ -27,4 +27,4 @@ trap 'rm -vf "$TARBALL"' INT
 # XZ_OPTIONS and XZ_THREADS DEPEND on word splitting, so don't disable it here:
 # shellcheck disable=SC2086
 cd ../ &&
-  git archive --prefix="linux-$TARFILE_RELEASE"/ --format=tar "$_GITID" | xz 
$XZ_OPTIONS $XZ_THREADS > "$TARBALL";
+  git archive --prefix="linux-$SPECTARFILE_RELEASE"/ --format=tar "$_GITID" | 
xz $XZ_OPTIONS $XZ_THREADS > "$TARBALL";
diff --git a/redhat/self-test/data/centos-2585cf9dfaad.el7 
b/redhat/self-test/data/centos-2585cf9dfaad.el7
index blahblah..blahblah 100644
--- a/redhat/self-test/data/centos-2585cf9dfaad.el7
+++ b/redhat/self-test/data/centos-2585cf9dfaad.el7
@@ -61,12 +61,12 @@ SPECKPATCHLEVEL=16
 SPECKSUBLEVEL=0 
 SPECKVERSION=5 
 SPECRELEASE=0.rc5.6%{?buildid}%{?dist} 
+SPECTARFILE_RELEASE=5.16.0-0.rc5.6.test 
 SPECVERSION=5.16.0 
 SRPM=../redhat/rpm/SRPMS/kernel-5.16.0-0.rc5.6.test.el7.src.rpm 
 SRPMS=../redhat/rpm/SRPMS 
 TARBALL=../redhat/linux-5.16.0-0.rc5.6.test.tar.xz 
 TARFILE=linux-5.16.0-0.rc5.6.test.tar.xz 
-TARFILE_RELEASE=5.16.0-0.rc5.6.test 
 TESTPATCH=../redhat/linux-kernel-test.patch 
 TOPDIR=.. 
 UPSTREAM_TARBALL_NAME=5.16-rc5 
diff --git a/redhat/self-test/data/centos-2585cf9dfaad.fc25 
b/redhat/self-test/data/centos-2585cf9dfaad.fc25
index blahblah..blahblah 100644
--- a/redhat/self-test/data/centos-2585cf9dfaad.fc25
+++ b/redhat/self-test/data/centos-2585cf9dfaad.fc25
@@ -61,12 +61,12 @@ SPECKPATCHLEVEL=16
 SPECKSUBLEVEL=0 
 SPECKVERSION=5 
 SPECRELEASE=0.rc5.6%{?buildid}%{?dist} 
+SPECTARFILE_RELEASE=5.16.0-0.rc5.6.test 
 SPECVERSION=5.16.0 
 SRPM=../redhat/rpm/SRPMS/kernel-5.16.0-0.rc5.6.test.fc25.src.rpm 
 SRPMS=../redhat/rpm/SRPMS 
 TARBALL=../redhat/linux-5.16.0-0.rc5.6.test.tar.xz 
 TARFILE=linux-5.16.0-0.rc5.6.test.tar.xz 
-TARFILE_RELEASE=5.16.0-0.rc5.6.test 
 TESTPATCH=../redhat/linux-kernel-test.patch 
 TOPDIR=.. 
 UPSTREAM_TARBALL_NAME=5.16-rc5 
diff --git a/redhat/self-test/data/centos-78e36f3b0dae.el7 
b/redhat/self-test/data/centos-78e36f3b0dae.el7
index blahblah..blahblah 100644
--- a/redhat/self-test/data/centos-78e36f3b0dae.el7

[OS-BUILD PATCHv2 12/19] redhat/genspec: Rename PATCHLIST_CHANGELOG to SPECPATCHLIST_CHANGELOG

2022-05-02 Thread Prarit Bhargava (via Email Bridge)
From: Prarit Bhargava 

redhat/genspec: Rename PATCHLIST_CHANGELOG to SPECPATCHLIST_CHANGELOG

Change PATCHLIST_CHANGELOG to SPECPATCHLIST_CHANGELOG so that readers
understand it is passed into the spec file.

Rename PATCHLIST_CHANGELOG to SPECPATCHLIST_CHANGELOG.

Signed-off-by: Prarit Bhargava 

diff --git a/redhat/genspec.sh b/redhat/genspec.sh
index blahblah..blahblah 100755
--- a/redhat/genspec.sh
+++ b/redhat/genspec.sh
@@ -40,7 +40,7 @@ EXCLUDE_FILES=":(exclude,top).get_maintainer.conf \
 
 # If PATCHLIST_URL is not set to "none", generate Patchlist.changelog file that
 # holds the shas and commits not included upstream and git commit url.
-PATCHLIST_CHANGELOG=0
+SPECPATCHLIST_CHANGELOG=0
 if [ "$PATCHLIST_URL" != "none" ]; then
# sed convert
#  
@@ -53,7 +53,7 @@ if [ "$PATCHLIST_URL" != "none" ]; then
git log --no-merges --pretty=oneline --no-decorate ${UPSTREAM}.. 
$EXCLUDE_FILES | \
sed "s!^\([^ ]*\)!$PATCHLIST_URL/\1\n &!; s!\$!\n!" \
> "$SOURCES"/Patchlist.changelog
-   PATCHLIST_CHANGELOG=1
+   SPECPATCHLIST_CHANGELOG=1
 fi
 
 test -f "$SOURCES/$SPECFILE" &&
@@ -67,7 +67,7 @@ test -f "$SOURCES/$SPECFILE" &&
s/%%SPECDEBUG_BUILDS_ENABLED%%/$SPECDEBUG_BUILDS_ENABLED/
s/%%INCLUDE_FEDORA_FILES%%/$INCLUDE_FEDORA_FILES/
s/%%INCLUDE_RHEL_FILES%%/$INCLUDE_RHEL_FILES/
-   s/%%PATCHLIST_CHANGELOG%%/$PATCHLIST_CHANGELOG/
+   s/%%SPECPATCHLIST_CHANGELOG%%/$SPECPATCHLIST_CHANGELOG/
s/%%SPECVERSION%%/$SPECVERSION/
s/%%TARFILE_RELEASE%%/$TARFILE_RELEASE/" "$SOURCES/$SPECFILE"
 
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
@@ -8,7 +8,7 @@
 # Include RHEL files
 %global include_rhel %%INCLUDE_RHEL_FILES%%
 # Provide Patchlist.changelog file
-%global patchlist_changelog %%PATCHLIST_CHANGELOG%%
+%global patchlist_changelog %%SPECPATCHLIST_CHANGELOG%%
 
 # Disable LTO in userspace packages.
 %global _lto_cflags %{nil}

--
https://gitlab.com/cki-project/kernel-ark/-/merge_requests/1728
___
kernel mailing list -- kernel@lists.fedoraproject.org
To unsubscribe send an email to kernel-le...@lists.fedoraproject.org
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@lists.fedoraproject.org
Do not reply to spam on the list, report it: 
https://pagure.io/fedora-infrastructure


[OS-BUILD PATCHv2 11/19] redhat/genspec: Rename DEBUG_BUILDS_ENABLED to SPECDEBUG_BUILDS_ENABLED

2022-05-02 Thread Prarit Bhargava (via Email Bridge)
From: Prarit Bhargava 

redhat/genspec: Rename DEBUG_BUILDS_ENABLED to SPECDEBUG_BUILDS_ENABLED

Change DEBUG_BUILDS_ENABLED to SPECDEBUG_BUILDS_ENABLED so that readers
understand it is passed into the spec file.

Rename DEBUG_BUILDS_ENABLED to SPECDEBUG_BUILDS_ENABLED.

Signed-off-by: Prarit Bhargava 

diff --git a/redhat/genspec.sh b/redhat/genspec.sh
index blahblah..blahblah 100755
--- a/redhat/genspec.sh
+++ b/redhat/genspec.sh
@@ -17,10 +17,10 @@ UPSTREAM=$(git rev-parse -q --verify 
origin/"${UPSTREAM_BRANCH}" || \
 if [ "$SNAPSHOT" = 0 ]; then
# This is based off a tag on Linus's tree (e.g. v5.5 or v5.5-rc5).
# Two kernels are built, one with debug configuration and one without.
-   DEBUG_BUILDS_ENABLED=1
+   SPECDEBUG_BUILDS_ENABLED=1
 else
# All kernels are built with debug configurations.
-   DEBUG_BUILDS_ENABLED=0
+   SPECDEBUG_BUILDS_ENABLED=0
 fi
 
 if [ -n "$BUILDID" ]; then
@@ -64,7 +64,7 @@ test -f "$SOURCES/$SPECFILE" &&
s/%%SPECBUILD%%/$SPECBUILD/
s/%%SPECRELEASE%%/$SPECRELEASE/
s/%%RELEASED_KERNEL%%/$RELEASED_KERNEL/
-   s/%%DEBUG_BUILDS_ENABLED%%/$DEBUG_BUILDS_ENABLED/
+   s/%%SPECDEBUG_BUILDS_ENABLED%%/$SPECDEBUG_BUILDS_ENABLED/
s/%%INCLUDE_FEDORA_FILES%%/$INCLUDE_FEDORA_FILES/
s/%%INCLUDE_RHEL_FILES%%/$INCLUDE_RHEL_FILES/
s/%%PATCHLIST_CHANGELOG%%/$PATCHLIST_CHANGELOG/
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
@@ -85,7 +85,7 @@ Summary: The Linux kernel
 # Set debugbuildsenabled to 0 to not build a separate debug kernel, but
 #  to build the base kernel using the debug configuration. (Specifying
 #  the --with-release option overrides this setting.)
-%define debugbuildsenabled %%DEBUG_BUILDS_ENABLED%%
+%define debugbuildsenabled %%SPECDEBUG_BUILDS_ENABLED%%
 
 %if 0%{?fedora}
 %define secure_boot_arch x86_64

--
https://gitlab.com/cki-project/kernel-ark/-/merge_requests/1728
___
kernel mailing list -- kernel@lists.fedoraproject.org
To unsubscribe send an email to kernel-le...@lists.fedoraproject.org
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@lists.fedoraproject.org
Do not reply to spam on the list, report it: 
https://pagure.io/fedora-infrastructure


[OS-BUILD PATCHv2 10/19] redhat/Makefile: Rename PKGRELEASE to SPECBUILD

2022-05-02 Thread Prarit Bhargava (via Email Bridge)
From: Prarit Bhargava 

redhat/Makefile: Rename PKGRELEASE to SPECBUILD

PKGRELEASE is a confusing variable name, and it really is the BUILD string
for the specfile.

Rename PKGRELEASE to SPECBUILD.

Signed-off-by: Prarit Bhargava 

diff --git a/redhat/Makefile b/redhat/Makefile
index blahblah..blahblah 100644
--- a/redhat/Makefile
+++ b/redhat/Makefile
@@ -208,11 +208,11 @@ else
 endif
 
 SPECVERSION:=$(SPECKVERSION).$(SPECKPATCHLEVEL).$(SPECKSUBLEVEL)
-PKGRELEASE:=$(PREBUILD)$(BUILD)$(BUILDID)
-KABI_TARBALL:=$(SOURCES)/kernel-abi-stablelists-$(SPECVERSION)-$(PKGRELEASE).tar.bz2
+SPECBUILD:=$(PREBUILD)$(BUILD)$(BUILDID)
+KABI_TARBALL:=$(SOURCES)/kernel-abi-stablelists-$(SPECVERSION)-$(SPECBUILD).tar.bz2
 KABIDW := $(REDHAT)/kabi-dwarf
-KABIDW_TARBALL:=$(SOURCES)/kernel-kabi-dw-$(SPECVERSION)-$(PKGRELEASE).tar.bz2
-RPMVERSION:=$(SPECVERSION)-$(PKGRELEASE)
+KABIDW_TARBALL:=$(SOURCES)/kernel-kabi-dw-$(SPECVERSION)-$(SPECBUILD).tar.bz2
+RPMVERSION:=$(SPECVERSION)-$(SPECBUILD)
 SPECRELEASE:=$(PREBUILD)$(BUILD)%{?buildid}%{?dist}
 SRPM:=$(SRPMS)/$(PACKAGE_NAME)-$(RPMVERSION)$(DIST).src.rpm
 
@@ -427,12 +427,12 @@ dist-tarball: $(TARBALL)
 dist-kernelrelease:
# deprecated at 5.17.0
@echo "WARNING: This target will be deprecated in a future release."
-   @echo $(PACKAGE_NAME)-$(SPECVERSION)-$(PKGRELEASE)
+   @echo $(PACKAGE_NAME)-$(SPECVERSION)-$(SPECBUILD)
 
 dist-kernelversion:
# deprecated at 5.17.0
@echo "WARNING: This target will be deprecated in a future release."
-   @echo $(SPECVERSION)-$(PKGRELEASE)
+   @echo $(SPECVERSION)-$(SPECBUILD)
 
 dist-specfile: setup-source
# deprecated at 5.17.0
@@ -622,9 +622,9 @@ dist-fedora-release-push: dist-fedora-release
 dist-vr-check:
@# builds may include a s390x+zfcpdump arch build.  UTS_RELEASE can 
only have a
@# version-release string with max 64 chars.  The version-release for 
s390x+zfcpdump
-   @# is 29 characters, leaving a maximum of 35 characters for PKGRELEASE.
-   @if [ $$(echo -n $(PKGRELEASE) | wc -c) -gt 35 ]; then \
-   echo "PKGRELEASE ($(PKGRELEASE)) is too long.  Use a shorter 
localversion (currently $(BUILDID))"; \
+   @# is 29 characters, leaving a maximum of 35 characters for SPECBUILD.
+   @if [ $$(echo -n $(SPECBUILD) | wc -c) -gt 35 ]; then \
+   echo "SPECBUILD ($(SPECBUILD)) is too long.  Use a shorter 
localversion (currently $(BUILDID))"; \
exit 1; \
fi
 
diff --git a/redhat/Makefile.variables b/redhat/Makefile.variables
index blahblah..blahblah 100644
--- a/redhat/Makefile.variables
+++ b/redhat/Makefile.variables
@@ -100,7 +100,7 @@ BUILD ?=
 
 # Builds may include a s390x+zfcpdump arch build, which results in the build
 # failing because the UTS_RELEASE field exceeded 64 chars.  This variable can
-# be set to 1 to decrease the kernel UTS_RELEASE and PKGRELEASE by 11 
characters
+# be set to 1 to decrease the kernel UTS_RELEASE and SPECBUILD by 11 characters
 # (MMDDgit).
 PREBUILD_GIT_ONLY ?=
 
diff --git a/redhat/genspec.sh b/redhat/genspec.sh
index blahblah..blahblah 100755
--- a/redhat/genspec.sh
+++ b/redhat/genspec.sh
@@ -1,4 +1,5 @@
 #!/bin/bash
+# shellcheck disable=SC2153
 
 LAST_MARKER=$(cat "${REDHAT}"/marker)
 clogf="$SOURCES/changelog"
@@ -60,7 +61,7 @@ test -f "$SOURCES/$SPECFILE" &&
s/%%SPECBUILDID%%/$SPECBUILDID/
s/%%SPECKVERSION%%/$SPECKVERSION/
s/%%SPECKPATCHLEVEL%%/$SPECKPATCHLEVEL/
-   s/%%PKGRELEASE%%/$PKGRELEASE/
+   s/%%SPECBUILD%%/$SPECBUILD/
s/%%SPECRELEASE%%/$SPECRELEASE/
s/%%RELEASED_KERNEL%%/$RELEASED_KERNEL/
s/%%DEBUG_BUILDS_ENABLED%%/$DEBUG_BUILDS_ENABLED/
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
@@ -129,7 +129,7 @@ Summary: The Linux kernel
 
 %define specversion %%SPECVERSION%%
 %define patchversion %%SPECKVERSION%%.%%SPECKPATCHLEVEL%%
-%define pkgrelease %%PKGRELEASE%%
+%define pkgrelease %%SPECBUILD%%
 
 # This is needed to do merge window version magic
 %define patchlevel %%SPECKPATCHLEVEL%%
diff --git a/redhat/self-test/data/centos-2585cf9dfaad.el7 
b/redhat/self-test/data/centos-2585cf9dfaad.el7
index blahblah..blahblah 100644
--- a/redhat/self-test/data/centos-2585cf9dfaad.el7
+++ b/redhat/self-test/data/centos-2585cf9dfaad.el7
@@ -33,7 +33,6 @@ MAKEFILE_LIST=Makefile Makefile.variables ../Makefile.rhelver 
Makefile.rhpkg Mak
 MAKEFLAGS=w -- HEAD=2585cf9dfaad DISTRO=centos DIST=.el7 RHSELFTESTDATA=1 
 MARKER=v5.16-rc5 
 MERGE_BASE=2585cf9dfaaddf00b069673f27bb3f8530e2039c 
-PKGRELEASE=0.rc5.6.test 
 PREBUILD=0.rc5. 
 PROCESS_CONFIGS_CHECK_OPTS=-n -t -c 
 PROCESS_CONFIGS_OPTS=-n -w -c 
@@ -54,6 +53,7 @@ SHELL=/bin/sh
 SINGLE_TARBALL=1 
 SNAPSHOT=0 
 SOURCES=../redhat/rpm/SOURCES 
+SPECBUILD=0.rc5.6.test 
 SPECCHANGELOG=kernel.changelog-9.99 
 SPECFILE=kernel.spec 
 

[OS-BUILD PATCHv2 5/19] redhat/Makfile: Rename RPMKPATCHLEVEL to SPECKPATCHLEVEL

2022-05-02 Thread Prarit Bhargava (via Email Bridge)
From: Prarit Bhargava 

redhat/Makfile: Rename RPMKPATCHLEVEL to SPECKPATCHLEVEL

Change RPMKPATCHLEVEL to SPECPATCHLEVEL so that readers understand it is passed
into the spec file.

Rename RPMKPATCHLEVEL to SPECKPATCHLEVEL.

Signed-off-by: Prarit Bhargava 

diff --git a/redhat/Makefile b/redhat/Makefile
index blahblah..blahblah 100644
--- a/redhat/Makefile
+++ b/redhat/Makefile
@@ -51,7 +51,7 @@ RPMBUILD:=$(shell if [ -x "/usr/bin/rpmbuild" ]; then echo 
rpmbuild; \
 
 MACH:=$(shell uname -m)
 SPECKVERSION:=$(shell $(GIT) show $(HEAD):Makefile | sed -ne '/^VERSION\ =\ 
/{s///;p;q}')
-RPMKPATCHLEVEL:=$(shell $(GIT) show $(HEAD):Makefile | sed -ne '/^PATCHLEVEL\ 
=\ /{s///;p;q}')
+SPECKPATCHLEVEL:=$(shell $(GIT) show $(HEAD):Makefile | sed -ne '/^PATCHLEVEL\ 
=\ /{s///;p;q}')
 RPMKSUBLEVEL:=$(shell $(GIT) show $(HEAD):Makefile | sed -ne '/^SUBLEVEL\ =\ 
/{s///;p;q}')
 RPMKEXTRAVERSION:=$(shell $(GIT) show $(HEAD):Makefile | sed -ne 
'/^EXTRAVERSION\ =\ /{s///;p;q}')
 GITID:= $(shell $(GIT) log --max-count=1 --pretty=format:%H $(HEAD))
@@ -131,18 +131,18 @@ ifeq ("$(origin O)", "command line")
 endif
 
 # MARKER is the git tag which we base off of for exporting patches
-# Make sure MARKER uses RPMKPATCHLEVEL and RPMKEXTRAVERSION from the kernel
+# Make sure MARKER uses SPECKPATCHLEVEL and RPMKEXTRAVERSION from the kernel
 # makefile as opposed to any adjusted version for snapshotting.
 ifneq ($(RPMKEXTRAVERSION),)
-  MARKER:=v$(SPECKVERSION).$(RPMKPATCHLEVEL)$(RPMKEXTRAVERSION)
+  MARKER:=v$(SPECKVERSION).$(SPECKPATCHLEVEL)$(RPMKEXTRAVERSION)
   KEXTRAVERSION:=$(shell echo $(RPMKEXTRAVERSION) | sed -e s/-/./)
   PREBUILD:=0$(KEXTRAVERSION).
-  UPSTREAM_TARBALL_NAME:=$(SPECKVERSION).$(RPMKPATCHLEVEL)$(RPMKEXTRAVERSION)
+  UPSTREAM_TARBALL_NAME:=$(SPECKVERSION).$(SPECKPATCHLEVEL)$(RPMKEXTRAVERSION)
 else
   KEXTRAVERSION:=
   ifeq ($(RPMKSUBLEVEL),0)
-MARKER:=v$(SPECKVERSION).$(RPMKPATCHLEVEL)
-UPSTREAM_TARBALL_NAME:=$(SPECKVERSION).$(RPMKPATCHLEVEL)
+MARKER:=v$(SPECKVERSION).$(SPECKPATCHLEVEL)
+UPSTREAM_TARBALL_NAME:=$(SPECKVERSION).$(SPECKPATCHLEVEL)
   else
 # Make sure MARKER uses RPMKPATCHLEVEL and RPMKEXTRAVERSION from the kernel
 # makefile as opposed to any adjusted version for snapshotting.  IOW,
@@ -185,7 +185,7 @@ ifeq ($(VERSION_ON_UPSTREAM),1)
 ifeq ($(RPMKEXTRAVERSION),)
   KEXTRAVERSION:=.rc0
   PREBUILD:=0$(KEXTRAVERSION).
-  RPMKPATCHLEVEL:=$(shell expr $(RPMKPATCHLEVEL) + 1)
+  SPECKPATCHLEVEL:=$(shell expr $(SPECKPATCHLEVEL) + 1)
 endif
 ifndef PREBUILD_GIT_ONLY
   ifneq ($(filter $(MAKECMDGOALS),dist-git-test dist-git),)
@@ -207,7 +207,7 @@ else
   SNAPSHOT:=0
 endif
 
-SPECVERSION:=$(SPECKVERSION).$(RPMKPATCHLEVEL).$(RPMKSUBLEVEL)
+SPECVERSION:=$(SPECKVERSION).$(SPECKPATCHLEVEL).$(RPMKSUBLEVEL)
 PKGRELEASE:=$(PREBUILD)$(BUILD)$(BUILDID)
 
KABI_TARBALL:=$(SOURCES)/kernel-abi-stablelists-$(SPECVERSION)-$(PKGRELEASE).tar.bz2
 KABIDW := $(REDHAT)/kabi-dwarf
diff --git a/redhat/genspec.sh b/redhat/genspec.sh
index blahblah..blahblah 100755
--- a/redhat/genspec.sh
+++ b/redhat/genspec.sh
@@ -59,7 +59,7 @@ test -f "$SOURCES/$SPECFILE" &&
sed -i -e "
s/%%BUILDID%%/$BUILDID_DEFINE/
s/%%SPECKVERSION%%/$SPECKVERSION/
-   s/%%RPMKPATCHLEVEL%%/$RPMKPATCHLEVEL/
+   s/%%SPECKPATCHLEVEL%%/$SPECKPATCHLEVEL/
s/%%PKGRELEASE%%/$PKGRELEASE/
s/%%SPECRELEASE%%/$SPECRELEASE/
s/%%RELEASED_KERNEL%%/$RELEASED_KERNEL/
@@ -93,7 +93,7 @@ fi
 GIT_FORMAT="--format=- %s (%an)%n%N%n^^^NOTES-END^^^%n%b"
 GIT_NOTES="--notes=refs/notes/${RHEL_MAJOR}.${RHEL_MINOR}*"
 
-lasttag=$(git rev-list --first-parent --grep="^\[redhat\] 
kernel-${SPECKVERSION}.${RPMKPATCHLEVEL}" --max-count=1 HEAD)
+lasttag=$(git rev-list --first-parent --grep="^\[redhat\] 
kernel-${SPECKVERSION}.${SPECKPATCHLEVEL}" --max-count=1 HEAD)
 # if we didn't find the proper tag, assume this is the first release
 if [[ -z $lasttag ]]; then
 if [[ -z ${MARKER//[0-9a-f]/} ]]; then
@@ -174,12 +174,12 @@ if [ "$SINGLE_TARBALL" = 0 ]; then
# May need to preserve word splitting in EXCLUDE_FILES
# shellcheck disable=SC2086
git diff -p --no-renames --stat "$MARKER"..  $EXCLUDE_FILES \
-   > 
${SOURCES}/patch-${SPECKVERSION}.${RPMKPATCHLEVEL}-redhat.patch
+   > 
${SOURCES}/patch-${SPECKVERSION}.${SPECKPATCHLEVEL}-redhat.patch
 else
# The tarball in the SRPM contains both upstream sources and OS-specifc
# commits.  Even though this is the case, an empty file for dist-git
# compatibility is necessary.
-   touch "${SOURCES}/patch-${SPECKVERSION}.${RPMKPATCHLEVEL}"-redhat.patch
+   touch "${SOURCES}/patch-${SPECKVERSION}.${SPECKPATCHLEVEL}"-redhat.patch
 fi
 
 rm -f "$clogf"{,.stripped};
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
@@ -125,14 +125,14 @@ 

[OS-BUILD PATCHv2 8/19] redhat/Makefile: Rename CHANGELOG to SPECCHANGELOG

2022-05-02 Thread Prarit Bhargava (via Email Bridge)
From: Prarit Bhargava 

redhat/Makefile: Rename CHANGELOG to SPECCHANGELOG

Change CHANGELOG to SPECCHANGELOG so that readers understand it is passed
into the spec file.  While the CHANGELOG does have use other than in the
spec file it is useful to know that the string is used in the spec file.

Rename CHANGELOG to SPECKCHANGELOG.

Signed-off-by: Prarit Bhargava 

diff --git a/redhat/Makefile b/redhat/Makefile
index blahblah..blahblah 100644
--- a/redhat/Makefile
+++ b/redhat/Makefile
@@ -69,7 +69,7 @@ RPM:=$(REDHAT)/rpm
 SRPMS:=$(RPM)/SRPMS
 SOURCES:=$(RPM)/SOURCES
 TESTPATCH:=$(REDHAT)/linux-kernel-test.patch
-CHANGELOG:=$(PACKAGE_NAME).changelog-$(RHEL_MAJOR).$(RHEL_MINOR)
+SPECCHANGELOG:=$(PACKAGE_NAME).changelog-$(RHEL_MAJOR).$(RHEL_MINOR)
 CHANGELOG_PREV:=$(PACKAGE_NAME).changelog-$(RHEL_MAJOR).$(shell expr 
$(RHEL_MINOR) - 1)
 ARCH_LIST=aarch64 ppc64le s390x x86_64
 
@@ -462,14 +462,14 @@ dist-buildreq-check: setup-source
 
 setup-source: dist-git-version-check dist-clean-sources
@cp $(REDHAT)/$(SPECFILE).template $(SOURCES)/$(SPECFILE)
-   @if [ ! -e  $(REDHAT)/$(CHANGELOG) ]; then \
-   echo "Creating $(CHANGELOG) as copy of $(CHANGELOG_PREV)"; \
-   cp $(REDHAT)/$(CHANGELOG_PREV) $(REDHAT)/$(CHANGELOG); \
+   @if [ ! -e  $(REDHAT)/$(SPECCHANGELOG) ]; then \
+   echo "Creating $(SPECCHANGELOG) as copy of $(CHANGELOG_PREV)"; \
+   cp $(REDHAT)/$(CHANGELOG_PREV) $(REDHAT)/$(SPECCHANGELOG); \
fi
@if [ -z "$(RHSELFTESTDATA)" ]; then \
-   cp $(REDHAT)/$(CHANGELOG) $(SOURCES)/$(CHANGELOG); \
+   cp $(REDHAT)/$(SPECCHANGELOG) $(SOURCES)/$(SPECCHANGELOG); \
else \
-   echo "Mon Mar 28 2022 Fedora Kernel Team 
 [$(RPMVERSION)]" > $(SOURCES)/$(CHANGELOG); \
+   echo "Mon Mar 28 2022 Fedora Kernel Team 
 [$(RPMVERSION)]" > $(SOURCES)/$(SPECCHANGELOG); 
\
fi
@if [ -z "$(PATCHLIST_URL)" ]; then \
echo "Error: PATCHLIST_URL must be set (to 'none' or any URL)"; 
\
@@ -568,19 +568,19 @@ dist-rpm-baseonly: dist-sources do-rpmbuild
 
 # unless you know what you're doing, you don't want to use the next four ones
 dist-release-finish: setup-source
-   @cp $(SOURCES)/$(CHANGELOG) $(REDHAT)/$(CHANGELOG)
-   @$(GIT) add $(REDHAT)/$(CHANGELOG)
+   @cp $(SOURCES)/$(SPECCHANGELOG) $(REDHAT)/$(SPECCHANGELOG)
+   @$(GIT) add $(REDHAT)/$(SPECCHANGELOG)
@$(GIT) add $(REDHAT)/marker
-   @$(GIT) commit -s ../Makefile.rhelver $(REDHAT)/marker 
$(REDHAT)/$(CHANGELOG) $(PACKAGE_NAME).spec.template -m "[redhat] 
$(PACKAGE_NAME)-$(RPMVERSION)"
+   @$(GIT) commit -s ../Makefile.rhelver $(REDHAT)/marker 
$(REDHAT)/$(SPECCHANGELOG) $(PACKAGE_NAME).spec.template -m "[redhat] 
$(PACKAGE_NAME)-$(RPMVERSION)"
 dist-release-changed: setup-source
-   @cp $(SOURCES)/$(CHANGELOG) $(REDHAT)/$(CHANGELOG)
+   @cp $(SOURCES)/$(SPECCHANGELOG) $(REDHAT)/$(SPECCHANGELOG)
@echo $(MARKER) > $(REDHAT)/marker
@# if neither changelog nor marker was updated, skip bumping a release
@$(GIT) update-index -q --really-refresh
@if $(GIT) diff-index --quiet HEAD; then \
echo "Nothing changed, skipping updates"; \
else \
-   $(GIT) checkout -- $(REDHAT)/$(CHANGELOG); \
+   $(GIT) checkout -- $(REDHAT)/$(SPECCHANGELOG); \
$(REDHAT)/scripts/new_release.sh $(REDHAT) $(__YSTREAM) 
$(__ZSTREAM) $(BUMP_RELEASE); \
$(MAKE) dist-release-finish; \
fi
diff --git a/redhat/genspec.sh b/redhat/genspec.sh
index blahblah..blahblah 100755
--- a/redhat/genspec.sh
+++ b/redhat/genspec.sh
@@ -85,8 +85,8 @@ done
 if [ -n "$RHSELFTESTDATA" ]; then
test -f "$SOURCES/$SPECFILE" &&
sed -i -e "
-   /%%CHANGELOG%%/r $SOURCES/$CHANGELOG
-   /%%CHANGELOG%%/d" "$SOURCES/$SPECFILE"
+   /%%SPECCHANGELOG%%/r $SOURCES/$SPECCHANGELOG
+   /%%SPECCHANGELOG%%/d" "$SOURCES/$SPECFILE"
exit 0
 fi
 
@@ -130,7 +130,7 @@ fi
 # This means we need to zap entries that are already present in the changelog.
 if [ "$MARKER" != "$LAST_MARKER" ]; then
# awk trick to get all unique lines
-   awk '!seen[$0]++' "$SOURCES/$CHANGELOG" "$clogf" > "$clogf.unique"
+   awk '!seen[$0]++' "$SOURCES/$SPECCHANGELOG" "$clogf" > "$clogf.unique"
# sed trick to get the end of the changelog minus the line
sed -e '1,/# END OF CHANGELOG/ d' "$clogf.unique" > "$clogf.tmp"
# Add an explicit entry to indicate a rebase.
@@ -155,16 +155,16 @@ if [ "$LENGTH" = 0 ]; then
touch $clogf
 fi
 
-cat "$clogf" "$SOURCES/$CHANGELOG" > "$clogf.full"
-mv -f "$clogf.full" "$SOURCES/$CHANGELOG"
+cat "$clogf" "$SOURCES/$SPECCHANGELOG" > "$clogf.full"
+mv -f "$clogf.full" "$SOURCES/$SPECCHANGELOG"
 
 # genlog.py generates Resolves lines as well, strip these from RPM changelog
-cat "$SOURCES/$CHANGELOG" | 

[OS-BUILD PATCHv2 9/19] redhat/genspec: Rename BUILDID_DEFINE to SPECBUILDID

2022-05-02 Thread Prarit Bhargava (via Email Bridge)
From: Prarit Bhargava 

redhat/genspec: Rename BUILDID_DEFINE to SPECBUILDID

Change BUILDID_DEFINE to SPECBUILDID so that readers understand it is passed
into the spec file.

Rename BUILDID_DEFINE to SPECBUILDID.

Signed-off-by: Prarit Bhargava 

diff --git a/redhat/genspec.sh b/redhat/genspec.sh
index blahblah..blahblah 100755
--- a/redhat/genspec.sh
+++ b/redhat/genspec.sh
@@ -23,9 +23,9 @@ else
 fi
 
 if [ -n "$BUILDID" ]; then
-   BUILDID_DEFINE=$(printf "%%define buildid %s" "$BUILDID")
+   SPECBUILDID=$(printf "%%define buildid %s" "$BUILDID")
 else
-   BUILDID_DEFINE="# define buildid .local"
+   SPECBUILDID="# define buildid .local"
 fi
 
 EXCLUDE_FILES=":(exclude,top).get_maintainer.conf \
@@ -57,7 +57,7 @@ fi
 
 test -f "$SOURCES/$SPECFILE" &&
sed -i -e "
-   s/%%BUILDID%%/$BUILDID_DEFINE/
+   s/%%SPECBUILDID%%/$SPECBUILDID/
s/%%SPECKVERSION%%/$SPECKVERSION/
s/%%SPECKPATCHLEVEL%%/$SPECKPATCHLEVEL/
s/%%PKGRELEASE%%/$PKGRELEASE/
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
@@ -115,7 +115,7 @@ Summary: The Linux kernel
 # for parallel xz processes, replace with 1 to go back to single process
 %endif
 
-%%BUILDID%%
+%%SPECBUILDID%%
 
 
 %if 0%{?fedora}

--
https://gitlab.com/cki-project/kernel-ark/-/merge_requests/1728
___
kernel mailing list -- kernel@lists.fedoraproject.org
To unsubscribe send an email to kernel-le...@lists.fedoraproject.org
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@lists.fedoraproject.org
Do not reply to spam on the list, report it: 
https://pagure.io/fedora-infrastructure


[OS-BUILD PATCHv2 7/19] redhat/Makfile: Rename RPMKEXTRAVERSION to SPECKEXTRAVERSION

2022-05-02 Thread Prarit Bhargava (via Email Bridge)
From: Prarit Bhargava 

redhat/Makfile: Rename RPMKEXTRAVERSION to SPECKEXTRAVERSION

Change RPMKEXTRAVERSION to SPECEXTRAVERSION so that readers understand it is 
passed
into the spec file.

Rename RPMKEXTRAVERSION to SPECKEXTRAVERSION.

Signed-off-by: Prarit Bhargava 

diff --git a/redhat/Makefile b/redhat/Makefile
index blahblah..blahblah 100644
--- a/redhat/Makefile
+++ b/redhat/Makefile
@@ -53,7 +53,7 @@ MACH:=$(shell uname -m)
 SPECKVERSION:=$(shell $(GIT) show $(HEAD):Makefile | sed -ne '/^VERSION\ =\ 
/{s///;p;q}')
 SPECKPATCHLEVEL:=$(shell $(GIT) show $(HEAD):Makefile | sed -ne '/^PATCHLEVEL\ 
=\ /{s///;p;q}')
 SPECKSUBLEVEL:=$(shell $(GIT) show $(HEAD):Makefile | sed -ne '/^SUBLEVEL\ =\ 
/{s///;p;q}')
-RPMKEXTRAVERSION:=$(shell $(GIT) show $(HEAD):Makefile | sed -ne 
'/^EXTRAVERSION\ =\ /{s///;p;q}')
+SPECKEXTRAVERSION:=$(shell $(GIT) show $(HEAD):Makefile | sed -ne 
'/^EXTRAVERSION\ =\ /{s///;p;q}')
 GITID:= $(shell $(GIT) log --max-count=1 --pretty=format:%H $(HEAD))
 ifndef BUILD
   BUILD:=$(RHEL_RELEASE)
@@ -131,13 +131,13 @@ ifeq ("$(origin O)", "command line")
 endif
 
 # MARKER is the git tag which we base off of for exporting patches
-# Make sure MARKER uses SPECKPATCHLEVEL and RPMKEXTRAVERSION from the kernel
+# Make sure MARKER uses SPECKPATCHLEVEL and SPECKEXTRAVERSION from the kernel
 # makefile as opposed to any adjusted version for snapshotting.
-ifneq ($(RPMKEXTRAVERSION),)
-  MARKER:=v$(SPECKVERSION).$(SPECKPATCHLEVEL)$(RPMKEXTRAVERSION)
-  KEXTRAVERSION:=$(shell echo $(RPMKEXTRAVERSION) | sed -e s/-/./)
+ifneq ($(SPECKEXTRAVERSION),)
+  MARKER:=v$(SPECKVERSION).$(SPECKPATCHLEVEL)$(SPECKEXTRAVERSION)
+  KEXTRAVERSION:=$(shell echo $(SPECKEXTRAVERSION) | sed -e s/-/./)
   PREBUILD:=0$(KEXTRAVERSION).
-  UPSTREAM_TARBALL_NAME:=$(SPECKVERSION).$(SPECKPATCHLEVEL)$(RPMKEXTRAVERSION)
+  UPSTREAM_TARBALL_NAME:=$(SPECKVERSION).$(SPECKPATCHLEVEL)$(SPECKEXTRAVERSION)
 else
   KEXTRAVERSION:=
   ifeq ($(SPECKSUBLEVEL),0)
@@ -182,7 +182,7 @@ ifeq ($(VERSION_ON_UPSTREAM),1)
 # been updated but we still need something that works for
 # packaging. Fix this by bumping the patch level and marking
 # this as rc0
-ifeq ($(RPMKEXTRAVERSION),)
+ifeq ($(SPECKEXTRAVERSION),)
   KEXTRAVERSION:=.rc0
   PREBUILD:=0$(KEXTRAVERSION).
   SPECKPATCHLEVEL:=$(shell expr $(SPECKPATCHLEVEL) + 1)
diff --git a/redhat/self-test/data/centos-2585cf9dfaad.el7 
b/redhat/self-test/data/centos-2585cf9dfaad.el7
index blahblah..blahblah 100644
--- a/redhat/self-test/data/centos-2585cf9dfaad.el7
+++ b/redhat/self-test/data/centos-2585cf9dfaad.el7
@@ -50,13 +50,13 @@ RHPKG_BIN=centpkg
 RHSELFTESTDATA=1 
 RPM=../redhat/rpm 
 RPMBUILD=rpmbuild 
-RPMKEXTRAVERSION=-rc5 
 RPMVERSION=5.16.0-0.rc5.6.test 
 SHELL=/bin/sh 
 SINGLE_TARBALL=1 
 SNAPSHOT=0 
 SOURCES=../redhat/rpm/SOURCES 
 SPECFILE=kernel.spec 
+SPECKEXTRAVERSION=-rc5 
 SPECKPATCHLEVEL=16 
 SPECKSUBLEVEL=0 
 SPECKVERSION=5 
diff --git a/redhat/self-test/data/centos-2585cf9dfaad.fc25 
b/redhat/self-test/data/centos-2585cf9dfaad.fc25
index blahblah..blahblah 100644
--- a/redhat/self-test/data/centos-2585cf9dfaad.fc25
+++ b/redhat/self-test/data/centos-2585cf9dfaad.fc25
@@ -50,13 +50,13 @@ RHPKG_BIN=centpkg
 RHSELFTESTDATA=1 
 RPM=../redhat/rpm 
 RPMBUILD=rpmbuild 
-RPMKEXTRAVERSION=-rc5 
 RPMVERSION=5.16.0-0.rc5.6.test 
 SHELL=/bin/sh 
 SINGLE_TARBALL=1 
 SNAPSHOT=0 
 SOURCES=../redhat/rpm/SOURCES 
 SPECFILE=kernel.spec 
+SPECKEXTRAVERSION=-rc5 
 SPECKPATCHLEVEL=16 
 SPECKSUBLEVEL=0 
 SPECKVERSION=5 
diff --git a/redhat/self-test/data/centos-78e36f3b0dae.el7 
b/redhat/self-test/data/centos-78e36f3b0dae.el7
index blahblah..blahblah 100644
--- a/redhat/self-test/data/centos-78e36f3b0dae.el7
+++ b/redhat/self-test/data/centos-78e36f3b0dae.el7
@@ -50,13 +50,13 @@ RHPKG_BIN=centpkg
 RHSELFTESTDATA=1 
 RPM=../redhat/rpm 
 RPMBUILD=rpmbuild 
-RPMKEXTRAVERSION= 
 RPMVERSION=5.17.0-0.rc0.78e36f3b0dae586.6.test 
 SHELL=/bin/sh 
 SINGLE_TARBALL=1 
 SNAPSHOT=1 
 SOURCES=../redhat/rpm/SOURCES 
 SPECFILE=kernel.spec 
+SPECKEXTRAVERSION= 
 SPECKPATCHLEVEL=17 
 SPECKSUBLEVEL=0 
 SPECKVERSION=5 
diff --git a/redhat/self-test/data/centos-78e36f3b0dae.fc25 
b/redhat/self-test/data/centos-78e36f3b0dae.fc25
index blahblah..blahblah 100644
--- a/redhat/self-test/data/centos-78e36f3b0dae.fc25
+++ b/redhat/self-test/data/centos-78e36f3b0dae.fc25
@@ -50,13 +50,13 @@ RHPKG_BIN=centpkg
 RHSELFTESTDATA=1 
 RPM=../redhat/rpm 
 RPMBUILD=rpmbuild 
-RPMKEXTRAVERSION= 
 RPMVERSION=5.17.0-0.rc0.78e36f3b0dae586.6.test 
 SHELL=/bin/sh 
 SINGLE_TARBALL=1 
 SNAPSHOT=1 
 SOURCES=../redhat/rpm/SOURCES 
 SPECFILE=kernel.spec 
+SPECKEXTRAVERSION= 
 SPECKPATCHLEVEL=17 
 SPECKSUBLEVEL=0 
 SPECKVERSION=5 
diff --git a/redhat/self-test/data/centos-df0cc57e057f.el7 
b/redhat/self-test/data/centos-df0cc57e057f.el7
index blahblah..blahblah 100644
--- a/redhat/self-test/data/centos-df0cc57e057f.el7
+++ b/redhat/self-test/data/centos-df0cc57e057f.el7
@@ -50,13 +50,13 @@ RHPKG_BIN=centpkg
 

[OS-BUILD PATCHv2 0/19] redhat: test updates

2022-05-02 Thread Prarit Bhargava (via Email Bridge)
From: Prarit Bhargava on gitlab.com
Merge Request: https://gitlab.com/cki-project/kernel-ark/-/merge_requests/1728

Depends: https://gitlab.com/cki-project/kernel-ark/-/merge_requests/1727

Add a test to verify Makefile declarations, and add the RHTEST variable.
The latter of these changes allows users to execute make commands
with -n, --dry-run, and other "test" commands.

Signed-off-by: Prarit Bhargava 

---
 redhat/configs/build_configs.sh |2 +
 redhat/configs/generate_all_configs.sh  |4 +-
 redhat/configs/process_configs.sh   |2 +
 redhat/docs/makefile-changes.rst|8 +-
 redhat/scripts/create-tarball.sh|5 +-
 redhat/scripts/rh-dist-git.sh   |4 +-
 redhat/self-test/data/centos-2585cf9dfaad.el7   |   26 ++--
 redhat/self-test/data/centos-2585cf9dfaad.el7.spec  |   26 ++--
 redhat/self-test/data/centos-2585cf9dfaad.fc25  |   26 ++--
 redhat/self-test/data/centos-2585cf9dfaad.fc25.spec |   26 ++--
 redhat/self-test/data/centos-78e36f3b0dae.el7   |   24 ++--
 redhat/self-test/data/centos-78e36f3b0dae.el7.spec  |   26 ++--
 redhat/self-test/data/centos-78e36f3b0dae.fc25  |   24 ++--
 redhat/self-test/data/centos-78e36f3b0dae.fc25.spec |   26 ++--
 redhat/self-test/data/centos-df0cc57e057f.el7   |   26 ++--
 redhat/self-test/data/centos-df0cc57e057f.el7.spec  |   26 ++--
 redhat/self-test/data/centos-df0cc57e057f.fc25  |   26 ++--
 redhat/self-test/data/centos-df0cc57e057f.fc25.spec |   26 ++--
 redhat/self-test/data/centos-fce15c45d3fb.el7   |   24 ++--
 redhat/self-test/data/centos-fce15c45d3fb.el7.spec  |   26 ++--
 redhat/self-test/data/centos-fce15c45d3fb.fc25  |   24 ++--
 redhat/self-test/data/centos-fce15c45d3fb.fc25.spec |   26 ++--
 redhat/self-test/data/fedora-2585cf9dfaad.el7   |   26 ++--
 redhat/self-test/data/fedora-2585cf9dfaad.el7.spec  |   26 ++--
 redhat/self-test/data/fedora-2585cf9dfaad.fc25  |   26 ++--
 redhat/self-test/data/fedora-2585cf9dfaad.fc25.spec |   26 ++--
 redhat/self-test/data/fedora-78e36f3b0dae.el7   |   24 ++--
 redhat/self-test/data/fedora-78e36f3b0dae.el7.spec  |   26 ++--
 redhat/self-test/data/fedora-78e36f3b0dae.fc25  |   24 ++--
 redhat/self-test/data/fedora-78e36f3b0dae.fc25.spec |   26 ++--
 redhat/self-test/data/fedora-df0cc57e057f.el7   |   26 ++--
 redhat/self-test/data/fedora-df0cc57e057f.el7.spec  |   26 ++--
 redhat/self-test/data/fedora-df0cc57e057f.fc25  |   26 ++--
 redhat/self-test/data/fedora-df0cc57e057f.fc25.spec |   26 ++--
 redhat/self-test/data/fedora-fce15c45d3fb.el7   |   24 ++--
 redhat/self-test/data/fedora-fce15c45d3fb.el7.spec  |   26 ++--
 redhat/self-test/data/fedora-fce15c45d3fb.fc25  |   24 ++--
 redhat/self-test/data/fedora-fce15c45d3fb.fc25.spec |   26 ++--
 redhat/self-test/data/rhel-2585cf9dfaad.el7 |   26 ++--
 redhat/self-test/data/rhel-2585cf9dfaad.el7.spec|   26 ++--
 redhat/self-test/data/rhel-2585cf9dfaad.fc25|   26 ++--
 redhat/self-test/data/rhel-2585cf9dfaad.fc25.spec   |   26 ++--
 redhat/self-test/data/rhel-78e36f3b0dae.el7 |   24 ++--
 redhat/self-test/data/rhel-78e36f3b0dae.el7.spec|   26 ++--
 redhat/self-test/data/rhel-78e36f3b0dae.fc25|   24 ++--
 redhat/self-test/data/rhel-78e36f3b0dae.fc25.spec   |   26 ++--
 redhat/self-test/data/rhel-df0cc57e057f.el7 |   26 ++--
 redhat/self-test/data/rhel-df0cc57e057f.el7.spec|   26 ++--
 redhat/self-test/data/rhel-df0cc57e057f.fc25|   26 ++--
 redhat/self-test/data/rhel-df0cc57e057f.fc25.spec   |   26 ++--
 redhat/self-test/data/rhel-fce15c45d3fb.el7 |   24 ++--
 redhat/self-test/data/rhel-fce15c45d3fb.el7.spec|   26 ++--
 redhat/self-test/data/rhel-fce15c45d3fb.fc25|   24 ++--
 redhat/self-test/data/rhel-fce15c45d3fb.fc25.spec   |   26 ++--
 redhat/self-test/1006-verify-SPEC-variables.bats|   25 
 redhat/self-test/3001-Makefile-contents.bats|   17 +++
 redhat/Makefile |  105 ---
 redhat/Makefile.variables   |2 +-
 redhat/genspec.sh   |   70 ++--
 redhat/kernel.spec.template |   54 +-
 redhat/update_scripts.sh|2 +-
 61 files changed, 802 insertions(+), 722 deletions(-)
___
kernel mailing list -- kernel@lists.fedoraproject.org
To unsubscribe send an email to kernel-le...@lists.fedoraproject.org
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@lists.fedoraproject.org
Do not reply to spam on the list, report it: 
https://pagure.io/fedora-infrastructure


[OS-BUILD PATCHv2 4/19] redhat/Makefile: Rename RPMKVERSION to SPECKVERSION

2022-05-02 Thread Prarit Bhargava (via Email Bridge)
From: Prarit Bhargava 

redhat/Makefile: Rename RPMKVERSION to SPECKVERSION

Change RPMKVERSION to SPECVERSION so that readers understand it is passed
into the spec file.

Rename RPMKVERSION to SPECKVERSION.

Signed-off-by: Prarit Bhargava 

diff --git a/redhat/Makefile b/redhat/Makefile
index blahblah..blahblah 100644
--- a/redhat/Makefile
+++ b/redhat/Makefile
@@ -50,7 +50,7 @@ RPMBUILD:=$(shell if [ -x "/usr/bin/rpmbuild" ]; then echo 
rpmbuild; \
   else echo rpm; fi)
 
 MACH:=$(shell uname -m)
-RPMKVERSION:=$(shell $(GIT) show $(HEAD):Makefile | sed -ne '/^VERSION\ =\ 
/{s///;p;q}')
+SPECKVERSION:=$(shell $(GIT) show $(HEAD):Makefile | sed -ne '/^VERSION\ =\ 
/{s///;p;q}')
 RPMKPATCHLEVEL:=$(shell $(GIT) show $(HEAD):Makefile | sed -ne '/^PATCHLEVEL\ 
=\ /{s///;p;q}')
 RPMKSUBLEVEL:=$(shell $(GIT) show $(HEAD):Makefile | sed -ne '/^SUBLEVEL\ =\ 
/{s///;p;q}')
 RPMKEXTRAVERSION:=$(shell $(GIT) show $(HEAD):Makefile | sed -ne 
'/^EXTRAVERSION\ =\ /{s///;p;q}')
@@ -134,15 +134,15 @@ endif
 # Make sure MARKER uses RPMKPATCHLEVEL and RPMKEXTRAVERSION from the kernel
 # makefile as opposed to any adjusted version for snapshotting.
 ifneq ($(RPMKEXTRAVERSION),)
-  MARKER:=v$(RPMKVERSION).$(RPMKPATCHLEVEL)$(RPMKEXTRAVERSION)
+  MARKER:=v$(SPECKVERSION).$(RPMKPATCHLEVEL)$(RPMKEXTRAVERSION)
   KEXTRAVERSION:=$(shell echo $(RPMKEXTRAVERSION) | sed -e s/-/./)
   PREBUILD:=0$(KEXTRAVERSION).
-  UPSTREAM_TARBALL_NAME:=$(RPMKVERSION).$(RPMKPATCHLEVEL)$(RPMKEXTRAVERSION)
+  UPSTREAM_TARBALL_NAME:=$(SPECKVERSION).$(RPMKPATCHLEVEL)$(RPMKEXTRAVERSION)
 else
   KEXTRAVERSION:=
   ifeq ($(RPMKSUBLEVEL),0)
-MARKER:=v$(RPMKVERSION).$(RPMKPATCHLEVEL)
-UPSTREAM_TARBALL_NAME:=$(RPMKVERSION).$(RPMKPATCHLEVEL)
+MARKER:=v$(SPECKVERSION).$(RPMKPATCHLEVEL)
+UPSTREAM_TARBALL_NAME:=$(SPECKVERSION).$(RPMKPATCHLEVEL)
   else
 # Make sure MARKER uses RPMKPATCHLEVEL and RPMKEXTRAVERSION from the kernel
 # makefile as opposed to any adjusted version for snapshotting.  IOW,
@@ -207,7 +207,7 @@ else
   SNAPSHOT:=0
 endif
 
-SPECVERSION:=$(RPMKVERSION).$(RPMKPATCHLEVEL).$(RPMKSUBLEVEL)
+SPECVERSION:=$(SPECKVERSION).$(RPMKPATCHLEVEL).$(RPMKSUBLEVEL)
 PKGRELEASE:=$(PREBUILD)$(BUILD)$(BUILDID)
 
KABI_TARBALL:=$(SOURCES)/kernel-abi-stablelists-$(SPECVERSION)-$(PKGRELEASE).tar.bz2
 KABIDW := $(REDHAT)/kabi-dwarf
diff --git a/redhat/genspec.sh b/redhat/genspec.sh
index blahblah..blahblah 100755
--- a/redhat/genspec.sh
+++ b/redhat/genspec.sh
@@ -58,7 +58,7 @@ fi
 test -f "$SOURCES/$SPECFILE" &&
sed -i -e "
s/%%BUILDID%%/$BUILDID_DEFINE/
-   s/%%RPMKVERSION%%/$RPMKVERSION/
+   s/%%SPECKVERSION%%/$SPECKVERSION/
s/%%RPMKPATCHLEVEL%%/$RPMKPATCHLEVEL/
s/%%PKGRELEASE%%/$PKGRELEASE/
s/%%SPECRELEASE%%/$SPECRELEASE/
@@ -93,7 +93,7 @@ fi
 GIT_FORMAT="--format=- %s (%an)%n%N%n^^^NOTES-END^^^%n%b"
 GIT_NOTES="--notes=refs/notes/${RHEL_MAJOR}.${RHEL_MINOR}*"
 
-lasttag=$(git rev-list --first-parent --grep="^\[redhat\] 
kernel-${RPMKVERSION}.${RPMKPATCHLEVEL}" --max-count=1 HEAD)
+lasttag=$(git rev-list --first-parent --grep="^\[redhat\] 
kernel-${SPECKVERSION}.${RPMKPATCHLEVEL}" --max-count=1 HEAD)
 # if we didn't find the proper tag, assume this is the first release
 if [[ -z $lasttag ]]; then
 if [[ -z ${MARKER//[0-9a-f]/} ]]; then
@@ -174,12 +174,12 @@ if [ "$SINGLE_TARBALL" = 0 ]; then
# May need to preserve word splitting in EXCLUDE_FILES
# shellcheck disable=SC2086
git diff -p --no-renames --stat "$MARKER"..  $EXCLUDE_FILES \
-   > ${SOURCES}/patch-${RPMKVERSION}.${RPMKPATCHLEVEL}-redhat.patch
+   > 
${SOURCES}/patch-${SPECKVERSION}.${RPMKPATCHLEVEL}-redhat.patch
 else
# The tarball in the SRPM contains both upstream sources and OS-specifc
# commits.  Even though this is the case, an empty file for dist-git
# compatibility is necessary.
-   touch "${SOURCES}/patch-${RPMKVERSION}.${RPMKPATCHLEVEL}"-redhat.patch
+   touch "${SOURCES}/patch-${SPECKVERSION}.${RPMKPATCHLEVEL}"-redhat.patch
 fi
 
 rm -f "$clogf"{,.stripped};
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
@@ -125,10 +125,10 @@ Summary: The Linux kernel
 %endif
 
 # The kernel tarball/base version
-%define kversion %%RPMKVERSION%%.%%RPMKPATCHLEVEL%%
+%define kversion %%SPECKVERSION%%.%%RPMKPATCHLEVEL%%
 
 %define specversion %%SPECVERSION%%
-%define patchversion %%RPMKVERSION%%.%%RPMKPATCHLEVEL%%
+%define patchversion %%SPECKVERSION%%.%%RPMKPATCHLEVEL%%
 %define pkgrelease %%PKGRELEASE%%
 
 # This is needed to do merge window version magic
@@ -1355,7 +1355,7 @@ ApplyPatch()
 exit 1
   fi
   if ! grep -E "^Patch[0-9]+: $patch\$" %{_specdir}/${RPM_PACKAGE_NAME}.spec ; 
then
-if [ "${patch:0:8}" != "patch-%%RPMKVERSION%%." ] ; then
+if [ "${patch:0:8}" != "patch-%%SPECKVERSION%%." ] ; then
  

[OS-BUILD PATCHv2 3/19] redhat/Makefile: Rename KVERSION to SPECVERSION

2022-05-02 Thread Prarit Bhargava (via Email Bridge)
From: Prarit Bhargava 

redhat/Makefile: Rename KVERSION to SPECVERSION

KVERSION is passed into the spec file and is easy to confuse with the
kernel KVERSION.  Change the name to SPECVERSION so that readers
understand it is the %Version field of the specfile.

As a result RPMKSUBLEVEL can be dropped from genspec.sh.

Rename KVERSION to SPECVERSION and use it in the specfile.

Signed-off-by: Prarit Bhargava 

diff --git a/redhat/Makefile b/redhat/Makefile
index blahblah..blahblah 100644
--- a/redhat/Makefile
+++ b/redhat/Makefile
@@ -146,7 +146,7 @@ else
   else
 # Make sure MARKER uses RPMKPATCHLEVEL and RPMKEXTRAVERSION from the kernel
 # makefile as opposed to any adjusted version for snapshotting.  IOW,
-# these variables are *NOT* equivalent to the KVERSION variable.
+# these variables are *NOT* equivalent to the SPECVERSION variable.
 MARKER:=v$(RPMKVERSION).$(RPMKPATCHLEVEL).$(RPMKSUBLEVEL)
 UPSTREAM_TARBALL_NAME:=$(RPMKVERSION).$(RPMKPATCHLEVEL).$(RPMKSUBLEVEL)
   endif
@@ -207,12 +207,12 @@ else
   SNAPSHOT:=0
 endif
 
-KVERSION:=$(RPMKVERSION).$(RPMKPATCHLEVEL).$(RPMKSUBLEVEL)
+SPECVERSION:=$(RPMKVERSION).$(RPMKPATCHLEVEL).$(RPMKSUBLEVEL)
 PKGRELEASE:=$(PREBUILD)$(BUILD)$(BUILDID)
-KABI_TARBALL:=$(SOURCES)/kernel-abi-stablelists-$(KVERSION)-$(PKGRELEASE).tar.bz2
+KABI_TARBALL:=$(SOURCES)/kernel-abi-stablelists-$(SPECVERSION)-$(PKGRELEASE).tar.bz2
 KABIDW := $(REDHAT)/kabi-dwarf
-KABIDW_TARBALL:=$(SOURCES)/kernel-kabi-dw-$(KVERSION)-$(PKGRELEASE).tar.bz2
-RPMVERSION:=$(KVERSION)-$(PKGRELEASE)
+KABIDW_TARBALL:=$(SOURCES)/kernel-kabi-dw-$(SPECVERSION)-$(PKGRELEASE).tar.bz2
+RPMVERSION:=$(SPECVERSION)-$(PKGRELEASE)
 SPECRELEASE:=$(PREBUILD)$(BUILD)%{?buildid}%{?dist}
 SRPM:=$(SRPMS)/$(PACKAGE_NAME)-$(RPMVERSION)$(DIST).src.rpm
 
@@ -354,11 +354,11 @@ dist-kabi-dw-check: dist-kabi
 
 dist-configs-commit: dist-configs-prep
+@cd $(REDHAT)/configs; ./generate_all_configs.sh 1;\
-   ./process_configs.sh -z "$(KVERSION)" "$(FLAVOR)"
+   ./process_configs.sh -z "$(SPECVERSION)" "$(FLAVOR)"
 
 dist-configs: dist-configs-prep
+@cd $(REDHAT)/configs; ./generate_all_configs.sh 1;\
-   ./process_configs.sh $(PROCESS_CONFIGS_OPTS) "$(KVERSION)" ""
+   ./process_configs.sh $(PROCESS_CONFIGS_OPTS) "$(SPECVERSION)" ""
 
 dist-fedora-configs: FLAVOR = fedora
 dist-fedora-configs: dist-configs
@@ -427,12 +427,12 @@ dist-tarball: $(TARBALL)
 dist-kernelrelease:
# deprecated at 5.17.0
@echo "WARNING: This target will be deprecated in a future release."
-   @echo $(PACKAGE_NAME)-$(KVERSION)-$(PKGRELEASE)
+   @echo $(PACKAGE_NAME)-$(SPECVERSION)-$(PKGRELEASE)
 
 dist-kernelversion:
# deprecated at 5.17.0
@echo "WARNING: This target will be deprecated in a future release."
-   @echo $(KVERSION)-$(PKGRELEASE)
+   @echo $(SPECVERSION)-$(PKGRELEASE)
 
 dist-specfile: setup-source
# deprecated at 5.17.0
diff --git a/redhat/configs/generate_all_configs.sh 
b/redhat/configs/generate_all_configs.sh
index blahblah..blahblah 100755
--- a/redhat/configs/generate_all_configs.sh
+++ b/redhat/configs/generate_all_configs.sh
@@ -18,7 +18,7 @@ else
 fi
 
 for i in kernel-*-"$FLAVOR".config; do
-   NEW=kernel-"$KVERSION"-$(echo "$i" | cut -d - -f2- | sed s/-"$FLAVOR"//)
+   NEW=kernel-"$SPECVERSION"-$(echo "$i" | cut -d - -f2- | sed 
s/-"$FLAVOR"//)
#echo $NEW
mv "$i" "$NEW"
 done
diff --git a/redhat/docs/makefile-changes.rst b/redhat/docs/makefile-changes.rst
index blahblah..blahblah 100644
--- a/redhat/docs/makefile-changes.rst
+++ b/redhat/docs/makefile-changes.rst
@@ -73,4 +73,4 @@ or,
   dist-kernelversion:
 # deprecated in 5.17.0
 @echo "WARNING: This target will be removed in a later release."
-@echo $(KVERSION)-$(DISTRO_BUILD)
+@echo $(SPECVERSION)-$(DISTRO_BUILD)
diff --git a/redhat/genspec.sh b/redhat/genspec.sh
index blahblah..blahblah 100755
--- a/redhat/genspec.sh
+++ b/redhat/genspec.sh
@@ -60,7 +60,6 @@ test -f "$SOURCES/$SPECFILE" &&
s/%%BUILDID%%/$BUILDID_DEFINE/
s/%%RPMKVERSION%%/$RPMKVERSION/
s/%%RPMKPATCHLEVEL%%/$RPMKPATCHLEVEL/
-   s/%%RPMKSUBLEVEL%%/$RPMKSUBLEVEL/
s/%%PKGRELEASE%%/$PKGRELEASE/
s/%%SPECRELEASE%%/$SPECRELEASE/
s/%%RELEASED_KERNEL%%/$RELEASED_KERNEL/
@@ -68,6 +67,7 @@ test -f "$SOURCES/$SPECFILE" &&
s/%%INCLUDE_FEDORA_FILES%%/$INCLUDE_FEDORA_FILES/
s/%%INCLUDE_RHEL_FILES%%/$INCLUDE_RHEL_FILES/
s/%%PATCHLIST_CHANGELOG%%/$PATCHLIST_CHANGELOG/
+   s/%%SPECVERSION%%/$SPECVERSION/
s/%%TARFILE_RELEASE%%/$TARFILE_RELEASE/" "$SOURCES/$SPECFILE"
 
 # We depend on work splitting of BUILDOPTS
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
@@ -127,7 +127,7 @@ Summary: The Linux kernel
 # The kernel tarball/base version
 %define kversion 

[OS-BUILD PATCHv2 6/19] redhat/Makfile: Rename RPMKSUBLEVEL to SPECKSUBLEVEL

2022-05-02 Thread Prarit Bhargava (via Email Bridge)
From: Prarit Bhargava 

redhat/Makfile: Rename RPMKSUBLEVEL to SPECKSUBLEVEL

Change RPMKSUBLEVEL to SPECSUBLEVEL so that readers understand it is passed
into the spec file.

Rename RPMKSUBLEVEL to SPECKSUBLEVEL.

Signed-off-by: Prarit Bhargava 

diff --git a/redhat/Makefile b/redhat/Makefile
index blahblah..blahblah 100644
--- a/redhat/Makefile
+++ b/redhat/Makefile
@@ -52,7 +52,7 @@ RPMBUILD:=$(shell if [ -x "/usr/bin/rpmbuild" ]; then echo 
rpmbuild; \
 MACH:=$(shell uname -m)
 SPECKVERSION:=$(shell $(GIT) show $(HEAD):Makefile | sed -ne '/^VERSION\ =\ 
/{s///;p;q}')
 SPECKPATCHLEVEL:=$(shell $(GIT) show $(HEAD):Makefile | sed -ne '/^PATCHLEVEL\ 
=\ /{s///;p;q}')
-RPMKSUBLEVEL:=$(shell $(GIT) show $(HEAD):Makefile | sed -ne '/^SUBLEVEL\ =\ 
/{s///;p;q}')
+SPECKSUBLEVEL:=$(shell $(GIT) show $(HEAD):Makefile | sed -ne '/^SUBLEVEL\ =\ 
/{s///;p;q}')
 RPMKEXTRAVERSION:=$(shell $(GIT) show $(HEAD):Makefile | sed -ne 
'/^EXTRAVERSION\ =\ /{s///;p;q}')
 GITID:= $(shell $(GIT) log --max-count=1 --pretty=format:%H $(HEAD))
 ifndef BUILD
@@ -140,7 +140,7 @@ ifneq ($(RPMKEXTRAVERSION),)
   UPSTREAM_TARBALL_NAME:=$(SPECKVERSION).$(SPECKPATCHLEVEL)$(RPMKEXTRAVERSION)
 else
   KEXTRAVERSION:=
-  ifeq ($(RPMKSUBLEVEL),0)
+  ifeq ($(SPECKSUBLEVEL),0)
 MARKER:=v$(SPECKVERSION).$(SPECKPATCHLEVEL)
 UPSTREAM_TARBALL_NAME:=$(SPECKVERSION).$(SPECKPATCHLEVEL)
   else
@@ -207,7 +207,7 @@ else
   SNAPSHOT:=0
 endif
 
-SPECVERSION:=$(SPECKVERSION).$(SPECKPATCHLEVEL).$(RPMKSUBLEVEL)
+SPECVERSION:=$(SPECKVERSION).$(SPECKPATCHLEVEL).$(SPECKSUBLEVEL)
 PKGRELEASE:=$(PREBUILD)$(BUILD)$(BUILDID)
 
KABI_TARBALL:=$(SOURCES)/kernel-abi-stablelists-$(SPECVERSION)-$(PKGRELEASE).tar.bz2
 KABIDW := $(REDHAT)/kabi-dwarf
diff --git a/redhat/self-test/data/centos-2585cf9dfaad.el7 
b/redhat/self-test/data/centos-2585cf9dfaad.el7
index blahblah..blahblah 100644
--- a/redhat/self-test/data/centos-2585cf9dfaad.el7
+++ b/redhat/self-test/data/centos-2585cf9dfaad.el7
@@ -51,7 +51,6 @@ RHSELFTESTDATA=1
 RPM=../redhat/rpm 
 RPMBUILD=rpmbuild 
 RPMKEXTRAVERSION=-rc5 
-RPMKSUBLEVEL=0 
 RPMVERSION=5.16.0-0.rc5.6.test 
 SHELL=/bin/sh 
 SINGLE_TARBALL=1 
@@ -59,6 +58,7 @@ SNAPSHOT=0
 SOURCES=../redhat/rpm/SOURCES 
 SPECFILE=kernel.spec 
 SPECKPATCHLEVEL=16 
+SPECKSUBLEVEL=0 
 SPECKVERSION=5 
 SPECRELEASE=0.rc5.6%{?buildid}%{?dist} 
 SPECVERSION=5.16.0 
diff --git a/redhat/self-test/data/centos-2585cf9dfaad.fc25 
b/redhat/self-test/data/centos-2585cf9dfaad.fc25
index blahblah..blahblah 100644
--- a/redhat/self-test/data/centos-2585cf9dfaad.fc25
+++ b/redhat/self-test/data/centos-2585cf9dfaad.fc25
@@ -51,7 +51,6 @@ RHSELFTESTDATA=1
 RPM=../redhat/rpm 
 RPMBUILD=rpmbuild 
 RPMKEXTRAVERSION=-rc5 
-RPMKSUBLEVEL=0 
 RPMVERSION=5.16.0-0.rc5.6.test 
 SHELL=/bin/sh 
 SINGLE_TARBALL=1 
@@ -59,6 +58,7 @@ SNAPSHOT=0
 SOURCES=../redhat/rpm/SOURCES 
 SPECFILE=kernel.spec 
 SPECKPATCHLEVEL=16 
+SPECKSUBLEVEL=0 
 SPECKVERSION=5 
 SPECRELEASE=0.rc5.6%{?buildid}%{?dist} 
 SPECVERSION=5.16.0 
diff --git a/redhat/self-test/data/centos-78e36f3b0dae.el7 
b/redhat/self-test/data/centos-78e36f3b0dae.el7
index blahblah..blahblah 100644
--- a/redhat/self-test/data/centos-78e36f3b0dae.el7
+++ b/redhat/self-test/data/centos-78e36f3b0dae.el7
@@ -51,7 +51,6 @@ RHSELFTESTDATA=1
 RPM=../redhat/rpm 
 RPMBUILD=rpmbuild 
 RPMKEXTRAVERSION= 
-RPMKSUBLEVEL=0 
 RPMVERSION=5.17.0-0.rc0.78e36f3b0dae586.6.test 
 SHELL=/bin/sh 
 SINGLE_TARBALL=1 
@@ -59,6 +58,7 @@ SNAPSHOT=1
 SOURCES=../redhat/rpm/SOURCES 
 SPECFILE=kernel.spec 
 SPECKPATCHLEVEL=17 
+SPECKSUBLEVEL=0 
 SPECKVERSION=5 
 SPECRELEASE=0.rc0.78e36f3b0dae586.6%{?buildid}%{?dist} 
 SPECVERSION=5.17.0 
diff --git a/redhat/self-test/data/centos-78e36f3b0dae.fc25 
b/redhat/self-test/data/centos-78e36f3b0dae.fc25
index blahblah..blahblah 100644
--- a/redhat/self-test/data/centos-78e36f3b0dae.fc25
+++ b/redhat/self-test/data/centos-78e36f3b0dae.fc25
@@ -51,7 +51,6 @@ RHSELFTESTDATA=1
 RPM=../redhat/rpm 
 RPMBUILD=rpmbuild 
 RPMKEXTRAVERSION= 
-RPMKSUBLEVEL=0 
 RPMVERSION=5.17.0-0.rc0.78e36f3b0dae586.6.test 
 SHELL=/bin/sh 
 SINGLE_TARBALL=1 
@@ -59,6 +58,7 @@ SNAPSHOT=1
 SOURCES=../redhat/rpm/SOURCES 
 SPECFILE=kernel.spec 
 SPECKPATCHLEVEL=17 
+SPECKSUBLEVEL=0 
 SPECKVERSION=5 
 SPECRELEASE=0.rc0.78e36f3b0dae586.6%{?buildid}%{?dist} 
 SPECVERSION=5.17.0 
diff --git a/redhat/self-test/data/centos-df0cc57e057f.el7 
b/redhat/self-test/data/centos-df0cc57e057f.el7
index blahblah..blahblah 100644
--- a/redhat/self-test/data/centos-df0cc57e057f.el7
+++ b/redhat/self-test/data/centos-df0cc57e057f.el7
@@ -51,7 +51,6 @@ RHSELFTESTDATA=1
 RPM=../redhat/rpm 
 RPMBUILD=rpmbuild 
 RPMKEXTRAVERSION= 
-RPMKSUBLEVEL=0 
 RPMVERSION=5.16.0-6.test 
 SHELL=/bin/sh 
 SINGLE_TARBALL=1 
@@ -59,6 +58,7 @@ SNAPSHOT=0
 SOURCES=../redhat/rpm/SOURCES 
 SPECFILE=kernel.spec 
 SPECKPATCHLEVEL=16 
+SPECKSUBLEVEL=0 
 SPECKVERSION=5 
 SPECRELEASE=6%{?buildid}%{?dist} 
 SPECVERSION=5.16.0 
diff --git a/redhat/self-test/data/centos-df0cc57e057f.fc25 

[OS-BUILD PATCHv2 2/19] redhat/Makefile: Deprecate some simple targets

2022-05-02 Thread Prarit Bhargava (via Email Bridge)
From: Prarit Bhargava 

redhat/Makefile: Deprecate some simple targets

Deprecate some simple targets.

Signed-off-by: Prarit Bhargava 

diff --git a/redhat/Makefile b/redhat/Makefile
index blahblah..blahblah 100644
--- a/redhat/Makefile
+++ b/redhat/Makefile
@@ -420,15 +420,23 @@ $(KABIDW_TARBALL):
 
 
 dist-tarball: $(TARBALL)
+   # deprecated at 5.17.0
+   @echo "WARNING: This target will be deprecated in a future release."
@echo "redhat/$(TARFILE)"
 
 dist-kernelrelease:
+   # deprecated at 5.17.0
+   @echo "WARNING: This target will be deprecated in a future release."
@echo $(PACKAGE_NAME)-$(KVERSION)-$(PKGRELEASE)
 
 dist-kernelversion:
+   # deprecated at 5.17.0
+   @echo "WARNING: This target will be deprecated in a future release."
@echo $(KVERSION)-$(PKGRELEASE)
 
 dist-specfile: setup-source
+   # deprecated at 5.17.0
+   @echo "WARNING: This target will be deprecated in a future release."
@echo $(SOURCES)/$(SPECFILE)
 
 dist-git-version-check:

--
https://gitlab.com/cki-project/kernel-ark/-/merge_requests/1728
___
kernel mailing list -- kernel@lists.fedoraproject.org
To unsubscribe send an email to kernel-le...@lists.fedoraproject.org
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@lists.fedoraproject.org
Do not reply to spam on the list, report it: 
https://pagure.io/fedora-infrastructure


[OS-BUILD PATCHv2 1/19] redhat/Makefile: Use KVERSION

2022-05-02 Thread Prarit Bhargava (via Email Bridge)
From: Prarit Bhargava 

redhat/Makefile: Use KVERSION

Use KVERSION where appropriate in the Makefile.

Signed-off-by: Prarit Bhargava 

diff --git a/redhat/Makefile b/redhat/Makefile
index blahblah..blahblah 100644
--- a/redhat/Makefile
+++ b/redhat/Makefile
@@ -144,6 +144,9 @@ else
 MARKER:=v$(RPMKVERSION).$(RPMKPATCHLEVEL)
 UPSTREAM_TARBALL_NAME:=$(RPMKVERSION).$(RPMKPATCHLEVEL)
   else
+# Make sure MARKER uses RPMKPATCHLEVEL and RPMKEXTRAVERSION from the kernel
+# makefile as opposed to any adjusted version for snapshotting.  IOW,
+# these variables are *NOT* equivalent to the KVERSION variable.
 MARKER:=v$(RPMKVERSION).$(RPMKPATCHLEVEL).$(RPMKSUBLEVEL)
 UPSTREAM_TARBALL_NAME:=$(RPMKVERSION).$(RPMKPATCHLEVEL).$(RPMKSUBLEVEL)
   endif
@@ -209,7 +212,7 @@ PKGRELEASE:=$(PREBUILD)$(BUILD)$(BUILDID)
 
KABI_TARBALL:=$(SOURCES)/kernel-abi-stablelists-$(KVERSION)-$(PKGRELEASE).tar.bz2
 KABIDW := $(REDHAT)/kabi-dwarf
 KABIDW_TARBALL:=$(SOURCES)/kernel-kabi-dw-$(KVERSION)-$(PKGRELEASE).tar.bz2
-RPMVERSION:=$(RPMKVERSION).$(RPMKPATCHLEVEL).$(RPMKSUBLEVEL)-$(PKGRELEASE)
+RPMVERSION:=$(KVERSION)-$(PKGRELEASE)
 SPECRELEASE:=$(PREBUILD)$(BUILD)%{?buildid}%{?dist}
 SRPM:=$(SRPMS)/$(PACKAGE_NAME)-$(RPMVERSION)$(DIST).src.rpm
 

--
https://gitlab.com/cki-project/kernel-ark/-/merge_requests/1728
___
kernel mailing list -- kernel@lists.fedoraproject.org
To unsubscribe send an email to kernel-le...@lists.fedoraproject.org
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@lists.fedoraproject.org
Do not reply to spam on the list, report it: 
https://pagure.io/fedora-infrastructure


Re: [OS-BUILD PATCHv2 0/17] redhat: Use SPEC variable naming

2022-05-02 Thread Prarit Bhargava (via Email Bridge)
From: Prarit Bhargava on gitlab.com
https://gitlab.com/cki-project/kernel-ark/-/merge_requests/1727#note_932320137

MR commits updated due to merge conflict.  I had to rework the code for
Herton's CHANGELOG modifications, and added a cleanup commit for the tests
as well.  Successfully tested with "make dist-git-test".
___
kernel mailing list -- kernel@lists.fedoraproject.org
To unsubscribe send an email to kernel-le...@lists.fedoraproject.org
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@lists.fedoraproject.org
Do not reply to spam on the list, report it: 
https://pagure.io/fedora-infrastructure


[OS-BUILD PATCHv2 16/17] redhat/self-test/data: Cleanup data

2022-05-02 Thread Prarit Bhargava (via Email Bridge)
From: Prarit Bhargava 

redhat/self-test/data: Cleanup data

There have been some additional redhat/Makefile changes that modified
variables.  Run 'make dist-self-test-data' to clean these changes up.

Signed-off-by: Prarit Bhargava 

diff --git a/redhat/self-test/data/centos-2585cf9dfaad.el7 
b/redhat/self-test/data/centos-2585cf9dfaad.el7
index blahblah..blahblah 100644
--- a/redhat/self-test/data/centos-2585cf9dfaad.el7
+++ b/redhat/self-test/data/centos-2585cf9dfaad.el7
@@ -1,5 +1,5 @@
 .DEFAULT_GOAL=dist-cross-download 
-.SHELLSTATUS=0 
+.SHELLSTATUS=1 
 ARCHCONFIG=X86_64 
 ARCH_LIST=aarch64 ppc64le s390x x86_64 
 BUILD=6 
@@ -12,7 +12,6 @@ CROSS_RPMFLAGS=rpmbuild --define "_sourcedir 
../redhat/rpm/SOURCES" --define "_b
 CURARCH=x86_64 
 DIST=.el7 
 DISTRO=centos 
-DISTRO_BUILD=0.rc5.6 
 EARLY_YBUILD= 
 EARLY_YRELEASE= 
 FLAVOR= 
@@ -23,8 +22,8 @@ HEAD=2585cf9dfaad
 INCLUDE_FEDORA_FILES=1 
 INCLUDE_RHEL_FILES=1 
 KABIDW=../redhat/kabi-dwarf 
-KABIDW_TARBALL=../redhat/rpm/SOURCES/kernel-kabi-dw-5.16.0-0.rc5.6.tar.bz2 
-KABI_TARBALL=../redhat/rpm/SOURCES/kernel-abi-stablelists-5.16.0-0.rc5.6.tar.bz2
 
+KABIDW_TARBALL=../redhat/rpm/SOURCES/kernel-kabi-dw-5.16.0-0.rc5.6.test.tar.bz2
 
+KABI_TARBALL=../redhat/rpm/SOURCES/kernel-abi-stablelists-5.16.0-0.rc5.6.test.tar.bz2
 
 KEXTRAVERSION=.rc5 
 LANG=C 
 LOCVERFILE=../localversion 
diff --git a/redhat/self-test/data/centos-2585cf9dfaad.el7.spec 
b/redhat/self-test/data/centos-2585cf9dfaad.el7.spec
index blahblah..blahblah 100755
--- a/redhat/self-test/data/centos-2585cf9dfaad.el7.spec
+++ b/redhat/self-test/data/centos-2585cf9dfaad.el7.spec
@@ -87,8 +87,6 @@ Summary: The Linux kernel
 #  the --with-release option overrides this setting.)
 %define debugbuildsenabled 1
 
-%global distro_build 0.rc5.6
-
 %if 0%{?fedora}
 %define secure_boot_arch x86_64
 %else
@@ -828,8 +826,8 @@ Source211: Module.kabi_dup_ppc64le
 Source212: Module.kabi_dup_s390x
 Source213: Module.kabi_dup_x86_64
 
-Source300: kernel-abi-stablelists-%{specversion}-%{distro_build}.tar.bz2
-Source301: kernel-kabi-dw-%{specversion}-%{distro_build}.tar.bz2
+Source300: kernel-abi-stablelists-%{specversion}-%{pkgrelease}.tar.bz2
+Source301: kernel-kabi-dw-%{specversion}-%{pkgrelease}.tar.bz2
 
 # Sources for kernel-tools
 Source2000: cpupower.service
diff --git a/redhat/self-test/data/centos-2585cf9dfaad.fc25 
b/redhat/self-test/data/centos-2585cf9dfaad.fc25
index blahblah..blahblah 100644
--- a/redhat/self-test/data/centos-2585cf9dfaad.fc25
+++ b/redhat/self-test/data/centos-2585cf9dfaad.fc25
@@ -1,5 +1,5 @@
 .DEFAULT_GOAL=dist-cross-download 
-.SHELLSTATUS=0 
+.SHELLSTATUS=1 
 ARCHCONFIG=X86_64 
 ARCH_LIST=aarch64 ppc64le s390x x86_64 
 BUILD=6 
@@ -12,7 +12,6 @@ CROSS_RPMFLAGS=rpmbuild --define "_sourcedir 
../redhat/rpm/SOURCES" --define "_b
 CURARCH=x86_64 
 DIST=.fc25 
 DISTRO=centos 
-DISTRO_BUILD=0.rc5.6 
 EARLY_YBUILD= 
 EARLY_YRELEASE= 
 FLAVOR= 
@@ -23,8 +22,8 @@ HEAD=2585cf9dfaad
 INCLUDE_FEDORA_FILES=1 
 INCLUDE_RHEL_FILES=1 
 KABIDW=../redhat/kabi-dwarf 
-KABIDW_TARBALL=../redhat/rpm/SOURCES/kernel-kabi-dw-5.16.0-0.rc5.6.tar.bz2 
-KABI_TARBALL=../redhat/rpm/SOURCES/kernel-abi-stablelists-5.16.0-0.rc5.6.tar.bz2
 
+KABIDW_TARBALL=../redhat/rpm/SOURCES/kernel-kabi-dw-5.16.0-0.rc5.6.test.tar.bz2
 
+KABI_TARBALL=../redhat/rpm/SOURCES/kernel-abi-stablelists-5.16.0-0.rc5.6.test.tar.bz2
 
 KEXTRAVERSION=.rc5 
 LANG=C 
 LOCVERFILE=../localversion 
diff --git a/redhat/self-test/data/centos-2585cf9dfaad.fc25.spec 
b/redhat/self-test/data/centos-2585cf9dfaad.fc25.spec
index blahblah..blahblah 100755
--- a/redhat/self-test/data/centos-2585cf9dfaad.fc25.spec
+++ b/redhat/self-test/data/centos-2585cf9dfaad.fc25.spec
@@ -87,8 +87,6 @@ Summary: The Linux kernel
 #  the --with-release option overrides this setting.)
 %define debugbuildsenabled 1
 
-%global distro_build 0.rc5.6
-
 %if 0%{?fedora}
 %define secure_boot_arch x86_64
 %else
@@ -828,8 +826,8 @@ Source211: Module.kabi_dup_ppc64le
 Source212: Module.kabi_dup_s390x
 Source213: Module.kabi_dup_x86_64
 
-Source300: kernel-abi-stablelists-%{specversion}-%{distro_build}.tar.bz2
-Source301: kernel-kabi-dw-%{specversion}-%{distro_build}.tar.bz2
+Source300: kernel-abi-stablelists-%{specversion}-%{pkgrelease}.tar.bz2
+Source301: kernel-kabi-dw-%{specversion}-%{pkgrelease}.tar.bz2
 
 # Sources for kernel-tools
 Source2000: cpupower.service
diff --git a/redhat/self-test/data/centos-78e36f3b0dae.el7 
b/redhat/self-test/data/centos-78e36f3b0dae.el7
index blahblah..blahblah 100644
--- a/redhat/self-test/data/centos-78e36f3b0dae.el7
+++ b/redhat/self-test/data/centos-78e36f3b0dae.el7
@@ -12,7 +12,6 @@ CROSS_RPMFLAGS=rpmbuild --define "_sourcedir 
../redhat/rpm/SOURCES" --define "_b
 CURARCH=x86_64 
 DIST=.el7 
 DISTRO=centos 
-DISTRO_BUILD=0.rc0.78e36f3b0dae586.6 
 EARLY_YBUILD= 
 EARLY_YRELEASE= 
 FLAVOR= 
@@ -23,8 +22,8 @@ HEAD=78e36f3b0dae
 INCLUDE_FEDORA_FILES=1 
 INCLUDE_RHEL_FILES=1 
 KABIDW=../redhat/kabi-dwarf 

[OS-BUILD PATCHv2 17/17] redhat: shellcheck cleanup

2022-05-02 Thread Prarit Bhargava (via Email Bridge)
From: Prarit Bhargava 

redhat: shellcheck cleanup

Some shellcheck cleanups.

Signed-off-by: Prarit Bhargava 

diff --git a/redhat/genspec.sh b/redhat/genspec.sh
index blahblah..blahblah 100755
--- a/redhat/genspec.sh
+++ b/redhat/genspec.sh
@@ -114,7 +114,7 @@ cdate="$(LC_ALL=C date +"%a %b %d %Y")"
 cversion="[$RPMVERSION]";
 echo "* $cdate $cname $cversion" > "$clogf"
 
-git log --topo-order --no-merges -z $GIT_NOTES "$GIT_FORMAT" \
+git log --topo-order --no-merges -z "$GIT_NOTES" "$GIT_FORMAT" \
^"${UPSTREAM}" "$lasttag".. -- ':!/redhat/rhdocs' | "${0%/*}"/genlog.py 
>> "$clogf"
 
 if [ "$HIDE_REDHAT" = "1" ]; then
@@ -151,17 +151,17 @@ fi
 
 # during rh-dist-git genspec runs again and generates empty changelog
 # create empty file to avoid adding extra header to changelog
-LENGTH=$(grep "^-" $clogf | wc -l | awk '{print $1}')
+LENGTH=$(grep -c "^-" "$clogf" | awk '{print $1}')
 if [ "$LENGTH" = 0 ]; then
-   rm -f $clogf
-   touch $clogf
+   rm -f "$clogf"
+   touch "$clogf"
 fi
 
 cat "$clogf" "$SOURCES/$SPECCHANGELOG" > "$clogf.full"
 mv -f "$clogf.full" "$SOURCES/$SPECCHANGELOG"
 
 # genlog.py generates Resolves lines as well, strip these from RPM changelog
-cat "$SOURCES/$SPECCHANGELOG" | grep -v -e "^Resolves: " > $clogf.stripped
+grep -v -e "^Resolves: " "$SOURCES/$SPECCHANGELOG" > "$clogf".stripped
 
 test -f "$SOURCES/$SPECFILE" &&
sed -i -e "
diff --git a/redhat/scripts/create-tarball.sh b/redhat/scripts/create-tarball.sh
index blahblah..blahblah 100755
--- a/redhat/scripts/create-tarball.sh
+++ b/redhat/scripts/create-tarball.sh
@@ -1,5 +1,6 @@
 #!/bin/sh
 
+# shellcheck disable=SC2153
 [ "$SINGLE_TARBALL" -eq 1 ] && _GITID="$GITID" || _GITID="$MARKER"
 
 # shellcheck disable=SC1083
@@ -15,7 +16,7 @@ fi
 
 if [ -f "$TARBALL" ]; then
TARID=$(xzcat -qq "$TARBALL" | git get-tar-commit-id 2>/dev/null)
-   if [ "$_GITID" == "$TARID" ]; then
+   if [ "$_GITID" = "$TARID" ]; then
echo "$(basename "$TARBALL") unchanged..."
exit 0
fi
diff --git a/redhat/scripts/rh-dist-git.sh b/redhat/scripts/rh-dist-git.sh
index blahblah..blahblah 100755
--- a/redhat/scripts/rh-dist-git.sh
+++ b/redhat/scripts/rh-dist-git.sh
@@ -52,8 +52,8 @@ diff -X "$REDHAT"/git/dontdiff -upr "$tmpdir/$PACKAGE_NAME" 
"$REDHAT"/rpm/SOURCE
 # creating the changelog file
 
 # changelog has been created by genspec.sh, including Resolves line, just copy 
it here
-echo -e "${PACKAGE_NAME}-${RPMVERSION}\n" > $tmpdir/changelog
-awk '1;/^Resolves: /{exit};' $REDHAT/$SPECCHANGELOG >> $tmpdir/changelog
+echo -e "${PACKAGE_NAME}-${RPMVERSION}\n" > "$tmpdir"/changelog
+awk '1;/^Resolves: /{exit};' "$REDHAT"/"$SPECCHANGELOG" >> "$tmpdir"/changelog
 
 # all done
 echo "$tmpdir"
diff --git a/redhat/update_scripts.sh b/redhat/update_scripts.sh
index blahblah..blahblah 100755
--- a/redhat/update_scripts.sh
+++ b/redhat/update_scripts.sh
@@ -8,5 +8,5 @@ TARGET="$1"
 
 for i in "$RPM_SOURCE_DIR"/*."$TARGET"; do
NEW=${i%.$TARGET}
-   cp "$i" $(basename "$NEW")
+   cp "$i" "$(basename "$NEW")"
 done

--
https://gitlab.com/cki-project/kernel-ark/-/merge_requests/1727
___
kernel mailing list -- kernel@lists.fedoraproject.org
To unsubscribe send an email to kernel-le...@lists.fedoraproject.org
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@lists.fedoraproject.org
Do not reply to spam on the list, report it: 
https://pagure.io/fedora-infrastructure


[OS-BUILD PATCHv2 14/17] redhat/Makefile: Add 'duplicate' SPEC entries for user set variables

2022-05-02 Thread Prarit Bhargava (via Email Bridge)
From: Prarit Bhargava 

redhat/Makefile: Add 'duplicate' SPEC entries for user set variables

INCLUDE_FEDORA_FILES, INCLUDE_RHEL_FILES, and RELEASED_KERNEL are
specified in Makefile.variables as they can be set in userspace.

Create duplicate entries for these variables that begin with SPEC.  This
will make debugging easier and indicate that the variables are passed into
the spec file.

Signed-off-by: Prarit Bhargava 

diff --git a/redhat/Makefile b/redhat/Makefile
index blahblah..blahblah 100644
--- a/redhat/Makefile
+++ b/redhat/Makefile
@@ -26,6 +26,12 @@ ifdef SINGLE_TARBALL
 endif
 
 include Makefile.variables
+# These entries are 'duplicates' of variables specified in Makefile.variables
+# that are used in the SPEC file.  Specifying these with a SPEC prefix 
indicates
+# that the value is passed through to the spec file.
+SPECRELEASED_KERNEL=$(RELEASED_KERNEL)
+SPECINCLUDE_FEDORA_FILES=$(INCLUDE_FEDORA_FILES)
+SPECINCLUDE_RHEL_FILES=$(INCLUDE_RHEL_FILES)
 
 LANG=C
 
diff --git a/redhat/genspec.sh b/redhat/genspec.sh
index blahblah..blahblah 100755
--- a/redhat/genspec.sh
+++ b/redhat/genspec.sh
@@ -63,10 +63,10 @@ test -f "$SOURCES/$SPECFILE" &&
s/%%SPECKPATCHLEVEL%%/$SPECKPATCHLEVEL/
s/%%SPECBUILD%%/$SPECBUILD/
s/%%SPECRELEASE%%/$SPECRELEASE/
-   s/%%RELEASED_KERNEL%%/$RELEASED_KERNEL/
+   s/%%SPECRELEASED_KERNEL%%/$SPECRELEASED_KERNEL/
s/%%SPECDEBUG_BUILDS_ENABLED%%/$SPECDEBUG_BUILDS_ENABLED/
-   s/%%INCLUDE_FEDORA_FILES%%/$INCLUDE_FEDORA_FILES/
-   s/%%INCLUDE_RHEL_FILES%%/$INCLUDE_RHEL_FILES/
+   s/%%SPECINCLUDE_FEDORA_FILES%%/$SPECINCLUDE_FEDORA_FILES/
+   s/%%SPECINCLUDE_RHEL_FILES%%/$SPECINCLUDE_RHEL_FILES/
s/%%SPECPATCHLIST_CHANGELOG%%/$SPECPATCHLIST_CHANGELOG/
s/%%SPECVERSION%%/$SPECVERSION/
s/%%SPECTARFILE_RELEASE%%/$SPECTARFILE_RELEASE/" "$SOURCES/$SPECFILE"
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
@@ -4,9 +4,9 @@
 # here before the %%install macro is pre-built.
 
 # Include Fedora files
-%global include_fedora %%INCLUDE_FEDORA_FILES%%
+%global include_fedora %%SPECINCLUDE_FEDORA_FILES%%
 # Include RHEL files
-%global include_rhel %%INCLUDE_RHEL_FILES%%
+%global include_rhel %%SPECINCLUDE_RHEL_FILES%%
 # Provide Patchlist.changelog file
 %global patchlist_changelog %%SPECPATCHLIST_CHANGELOG%%
 
@@ -77,7 +77,7 @@ Summary: The Linux kernel
 #  kernel release. (This includes prepatch or "rc" releases.)
 # Set released_kernel to 0 when the upstream source tarball contains an
 #  unreleased kernel development snapshot.
-%global released_kernel %%RELEASED_KERNEL%%
+%global released_kernel %%SPECRELEASED_KERNEL%%
 
 # Set debugbuildsenabled to 1 to build separate base and debug kernels
 #  (on supported architectures). The kernel-debug-* subpackages will
diff --git a/redhat/self-test/data/centos-2585cf9dfaad.el7 
b/redhat/self-test/data/centos-2585cf9dfaad.el7
index blahblah..blahblah 100644
--- a/redhat/self-test/data/centos-2585cf9dfaad.el7
+++ b/redhat/self-test/data/centos-2585cf9dfaad.el7
@@ -56,11 +56,14 @@ SOURCES=../redhat/rpm/SOURCES
 SPECBUILD=0.rc5.6.test 
 SPECCHANGELOG=kernel.changelog-9.99 
 SPECFILE=kernel.spec 
+SPECINCLUDE_FEDORA_FILES=1 
+SPECINCLUDE_RHEL_FILES=1 
 SPECKEXTRAVERSION=-rc5 
 SPECKPATCHLEVEL=16 
 SPECKSUBLEVEL=0 
 SPECKVERSION=5 
 SPECRELEASE=0.rc5.6%{?buildid}%{?dist} 
+SPECRELEASED_KERNEL=0 
 SPECTARFILE_RELEASE=5.16.0-0.rc5.6.test 
 SPECVERSION=5.16.0 
 SRPM=../redhat/rpm/SRPMS/kernel-5.16.0-0.rc5.6.test.el7.src.rpm 
diff --git a/redhat/self-test/data/centos-2585cf9dfaad.fc25 
b/redhat/self-test/data/centos-2585cf9dfaad.fc25
index blahblah..blahblah 100644
--- a/redhat/self-test/data/centos-2585cf9dfaad.fc25
+++ b/redhat/self-test/data/centos-2585cf9dfaad.fc25
@@ -56,11 +56,14 @@ SOURCES=../redhat/rpm/SOURCES
 SPECBUILD=0.rc5.6.test 
 SPECCHANGELOG=kernel.changelog-9.99 
 SPECFILE=kernel.spec 
+SPECINCLUDE_FEDORA_FILES=1 
+SPECINCLUDE_RHEL_FILES=1 
 SPECKEXTRAVERSION=-rc5 
 SPECKPATCHLEVEL=16 
 SPECKSUBLEVEL=0 
 SPECKVERSION=5 
 SPECRELEASE=0.rc5.6%{?buildid}%{?dist} 
+SPECRELEASED_KERNEL=0 
 SPECTARFILE_RELEASE=5.16.0-0.rc5.6.test 
 SPECVERSION=5.16.0 
 SRPM=../redhat/rpm/SRPMS/kernel-5.16.0-0.rc5.6.test.fc25.src.rpm 
diff --git a/redhat/self-test/data/centos-78e36f3b0dae.el7 
b/redhat/self-test/data/centos-78e36f3b0dae.el7
index blahblah..blahblah 100644
--- a/redhat/self-test/data/centos-78e36f3b0dae.el7
+++ b/redhat/self-test/data/centos-78e36f3b0dae.el7
@@ -56,11 +56,14 @@ SOURCES=../redhat/rpm/SOURCES
 SPECBUILD=0.rc0.78e36f3b0dae586.6.test 
 SPECCHANGELOG=kernel.changelog-9.99 
 SPECFILE=kernel.spec 
+SPECINCLUDE_FEDORA_FILES=1 
+SPECINCLUDE_RHEL_FILES=1 
 SPECKEXTRAVERSION= 
 SPECKPATCHLEVEL=17 
 SPECKSUBLEVEL=0 
 SPECKVERSION=5 
 SPECRELEASE=0.rc0.78e36f3b0dae586.6%{?buildid}%{?dist} 
+SPECRELEASED_KERNEL=0 
 

[OS-BUILD PATCHv2 15/17] redhat/self-test: Add test to verify SPEC variables

2022-05-02 Thread Prarit Bhargava (via Email Bridge)
From: Prarit Bhargava 

redhat/self-test: Add test to verify SPEC variables

This test looks at the spec file variable replacement code in
redhat/genspec.sh and confirms that each variable begins with "SPEC".

Signed-off-by: Prarit Bhargava 

diff --git a/redhat/docs/makefile-changes.rst b/redhat/docs/makefile-changes.rst
index blahblah..blahblah 100644
--- a/redhat/docs/makefile-changes.rst
+++ b/redhat/docs/makefile-changes.rst
@@ -46,6 +46,12 @@ external scripts.  Variables in this file should be 
considered stable.
 Variables still may be deprecated and will follow the guidelines in
 "Deprecating variables and targets" section below.
 
+Variable Naming
+===
+
+Variables names prefixed with SPEC indicate that the variable is used
+in redhat/kernel.spec.template (see redhat/genspec.sh).
+
 Deprecating variables and targets
 =
 
diff --git a/redhat/genspec.sh b/redhat/genspec.sh
index blahblah..blahblah 100755
--- a/redhat/genspec.sh
+++ b/redhat/genspec.sh
@@ -56,6 +56,7 @@ if [ "$PATCHLIST_URL" != "none" ]; then
SPECPATCHLIST_CHANGELOG=1
 fi
 
+# self-test begin
 test -f "$SOURCES/$SPECFILE" &&
sed -i -e "
s/%%SPECBUILDID%%/$SPECBUILDID/
@@ -70,6 +71,10 @@ test -f "$SOURCES/$SPECFILE" &&
s/%%SPECPATCHLIST_CHANGELOG%%/$SPECPATCHLIST_CHANGELOG/
s/%%SPECVERSION%%/$SPECVERSION/
s/%%SPECTARFILE_RELEASE%%/$SPECTARFILE_RELEASE/" "$SOURCES/$SPECFILE"
+test -n "$RHSELFTESTDATA" && test -f "$SOURCES/$SPECFILE" && sed -i -e "
+   /%%SPECCHANGELOG%%/r $SOURCES/$SPECCHANGELOG
+   /%%SPECCHANGELOG%%/d" "$SOURCES/$SPECFILE"
+# self-test end
 
 # We depend on work splitting of BUILDOPTS
 # shellcheck disable=SC2086
@@ -84,10 +89,6 @@ done
 # rest of the script can be ignored.  See redhat/Makefile setup-source target 
for related
 # test changes.
 if [ -n "$RHSELFTESTDATA" ]; then
-   test -f "$SOURCES/$SPECFILE" &&
-   sed -i -e "
-   /%%SPECCHANGELOG%%/r $SOURCES/$SPECCHANGELOG
-   /%%SPECCHANGELOG%%/d" "$SOURCES/$SPECFILE"
exit 0
 fi
 
diff --git a/redhat/self-test/1006-verify-SPEC-variables.bats 
b/redhat/self-test/1006-verify-SPEC-variables.bats
new file mode 100644
index blahblah..blahblah 100644
--- /dev/null
+++ b/redhat/self-test/1006-verify-SPEC-variables.bats
@@ -0,0 +1,25 @@
+#!/usr/bin/env bats
+
+@test "verify SPEC variables" {
+# This test looks at the spec file variable replacement code in
+# redhat/genspec.sh and confirms that each variable begins with "SPEC".
+
+# This looks at the code and replaces each / with a new-line character, removes
+# any whitespace and entry entries beginning with valid "%%SPEC" or $"SPEC".
+# "$SOURCES" lines are also okay as it is used to point to the changelog and
+# the specfile.
+awk '/# self-test begin/, /# self-test end/' $BATS_TEST_DIRNAME/../genspec.sh 
| grep -v "^#" | tr "/" "\n" | tr -d "\"" | sed -r '/^\s*$/d' | grep -v 
"%%SPEC" | grep -v "\$SPEC" | grep -v "\$SOURCES" | while read LINE
+do
+   echo $LINE
+   case $(echo $LINE | xargs) in
+   s) ;;
+   d) ;;
+   "sed -i -e") ;;
+   *)
+   echo " "
+   echo "ERROR: Variables passed between genspec.sh and the spec 
file must begin with %%SPEC or \$SPEC."
+   exit 1
+   ;;
+   esac
+done
+}

--
https://gitlab.com/cki-project/kernel-ark/-/merge_requests/1727
___
kernel mailing list -- kernel@lists.fedoraproject.org
To unsubscribe send an email to kernel-le...@lists.fedoraproject.org
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@lists.fedoraproject.org
Do not reply to spam on the list, report it: 
https://pagure.io/fedora-infrastructure


[OS-BUILD PATCHv2 13/17] redhat/Makefile: Rename TARFILE_RELEASE to SPECTARFILE_RELEASE

2022-05-02 Thread Prarit Bhargava (via Email Bridge)
From: Prarit Bhargava 

redhat/Makefile: Rename TARFILE_RELEASE to SPECTARFILE_RELEASE

Change TARFILE_RELEASE to SPECTARFILE_RELEASE so that readers
understand it is passed into the spec file.

Rename TARFILE_RELEASE to SPECTARFILE_RELEASE.

Signed-off-by: Prarit Bhargava 

diff --git a/redhat/Makefile b/redhat/Makefile
index blahblah..blahblah 100644
--- a/redhat/Makefile
+++ b/redhat/Makefile
@@ -222,7 +222,7 @@ SRPM:=$(SRPMS)/$(PACKAGE_NAME)-$(RPMVERSION)$(DIST).src.rpm
 #
 ifeq ("$(DISTRO)", "fedora")
   SINGLE_TARBALL:=0
-  TARFILE_RELEASE:=$(UPSTREAM_TARBALL_NAME)
+  SPECTARFILE_RELEASE:=$(UPSTREAM_TARBALL_NAME)
   RHDISTGIT_BRANCH:=rawhide
   ifndef BUILD_SCRATCH_TARGET
 BUILD_SCRATCH_TARGET:=temp-ark-rhel-8-test
@@ -236,21 +236,21 @@ else ifeq ("$(DISTRO)", "centos")
   ifndef BUILD_SCRATCH_TARGET
 BUILD_SCRATCH_TARGET:=c$(RHEL_MAJOR)s-candidate
   endif
-  TARFILE_RELEASE:=$(RPMVERSION)
+  SPECTARFILE_RELEASE:=$(RPMVERSION)
 else
   SINGLE_TARBALL:=1
   RHDISTGIT_BRANCH:=rhel-$(RHEL_MAJOR).$(RHEL_MINOR).0
   ifndef BUILD_SCRATCH_TARGET
 BUILD_SCRATCH_TARGET:=rhel-$(RHEL_MAJOR).$(RHEL_MINOR).0-test-pesign
   endif
-  TARFILE_RELEASE:=$(RPMVERSION)
+  SPECTARFILE_RELEASE:=$(RPMVERSION)
 endif
 
 ifndef BUILD_TARGET
   BUILD_TARGET:=--scratch $(BUILD_SCRATCH_TARGET)
 endif
 
-TARFILE:=linux-$(TARFILE_RELEASE).tar.xz
+TARFILE:=linux-$(SPECTARFILE_RELEASE).tar.xz
 TARBALL:=$(REDHAT)/$(TARFILE)
 
 include Makefile.rhpkg
diff --git a/redhat/genspec.sh b/redhat/genspec.sh
index blahblah..blahblah 100755
--- a/redhat/genspec.sh
+++ b/redhat/genspec.sh
@@ -69,7 +69,7 @@ test -f "$SOURCES/$SPECFILE" &&
s/%%INCLUDE_RHEL_FILES%%/$INCLUDE_RHEL_FILES/
s/%%SPECPATCHLIST_CHANGELOG%%/$SPECPATCHLIST_CHANGELOG/
s/%%SPECVERSION%%/$SPECVERSION/
-   s/%%TARFILE_RELEASE%%/$TARFILE_RELEASE/" "$SOURCES/$SPECFILE"
+   s/%%SPECTARFILE_RELEASE%%/$SPECTARFILE_RELEASE/" "$SOURCES/$SPECFILE"
 
 # We depend on work splitting of BUILDOPTS
 # shellcheck disable=SC2086
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
@@ -690,7 +690,7 @@ BuildRequires: lld
 # exact git commit you can run
 #
 # xzcat -qq ${TARBALL} | git get-tar-commit-id
-Source0: linux-%%TARFILE_RELEASE%%.tar.xz
+Source0: linux-%%SPECTARFILE_RELEASE%%.tar.xz
 
 Source1: Makefile.rhelver
 
@@ -1382,8 +1382,8 @@ ApplyOptionalPatch()
   fi
 }
 
-%setup -q -n kernel-%%TARFILE_RELEASE%% -c
-mv linux-%%TARFILE_RELEASE%% linux-%{KVERREL}
+%setup -q -n kernel-%%SPECTARFILE_RELEASE%% -c
+mv linux-%%SPECTARFILE_RELEASE%% linux-%{KVERREL}
 
 cd linux-%{KVERREL}
 cp -a %{SOURCE1} .
diff --git a/redhat/scripts/create-tarball.sh b/redhat/scripts/create-tarball.sh
index blahblah..blahblah 100755
--- a/redhat/scripts/create-tarball.sh
+++ b/redhat/scripts/create-tarball.sh
@@ -27,4 +27,4 @@ trap 'rm -vf "$TARBALL"' INT
 # XZ_OPTIONS and XZ_THREADS DEPEND on word splitting, so don't disable it here:
 # shellcheck disable=SC2086
 cd ../ &&
-  git archive --prefix="linux-$TARFILE_RELEASE"/ --format=tar "$_GITID" | xz 
$XZ_OPTIONS $XZ_THREADS > "$TARBALL";
+  git archive --prefix="linux-$SPECTARFILE_RELEASE"/ --format=tar "$_GITID" | 
xz $XZ_OPTIONS $XZ_THREADS > "$TARBALL";
diff --git a/redhat/self-test/data/centos-2585cf9dfaad.el7 
b/redhat/self-test/data/centos-2585cf9dfaad.el7
index blahblah..blahblah 100644
--- a/redhat/self-test/data/centos-2585cf9dfaad.el7
+++ b/redhat/self-test/data/centos-2585cf9dfaad.el7
@@ -61,12 +61,12 @@ SPECKPATCHLEVEL=16
 SPECKSUBLEVEL=0 
 SPECKVERSION=5 
 SPECRELEASE=0.rc5.6%{?buildid}%{?dist} 
+SPECTARFILE_RELEASE=5.16.0-0.rc5.6.test 
 SPECVERSION=5.16.0 
 SRPM=../redhat/rpm/SRPMS/kernel-5.16.0-0.rc5.6.test.el7.src.rpm 
 SRPMS=../redhat/rpm/SRPMS 
 TARBALL=../redhat/linux-5.16.0-0.rc5.6.test.tar.xz 
 TARFILE=linux-5.16.0-0.rc5.6.test.tar.xz 
-TARFILE_RELEASE=5.16.0-0.rc5.6.test 
 TESTPATCH=../redhat/linux-kernel-test.patch 
 TOPDIR=.. 
 UPSTREAM_TARBALL_NAME=5.16-rc5 
diff --git a/redhat/self-test/data/centos-2585cf9dfaad.fc25 
b/redhat/self-test/data/centos-2585cf9dfaad.fc25
index blahblah..blahblah 100644
--- a/redhat/self-test/data/centos-2585cf9dfaad.fc25
+++ b/redhat/self-test/data/centos-2585cf9dfaad.fc25
@@ -61,12 +61,12 @@ SPECKPATCHLEVEL=16
 SPECKSUBLEVEL=0 
 SPECKVERSION=5 
 SPECRELEASE=0.rc5.6%{?buildid}%{?dist} 
+SPECTARFILE_RELEASE=5.16.0-0.rc5.6.test 
 SPECVERSION=5.16.0 
 SRPM=../redhat/rpm/SRPMS/kernel-5.16.0-0.rc5.6.test.fc25.src.rpm 
 SRPMS=../redhat/rpm/SRPMS 
 TARBALL=../redhat/linux-5.16.0-0.rc5.6.test.tar.xz 
 TARFILE=linux-5.16.0-0.rc5.6.test.tar.xz 
-TARFILE_RELEASE=5.16.0-0.rc5.6.test 
 TESTPATCH=../redhat/linux-kernel-test.patch 
 TOPDIR=.. 
 UPSTREAM_TARBALL_NAME=5.16-rc5 
diff --git a/redhat/self-test/data/centos-78e36f3b0dae.el7 
b/redhat/self-test/data/centos-78e36f3b0dae.el7
index blahblah..blahblah 100644
--- a/redhat/self-test/data/centos-78e36f3b0dae.el7

[OS-BUILD PATCHv2 11/17] redhat/genspec: Rename DEBUG_BUILDS_ENABLED to SPECDEBUG_BUILDS_ENABLED

2022-05-02 Thread Prarit Bhargava (via Email Bridge)
From: Prarit Bhargava 

redhat/genspec: Rename DEBUG_BUILDS_ENABLED to SPECDEBUG_BUILDS_ENABLED

Change DEBUG_BUILDS_ENABLED to SPECDEBUG_BUILDS_ENABLED so that readers
understand it is passed into the spec file.

Rename DEBUG_BUILDS_ENABLED to SPECDEBUG_BUILDS_ENABLED.

Signed-off-by: Prarit Bhargava 

diff --git a/redhat/genspec.sh b/redhat/genspec.sh
index blahblah..blahblah 100755
--- a/redhat/genspec.sh
+++ b/redhat/genspec.sh
@@ -17,10 +17,10 @@ UPSTREAM=$(git rev-parse -q --verify 
origin/"${UPSTREAM_BRANCH}" || \
 if [ "$SNAPSHOT" = 0 ]; then
# This is based off a tag on Linus's tree (e.g. v5.5 or v5.5-rc5).
# Two kernels are built, one with debug configuration and one without.
-   DEBUG_BUILDS_ENABLED=1
+   SPECDEBUG_BUILDS_ENABLED=1
 else
# All kernels are built with debug configurations.
-   DEBUG_BUILDS_ENABLED=0
+   SPECDEBUG_BUILDS_ENABLED=0
 fi
 
 if [ -n "$BUILDID" ]; then
@@ -64,7 +64,7 @@ test -f "$SOURCES/$SPECFILE" &&
s/%%SPECBUILD%%/$SPECBUILD/
s/%%SPECRELEASE%%/$SPECRELEASE/
s/%%RELEASED_KERNEL%%/$RELEASED_KERNEL/
-   s/%%DEBUG_BUILDS_ENABLED%%/$DEBUG_BUILDS_ENABLED/
+   s/%%SPECDEBUG_BUILDS_ENABLED%%/$SPECDEBUG_BUILDS_ENABLED/
s/%%INCLUDE_FEDORA_FILES%%/$INCLUDE_FEDORA_FILES/
s/%%INCLUDE_RHEL_FILES%%/$INCLUDE_RHEL_FILES/
s/%%PATCHLIST_CHANGELOG%%/$PATCHLIST_CHANGELOG/
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
@@ -85,7 +85,7 @@ Summary: The Linux kernel
 # Set debugbuildsenabled to 0 to not build a separate debug kernel, but
 #  to build the base kernel using the debug configuration. (Specifying
 #  the --with-release option overrides this setting.)
-%define debugbuildsenabled %%DEBUG_BUILDS_ENABLED%%
+%define debugbuildsenabled %%SPECDEBUG_BUILDS_ENABLED%%
 
 %if 0%{?fedora}
 %define secure_boot_arch x86_64

--
https://gitlab.com/cki-project/kernel-ark/-/merge_requests/1727
___
kernel mailing list -- kernel@lists.fedoraproject.org
To unsubscribe send an email to kernel-le...@lists.fedoraproject.org
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@lists.fedoraproject.org
Do not reply to spam on the list, report it: 
https://pagure.io/fedora-infrastructure


[OS-BUILD PATCHv2 12/17] redhat/genspec: Rename PATCHLIST_CHANGELOG to SPECPATCHLIST_CHANGELOG

2022-05-02 Thread Prarit Bhargava (via Email Bridge)
From: Prarit Bhargava 

redhat/genspec: Rename PATCHLIST_CHANGELOG to SPECPATCHLIST_CHANGELOG

Change PATCHLIST_CHANGELOG to SPECPATCHLIST_CHANGELOG so that readers
understand it is passed into the spec file.

Rename PATCHLIST_CHANGELOG to SPECPATCHLIST_CHANGELOG.

Signed-off-by: Prarit Bhargava 

diff --git a/redhat/genspec.sh b/redhat/genspec.sh
index blahblah..blahblah 100755
--- a/redhat/genspec.sh
+++ b/redhat/genspec.sh
@@ -40,7 +40,7 @@ EXCLUDE_FILES=":(exclude,top).get_maintainer.conf \
 
 # If PATCHLIST_URL is not set to "none", generate Patchlist.changelog file that
 # holds the shas and commits not included upstream and git commit url.
-PATCHLIST_CHANGELOG=0
+SPECPATCHLIST_CHANGELOG=0
 if [ "$PATCHLIST_URL" != "none" ]; then
# sed convert
#  
@@ -53,7 +53,7 @@ if [ "$PATCHLIST_URL" != "none" ]; then
git log --no-merges --pretty=oneline --no-decorate ${UPSTREAM}.. 
$EXCLUDE_FILES | \
sed "s!^\([^ ]*\)!$PATCHLIST_URL/\1\n &!; s!\$!\n!" \
> "$SOURCES"/Patchlist.changelog
-   PATCHLIST_CHANGELOG=1
+   SPECPATCHLIST_CHANGELOG=1
 fi
 
 test -f "$SOURCES/$SPECFILE" &&
@@ -67,7 +67,7 @@ test -f "$SOURCES/$SPECFILE" &&
s/%%SPECDEBUG_BUILDS_ENABLED%%/$SPECDEBUG_BUILDS_ENABLED/
s/%%INCLUDE_FEDORA_FILES%%/$INCLUDE_FEDORA_FILES/
s/%%INCLUDE_RHEL_FILES%%/$INCLUDE_RHEL_FILES/
-   s/%%PATCHLIST_CHANGELOG%%/$PATCHLIST_CHANGELOG/
+   s/%%SPECPATCHLIST_CHANGELOG%%/$SPECPATCHLIST_CHANGELOG/
s/%%SPECVERSION%%/$SPECVERSION/
s/%%TARFILE_RELEASE%%/$TARFILE_RELEASE/" "$SOURCES/$SPECFILE"
 
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
@@ -8,7 +8,7 @@
 # Include RHEL files
 %global include_rhel %%INCLUDE_RHEL_FILES%%
 # Provide Patchlist.changelog file
-%global patchlist_changelog %%PATCHLIST_CHANGELOG%%
+%global patchlist_changelog %%SPECPATCHLIST_CHANGELOG%%
 
 # Disable LTO in userspace packages.
 %global _lto_cflags %{nil}

--
https://gitlab.com/cki-project/kernel-ark/-/merge_requests/1727
___
kernel mailing list -- kernel@lists.fedoraproject.org
To unsubscribe send an email to kernel-le...@lists.fedoraproject.org
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@lists.fedoraproject.org
Do not reply to spam on the list, report it: 
https://pagure.io/fedora-infrastructure


[OS-BUILD PATCHv2 8/17] redhat/Makefile: Rename CHANGELOG to SPECCHANGELOG

2022-05-02 Thread Prarit Bhargava (via Email Bridge)
From: Prarit Bhargava 

redhat/Makefile: Rename CHANGELOG to SPECCHANGELOG

Change CHANGELOG to SPECCHANGELOG so that readers understand it is passed
into the spec file.  While the CHANGELOG does have use other than in the
spec file it is useful to know that the string is used in the spec file.

Rename CHANGELOG to SPECKCHANGELOG.

Signed-off-by: Prarit Bhargava 

diff --git a/redhat/Makefile b/redhat/Makefile
index blahblah..blahblah 100644
--- a/redhat/Makefile
+++ b/redhat/Makefile
@@ -69,7 +69,7 @@ RPM:=$(REDHAT)/rpm
 SRPMS:=$(RPM)/SRPMS
 SOURCES:=$(RPM)/SOURCES
 TESTPATCH:=$(REDHAT)/linux-kernel-test.patch
-CHANGELOG:=$(PACKAGE_NAME).changelog-$(RHEL_MAJOR).$(RHEL_MINOR)
+SPECCHANGELOG:=$(PACKAGE_NAME).changelog-$(RHEL_MAJOR).$(RHEL_MINOR)
 CHANGELOG_PREV:=$(PACKAGE_NAME).changelog-$(RHEL_MAJOR).$(shell expr 
$(RHEL_MINOR) - 1)
 ARCH_LIST=aarch64 ppc64le s390x x86_64
 
@@ -462,14 +462,14 @@ dist-buildreq-check: setup-source
 
 setup-source: dist-git-version-check dist-clean-sources
@cp $(REDHAT)/$(SPECFILE).template $(SOURCES)/$(SPECFILE)
-   @if [ ! -e  $(REDHAT)/$(CHANGELOG) ]; then \
-   echo "Creating $(CHANGELOG) as copy of $(CHANGELOG_PREV)"; \
-   cp $(REDHAT)/$(CHANGELOG_PREV) $(REDHAT)/$(CHANGELOG); \
+   @if [ ! -e  $(REDHAT)/$(SPECCHANGELOG) ]; then \
+   echo "Creating $(SPECCHANGELOG) as copy of $(CHANGELOG_PREV)"; \
+   cp $(REDHAT)/$(CHANGELOG_PREV) $(REDHAT)/$(SPECCHANGELOG); \
fi
@if [ -z "$(RHSELFTESTDATA)" ]; then \
-   cp $(REDHAT)/$(CHANGELOG) $(SOURCES)/$(CHANGELOG); \
+   cp $(REDHAT)/$(SPECCHANGELOG) $(SOURCES)/$(SPECCHANGELOG); \
else \
-   echo "Mon Mar 28 2022 Fedora Kernel Team 
 [$(RPMVERSION)]" > $(SOURCES)/$(CHANGELOG); \
+   echo "Mon Mar 28 2022 Fedora Kernel Team 
 [$(RPMVERSION)]" > $(SOURCES)/$(SPECCHANGELOG); 
\
fi
@if [ -z "$(PATCHLIST_URL)" ]; then \
echo "Error: PATCHLIST_URL must be set (to 'none' or any URL)"; 
\
@@ -568,19 +568,19 @@ dist-rpm-baseonly: dist-sources do-rpmbuild
 
 # unless you know what you're doing, you don't want to use the next four ones
 dist-release-finish: setup-source
-   @cp $(SOURCES)/$(CHANGELOG) $(REDHAT)/$(CHANGELOG)
-   @$(GIT) add $(REDHAT)/$(CHANGELOG)
+   @cp $(SOURCES)/$(SPECCHANGELOG) $(REDHAT)/$(SPECCHANGELOG)
+   @$(GIT) add $(REDHAT)/$(SPECCHANGELOG)
@$(GIT) add $(REDHAT)/marker
-   @$(GIT) commit -s ../Makefile.rhelver $(REDHAT)/marker 
$(REDHAT)/$(CHANGELOG) $(PACKAGE_NAME).spec.template -m "[redhat] 
$(PACKAGE_NAME)-$(RPMVERSION)"
+   @$(GIT) commit -s ../Makefile.rhelver $(REDHAT)/marker 
$(REDHAT)/$(SPECCHANGELOG) $(PACKAGE_NAME).spec.template -m "[redhat] 
$(PACKAGE_NAME)-$(RPMVERSION)"
 dist-release-changed: setup-source
-   @cp $(SOURCES)/$(CHANGELOG) $(REDHAT)/$(CHANGELOG)
+   @cp $(SOURCES)/$(SPECCHANGELOG) $(REDHAT)/$(SPECCHANGELOG)
@echo $(MARKER) > $(REDHAT)/marker
@# if neither changelog nor marker was updated, skip bumping a release
@$(GIT) update-index -q --really-refresh
@if $(GIT) diff-index --quiet HEAD; then \
echo "Nothing changed, skipping updates"; \
else \
-   $(GIT) checkout -- $(REDHAT)/$(CHANGELOG); \
+   $(GIT) checkout -- $(REDHAT)/$(SPECCHANGELOG); \
$(REDHAT)/scripts/new_release.sh $(REDHAT) $(__YSTREAM) 
$(__ZSTREAM) $(BUMP_RELEASE); \
$(MAKE) dist-release-finish; \
fi
diff --git a/redhat/genspec.sh b/redhat/genspec.sh
index blahblah..blahblah 100755
--- a/redhat/genspec.sh
+++ b/redhat/genspec.sh
@@ -85,8 +85,8 @@ done
 if [ -n "$RHSELFTESTDATA" ]; then
test -f "$SOURCES/$SPECFILE" &&
sed -i -e "
-   /%%CHANGELOG%%/r $SOURCES/$CHANGELOG
-   /%%CHANGELOG%%/d" "$SOURCES/$SPECFILE"
+   /%%SPECCHANGELOG%%/r $SOURCES/$SPECCHANGELOG
+   /%%SPECCHANGELOG%%/d" "$SOURCES/$SPECFILE"
exit 0
 fi
 
@@ -130,7 +130,7 @@ fi
 # This means we need to zap entries that are already present in the changelog.
 if [ "$MARKER" != "$LAST_MARKER" ]; then
# awk trick to get all unique lines
-   awk '!seen[$0]++' "$SOURCES/$CHANGELOG" "$clogf" > "$clogf.unique"
+   awk '!seen[$0]++' "$SOURCES/$SPECCHANGELOG" "$clogf" > "$clogf.unique"
# sed trick to get the end of the changelog minus the line
sed -e '1,/# END OF CHANGELOG/ d' "$clogf.unique" > "$clogf.tmp"
# Add an explicit entry to indicate a rebase.
@@ -155,16 +155,16 @@ if [ "$LENGTH" = 0 ]; then
touch $clogf
 fi
 
-cat "$clogf" "$SOURCES/$CHANGELOG" > "$clogf.full"
-mv -f "$clogf.full" "$SOURCES/$CHANGELOG"
+cat "$clogf" "$SOURCES/$SPECCHANGELOG" > "$clogf.full"
+mv -f "$clogf.full" "$SOURCES/$SPECCHANGELOG"
 
 # genlog.py generates Resolves lines as well, strip these from RPM changelog
-cat "$SOURCES/$CHANGELOG" | 

[OS-BUILD PATCHv2 10/17] redhat/Makefile: Rename PKGRELEASE to SPECBUILD

2022-05-02 Thread Prarit Bhargava (via Email Bridge)
From: Prarit Bhargava 

redhat/Makefile: Rename PKGRELEASE to SPECBUILD

PKGRELEASE is a confusing variable name, and it really is the BUILD string
for the specfile.

Rename PKGRELEASE to SPECBUILD.

Signed-off-by: Prarit Bhargava 

diff --git a/redhat/Makefile b/redhat/Makefile
index blahblah..blahblah 100644
--- a/redhat/Makefile
+++ b/redhat/Makefile
@@ -208,11 +208,11 @@ else
 endif
 
 SPECVERSION:=$(SPECKVERSION).$(SPECKPATCHLEVEL).$(SPECKSUBLEVEL)
-PKGRELEASE:=$(PREBUILD)$(BUILD)$(BUILDID)
-KABI_TARBALL:=$(SOURCES)/kernel-abi-stablelists-$(SPECVERSION)-$(PKGRELEASE).tar.bz2
+SPECBUILD:=$(PREBUILD)$(BUILD)$(BUILDID)
+KABI_TARBALL:=$(SOURCES)/kernel-abi-stablelists-$(SPECVERSION)-$(SPECBUILD).tar.bz2
 KABIDW := $(REDHAT)/kabi-dwarf
-KABIDW_TARBALL:=$(SOURCES)/kernel-kabi-dw-$(SPECVERSION)-$(PKGRELEASE).tar.bz2
-RPMVERSION:=$(SPECVERSION)-$(PKGRELEASE)
+KABIDW_TARBALL:=$(SOURCES)/kernel-kabi-dw-$(SPECVERSION)-$(SPECBUILD).tar.bz2
+RPMVERSION:=$(SPECVERSION)-$(SPECBUILD)
 SPECRELEASE:=$(PREBUILD)$(BUILD)%{?buildid}%{?dist}
 SRPM:=$(SRPMS)/$(PACKAGE_NAME)-$(RPMVERSION)$(DIST).src.rpm
 
@@ -427,12 +427,12 @@ dist-tarball: $(TARBALL)
 dist-kernelrelease:
# deprecated at 5.17.0
@echo "WARNING: This target will be deprecated in a future release."
-   @echo $(PACKAGE_NAME)-$(SPECVERSION)-$(PKGRELEASE)
+   @echo $(PACKAGE_NAME)-$(SPECVERSION)-$(SPECBUILD)
 
 dist-kernelversion:
# deprecated at 5.17.0
@echo "WARNING: This target will be deprecated in a future release."
-   @echo $(SPECVERSION)-$(PKGRELEASE)
+   @echo $(SPECVERSION)-$(SPECBUILD)
 
 dist-specfile: setup-source
# deprecated at 5.17.0
@@ -622,9 +622,9 @@ dist-fedora-release-push: dist-fedora-release
 dist-vr-check:
@# builds may include a s390x+zfcpdump arch build.  UTS_RELEASE can 
only have a
@# version-release string with max 64 chars.  The version-release for 
s390x+zfcpdump
-   @# is 29 characters, leaving a maximum of 35 characters for PKGRELEASE.
-   @if [ $$(echo -n $(PKGRELEASE) | wc -c) -gt 35 ]; then \
-   echo "PKGRELEASE ($(PKGRELEASE)) is too long.  Use a shorter 
localversion (currently $(BUILDID))"; \
+   @# is 29 characters, leaving a maximum of 35 characters for SPECBUILD.
+   @if [ $$(echo -n $(SPECBUILD) | wc -c) -gt 35 ]; then \
+   echo "SPECBUILD ($(SPECBUILD)) is too long.  Use a shorter 
localversion (currently $(BUILDID))"; \
exit 1; \
fi
 
diff --git a/redhat/Makefile.variables b/redhat/Makefile.variables
index blahblah..blahblah 100644
--- a/redhat/Makefile.variables
+++ b/redhat/Makefile.variables
@@ -100,7 +100,7 @@ BUILD ?=
 
 # Builds may include a s390x+zfcpdump arch build, which results in the build
 # failing because the UTS_RELEASE field exceeded 64 chars.  This variable can
-# be set to 1 to decrease the kernel UTS_RELEASE and PKGRELEASE by 11 
characters
+# be set to 1 to decrease the kernel UTS_RELEASE and SPECBUILD by 11 characters
 # (MMDDgit).
 PREBUILD_GIT_ONLY ?=
 
diff --git a/redhat/genspec.sh b/redhat/genspec.sh
index blahblah..blahblah 100755
--- a/redhat/genspec.sh
+++ b/redhat/genspec.sh
@@ -1,4 +1,5 @@
 #!/bin/bash
+# shellcheck disable=SC2153
 
 LAST_MARKER=$(cat "${REDHAT}"/marker)
 clogf="$SOURCES/changelog"
@@ -60,7 +61,7 @@ test -f "$SOURCES/$SPECFILE" &&
s/%%SPECBUILDID%%/$SPECBUILDID/
s/%%SPECKVERSION%%/$SPECKVERSION/
s/%%SPECKPATCHLEVEL%%/$SPECKPATCHLEVEL/
-   s/%%PKGRELEASE%%/$PKGRELEASE/
+   s/%%SPECBUILD%%/$SPECBUILD/
s/%%SPECRELEASE%%/$SPECRELEASE/
s/%%RELEASED_KERNEL%%/$RELEASED_KERNEL/
s/%%DEBUG_BUILDS_ENABLED%%/$DEBUG_BUILDS_ENABLED/
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
@@ -129,7 +129,7 @@ Summary: The Linux kernel
 
 %define specversion %%SPECVERSION%%
 %define patchversion %%SPECKVERSION%%.%%SPECKPATCHLEVEL%%
-%define pkgrelease %%PKGRELEASE%%
+%define pkgrelease %%SPECBUILD%%
 
 # This is needed to do merge window version magic
 %define patchlevel %%SPECKPATCHLEVEL%%
diff --git a/redhat/self-test/data/centos-2585cf9dfaad.el7 
b/redhat/self-test/data/centos-2585cf9dfaad.el7
index blahblah..blahblah 100644
--- a/redhat/self-test/data/centos-2585cf9dfaad.el7
+++ b/redhat/self-test/data/centos-2585cf9dfaad.el7
@@ -33,7 +33,6 @@ MAKEFILE_LIST=Makefile Makefile.variables ../Makefile.rhelver 
Makefile.rhpkg Mak
 MAKEFLAGS=w -- HEAD=2585cf9dfaad DISTRO=centos DIST=.el7 RHSELFTESTDATA=1 
 MARKER=v5.16-rc5 
 MERGE_BASE=2585cf9dfaaddf00b069673f27bb3f8530e2039c 
-PKGRELEASE=0.rc5.6.test 
 PREBUILD=0.rc5. 
 PROCESS_CONFIGS_CHECK_OPTS=-n -t -c 
 PROCESS_CONFIGS_OPTS=-n -w -c 
@@ -54,6 +53,7 @@ SHELL=/bin/sh
 SINGLE_TARBALL=1 
 SNAPSHOT=0 
 SOURCES=../redhat/rpm/SOURCES 
+SPECBUILD=0.rc5.6.test 
 SPECCHANGELOG=kernel.changelog-9.99 
 SPECFILE=kernel.spec 
 

[OS-BUILD PATCHv2 9/17] redhat/genspec: Rename BUILDID_DEFINE to SPECBUILDID

2022-05-02 Thread Prarit Bhargava (via Email Bridge)
From: Prarit Bhargava 

redhat/genspec: Rename BUILDID_DEFINE to SPECBUILDID

Change BUILDID_DEFINE to SPECBUILDID so that readers understand it is passed
into the spec file.

Rename BUILDID_DEFINE to SPECBUILDID.

Signed-off-by: Prarit Bhargava 

diff --git a/redhat/genspec.sh b/redhat/genspec.sh
index blahblah..blahblah 100755
--- a/redhat/genspec.sh
+++ b/redhat/genspec.sh
@@ -23,9 +23,9 @@ else
 fi
 
 if [ -n "$BUILDID" ]; then
-   BUILDID_DEFINE=$(printf "%%define buildid %s" "$BUILDID")
+   SPECBUILDID=$(printf "%%define buildid %s" "$BUILDID")
 else
-   BUILDID_DEFINE="# define buildid .local"
+   SPECBUILDID="# define buildid .local"
 fi
 
 EXCLUDE_FILES=":(exclude,top).get_maintainer.conf \
@@ -57,7 +57,7 @@ fi
 
 test -f "$SOURCES/$SPECFILE" &&
sed -i -e "
-   s/%%BUILDID%%/$BUILDID_DEFINE/
+   s/%%SPECBUILDID%%/$SPECBUILDID/
s/%%SPECKVERSION%%/$SPECKVERSION/
s/%%SPECKPATCHLEVEL%%/$SPECKPATCHLEVEL/
s/%%PKGRELEASE%%/$PKGRELEASE/
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
@@ -115,7 +115,7 @@ Summary: The Linux kernel
 # for parallel xz processes, replace with 1 to go back to single process
 %endif
 
-%%BUILDID%%
+%%SPECBUILDID%%
 
 
 %if 0%{?fedora}

--
https://gitlab.com/cki-project/kernel-ark/-/merge_requests/1727
___
kernel mailing list -- kernel@lists.fedoraproject.org
To unsubscribe send an email to kernel-le...@lists.fedoraproject.org
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@lists.fedoraproject.org
Do not reply to spam on the list, report it: 
https://pagure.io/fedora-infrastructure


[OS-BUILD PATCHv2 7/17] redhat/Makfile: Rename RPMKEXTRAVERSION to SPECKEXTRAVERSION

2022-05-02 Thread Prarit Bhargava (via Email Bridge)
From: Prarit Bhargava 

redhat/Makfile: Rename RPMKEXTRAVERSION to SPECKEXTRAVERSION

Change RPMKEXTRAVERSION to SPECEXTRAVERSION so that readers understand it is 
passed
into the spec file.

Rename RPMKEXTRAVERSION to SPECKEXTRAVERSION.

Signed-off-by: Prarit Bhargava 

diff --git a/redhat/Makefile b/redhat/Makefile
index blahblah..blahblah 100644
--- a/redhat/Makefile
+++ b/redhat/Makefile
@@ -53,7 +53,7 @@ MACH:=$(shell uname -m)
 SPECKVERSION:=$(shell $(GIT) show $(HEAD):Makefile | sed -ne '/^VERSION\ =\ 
/{s///;p;q}')
 SPECKPATCHLEVEL:=$(shell $(GIT) show $(HEAD):Makefile | sed -ne '/^PATCHLEVEL\ 
=\ /{s///;p;q}')
 SPECKSUBLEVEL:=$(shell $(GIT) show $(HEAD):Makefile | sed -ne '/^SUBLEVEL\ =\ 
/{s///;p;q}')
-RPMKEXTRAVERSION:=$(shell $(GIT) show $(HEAD):Makefile | sed -ne 
'/^EXTRAVERSION\ =\ /{s///;p;q}')
+SPECKEXTRAVERSION:=$(shell $(GIT) show $(HEAD):Makefile | sed -ne 
'/^EXTRAVERSION\ =\ /{s///;p;q}')
 GITID:= $(shell $(GIT) log --max-count=1 --pretty=format:%H $(HEAD))
 ifndef BUILD
   BUILD:=$(RHEL_RELEASE)
@@ -131,13 +131,13 @@ ifeq ("$(origin O)", "command line")
 endif
 
 # MARKER is the git tag which we base off of for exporting patches
-# Make sure MARKER uses SPECKPATCHLEVEL and RPMKEXTRAVERSION from the kernel
+# Make sure MARKER uses SPECKPATCHLEVEL and SPECKEXTRAVERSION from the kernel
 # makefile as opposed to any adjusted version for snapshotting.
-ifneq ($(RPMKEXTRAVERSION),)
-  MARKER:=v$(SPECKVERSION).$(SPECKPATCHLEVEL)$(RPMKEXTRAVERSION)
-  KEXTRAVERSION:=$(shell echo $(RPMKEXTRAVERSION) | sed -e s/-/./)
+ifneq ($(SPECKEXTRAVERSION),)
+  MARKER:=v$(SPECKVERSION).$(SPECKPATCHLEVEL)$(SPECKEXTRAVERSION)
+  KEXTRAVERSION:=$(shell echo $(SPECKEXTRAVERSION) | sed -e s/-/./)
   PREBUILD:=0$(KEXTRAVERSION).
-  UPSTREAM_TARBALL_NAME:=$(SPECKVERSION).$(SPECKPATCHLEVEL)$(RPMKEXTRAVERSION)
+  UPSTREAM_TARBALL_NAME:=$(SPECKVERSION).$(SPECKPATCHLEVEL)$(SPECKEXTRAVERSION)
 else
   KEXTRAVERSION:=
   ifeq ($(SPECKSUBLEVEL),0)
@@ -182,7 +182,7 @@ ifeq ($(VERSION_ON_UPSTREAM),1)
 # been updated but we still need something that works for
 # packaging. Fix this by bumping the patch level and marking
 # this as rc0
-ifeq ($(RPMKEXTRAVERSION),)
+ifeq ($(SPECKEXTRAVERSION),)
   KEXTRAVERSION:=.rc0
   PREBUILD:=0$(KEXTRAVERSION).
   SPECKPATCHLEVEL:=$(shell expr $(SPECKPATCHLEVEL) + 1)
diff --git a/redhat/self-test/data/centos-2585cf9dfaad.el7 
b/redhat/self-test/data/centos-2585cf9dfaad.el7
index blahblah..blahblah 100644
--- a/redhat/self-test/data/centos-2585cf9dfaad.el7
+++ b/redhat/self-test/data/centos-2585cf9dfaad.el7
@@ -50,13 +50,13 @@ RHPKG_BIN=centpkg
 RHSELFTESTDATA=1 
 RPM=../redhat/rpm 
 RPMBUILD=rpmbuild 
-RPMKEXTRAVERSION=-rc5 
 RPMVERSION=5.16.0-0.rc5.6.test 
 SHELL=/bin/sh 
 SINGLE_TARBALL=1 
 SNAPSHOT=0 
 SOURCES=../redhat/rpm/SOURCES 
 SPECFILE=kernel.spec 
+SPECKEXTRAVERSION=-rc5 
 SPECKPATCHLEVEL=16 
 SPECKSUBLEVEL=0 
 SPECKVERSION=5 
diff --git a/redhat/self-test/data/centos-2585cf9dfaad.fc25 
b/redhat/self-test/data/centos-2585cf9dfaad.fc25
index blahblah..blahblah 100644
--- a/redhat/self-test/data/centos-2585cf9dfaad.fc25
+++ b/redhat/self-test/data/centos-2585cf9dfaad.fc25
@@ -50,13 +50,13 @@ RHPKG_BIN=centpkg
 RHSELFTESTDATA=1 
 RPM=../redhat/rpm 
 RPMBUILD=rpmbuild 
-RPMKEXTRAVERSION=-rc5 
 RPMVERSION=5.16.0-0.rc5.6.test 
 SHELL=/bin/sh 
 SINGLE_TARBALL=1 
 SNAPSHOT=0 
 SOURCES=../redhat/rpm/SOURCES 
 SPECFILE=kernel.spec 
+SPECKEXTRAVERSION=-rc5 
 SPECKPATCHLEVEL=16 
 SPECKSUBLEVEL=0 
 SPECKVERSION=5 
diff --git a/redhat/self-test/data/centos-78e36f3b0dae.el7 
b/redhat/self-test/data/centos-78e36f3b0dae.el7
index blahblah..blahblah 100644
--- a/redhat/self-test/data/centos-78e36f3b0dae.el7
+++ b/redhat/self-test/data/centos-78e36f3b0dae.el7
@@ -50,13 +50,13 @@ RHPKG_BIN=centpkg
 RHSELFTESTDATA=1 
 RPM=../redhat/rpm 
 RPMBUILD=rpmbuild 
-RPMKEXTRAVERSION= 
 RPMVERSION=5.17.0-0.rc0.78e36f3b0dae586.6.test 
 SHELL=/bin/sh 
 SINGLE_TARBALL=1 
 SNAPSHOT=1 
 SOURCES=../redhat/rpm/SOURCES 
 SPECFILE=kernel.spec 
+SPECKEXTRAVERSION= 
 SPECKPATCHLEVEL=17 
 SPECKSUBLEVEL=0 
 SPECKVERSION=5 
diff --git a/redhat/self-test/data/centos-78e36f3b0dae.fc25 
b/redhat/self-test/data/centos-78e36f3b0dae.fc25
index blahblah..blahblah 100644
--- a/redhat/self-test/data/centos-78e36f3b0dae.fc25
+++ b/redhat/self-test/data/centos-78e36f3b0dae.fc25
@@ -50,13 +50,13 @@ RHPKG_BIN=centpkg
 RHSELFTESTDATA=1 
 RPM=../redhat/rpm 
 RPMBUILD=rpmbuild 
-RPMKEXTRAVERSION= 
 RPMVERSION=5.17.0-0.rc0.78e36f3b0dae586.6.test 
 SHELL=/bin/sh 
 SINGLE_TARBALL=1 
 SNAPSHOT=1 
 SOURCES=../redhat/rpm/SOURCES 
 SPECFILE=kernel.spec 
+SPECKEXTRAVERSION= 
 SPECKPATCHLEVEL=17 
 SPECKSUBLEVEL=0 
 SPECKVERSION=5 
diff --git a/redhat/self-test/data/centos-df0cc57e057f.el7 
b/redhat/self-test/data/centos-df0cc57e057f.el7
index blahblah..blahblah 100644
--- a/redhat/self-test/data/centos-df0cc57e057f.el7
+++ b/redhat/self-test/data/centos-df0cc57e057f.el7
@@ -50,13 +50,13 @@ RHPKG_BIN=centpkg
 

[OS-BUILD PATCHv2 5/17] redhat/Makfile: Rename RPMKPATCHLEVEL to SPECKPATCHLEVEL

2022-05-02 Thread Prarit Bhargava (via Email Bridge)
From: Prarit Bhargava 

redhat/Makfile: Rename RPMKPATCHLEVEL to SPECKPATCHLEVEL

Change RPMKPATCHLEVEL to SPECPATCHLEVEL so that readers understand it is passed
into the spec file.

Rename RPMKPATCHLEVEL to SPECKPATCHLEVEL.

Signed-off-by: Prarit Bhargava 

diff --git a/redhat/Makefile b/redhat/Makefile
index blahblah..blahblah 100644
--- a/redhat/Makefile
+++ b/redhat/Makefile
@@ -51,7 +51,7 @@ RPMBUILD:=$(shell if [ -x "/usr/bin/rpmbuild" ]; then echo 
rpmbuild; \
 
 MACH:=$(shell uname -m)
 SPECKVERSION:=$(shell $(GIT) show $(HEAD):Makefile | sed -ne '/^VERSION\ =\ 
/{s///;p;q}')
-RPMKPATCHLEVEL:=$(shell $(GIT) show $(HEAD):Makefile | sed -ne '/^PATCHLEVEL\ 
=\ /{s///;p;q}')
+SPECKPATCHLEVEL:=$(shell $(GIT) show $(HEAD):Makefile | sed -ne '/^PATCHLEVEL\ 
=\ /{s///;p;q}')
 RPMKSUBLEVEL:=$(shell $(GIT) show $(HEAD):Makefile | sed -ne '/^SUBLEVEL\ =\ 
/{s///;p;q}')
 RPMKEXTRAVERSION:=$(shell $(GIT) show $(HEAD):Makefile | sed -ne 
'/^EXTRAVERSION\ =\ /{s///;p;q}')
 GITID:= $(shell $(GIT) log --max-count=1 --pretty=format:%H $(HEAD))
@@ -131,18 +131,18 @@ ifeq ("$(origin O)", "command line")
 endif
 
 # MARKER is the git tag which we base off of for exporting patches
-# Make sure MARKER uses RPMKPATCHLEVEL and RPMKEXTRAVERSION from the kernel
+# Make sure MARKER uses SPECKPATCHLEVEL and RPMKEXTRAVERSION from the kernel
 # makefile as opposed to any adjusted version for snapshotting.
 ifneq ($(RPMKEXTRAVERSION),)
-  MARKER:=v$(SPECKVERSION).$(RPMKPATCHLEVEL)$(RPMKEXTRAVERSION)
+  MARKER:=v$(SPECKVERSION).$(SPECKPATCHLEVEL)$(RPMKEXTRAVERSION)
   KEXTRAVERSION:=$(shell echo $(RPMKEXTRAVERSION) | sed -e s/-/./)
   PREBUILD:=0$(KEXTRAVERSION).
-  UPSTREAM_TARBALL_NAME:=$(SPECKVERSION).$(RPMKPATCHLEVEL)$(RPMKEXTRAVERSION)
+  UPSTREAM_TARBALL_NAME:=$(SPECKVERSION).$(SPECKPATCHLEVEL)$(RPMKEXTRAVERSION)
 else
   KEXTRAVERSION:=
   ifeq ($(RPMKSUBLEVEL),0)
-MARKER:=v$(SPECKVERSION).$(RPMKPATCHLEVEL)
-UPSTREAM_TARBALL_NAME:=$(SPECKVERSION).$(RPMKPATCHLEVEL)
+MARKER:=v$(SPECKVERSION).$(SPECKPATCHLEVEL)
+UPSTREAM_TARBALL_NAME:=$(SPECKVERSION).$(SPECKPATCHLEVEL)
   else
 # Make sure MARKER uses RPMKPATCHLEVEL and RPMKEXTRAVERSION from the kernel
 # makefile as opposed to any adjusted version for snapshotting.  IOW,
@@ -185,7 +185,7 @@ ifeq ($(VERSION_ON_UPSTREAM),1)
 ifeq ($(RPMKEXTRAVERSION),)
   KEXTRAVERSION:=.rc0
   PREBUILD:=0$(KEXTRAVERSION).
-  RPMKPATCHLEVEL:=$(shell expr $(RPMKPATCHLEVEL) + 1)
+  SPECKPATCHLEVEL:=$(shell expr $(SPECKPATCHLEVEL) + 1)
 endif
 ifndef PREBUILD_GIT_ONLY
   ifneq ($(filter $(MAKECMDGOALS),dist-git-test dist-git),)
@@ -207,7 +207,7 @@ else
   SNAPSHOT:=0
 endif
 
-SPECVERSION:=$(SPECKVERSION).$(RPMKPATCHLEVEL).$(RPMKSUBLEVEL)
+SPECVERSION:=$(SPECKVERSION).$(SPECKPATCHLEVEL).$(RPMKSUBLEVEL)
 PKGRELEASE:=$(PREBUILD)$(BUILD)$(BUILDID)
 
KABI_TARBALL:=$(SOURCES)/kernel-abi-stablelists-$(SPECVERSION)-$(PKGRELEASE).tar.bz2
 KABIDW := $(REDHAT)/kabi-dwarf
diff --git a/redhat/genspec.sh b/redhat/genspec.sh
index blahblah..blahblah 100755
--- a/redhat/genspec.sh
+++ b/redhat/genspec.sh
@@ -59,7 +59,7 @@ test -f "$SOURCES/$SPECFILE" &&
sed -i -e "
s/%%BUILDID%%/$BUILDID_DEFINE/
s/%%SPECKVERSION%%/$SPECKVERSION/
-   s/%%RPMKPATCHLEVEL%%/$RPMKPATCHLEVEL/
+   s/%%SPECKPATCHLEVEL%%/$SPECKPATCHLEVEL/
s/%%PKGRELEASE%%/$PKGRELEASE/
s/%%SPECRELEASE%%/$SPECRELEASE/
s/%%RELEASED_KERNEL%%/$RELEASED_KERNEL/
@@ -93,7 +93,7 @@ fi
 GIT_FORMAT="--format=- %s (%an)%n%N%n^^^NOTES-END^^^%n%b"
 GIT_NOTES="--notes=refs/notes/${RHEL_MAJOR}.${RHEL_MINOR}*"
 
-lasttag=$(git rev-list --first-parent --grep="^\[redhat\] 
kernel-${SPECKVERSION}.${RPMKPATCHLEVEL}" --max-count=1 HEAD)
+lasttag=$(git rev-list --first-parent --grep="^\[redhat\] 
kernel-${SPECKVERSION}.${SPECKPATCHLEVEL}" --max-count=1 HEAD)
 # if we didn't find the proper tag, assume this is the first release
 if [[ -z $lasttag ]]; then
 if [[ -z ${MARKER//[0-9a-f]/} ]]; then
@@ -174,12 +174,12 @@ if [ "$SINGLE_TARBALL" = 0 ]; then
# May need to preserve word splitting in EXCLUDE_FILES
# shellcheck disable=SC2086
git diff -p --no-renames --stat "$MARKER"..  $EXCLUDE_FILES \
-   > 
${SOURCES}/patch-${SPECKVERSION}.${RPMKPATCHLEVEL}-redhat.patch
+   > 
${SOURCES}/patch-${SPECKVERSION}.${SPECKPATCHLEVEL}-redhat.patch
 else
# The tarball in the SRPM contains both upstream sources and OS-specifc
# commits.  Even though this is the case, an empty file for dist-git
# compatibility is necessary.
-   touch "${SOURCES}/patch-${SPECKVERSION}.${RPMKPATCHLEVEL}"-redhat.patch
+   touch "${SOURCES}/patch-${SPECKVERSION}.${SPECKPATCHLEVEL}"-redhat.patch
 fi
 
 rm -f "$clogf"{,.stripped};
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
@@ -125,14 +125,14 @@ 

[OS-BUILD PATCHv2 4/17] redhat/Makefile: Rename RPMKVERSION to SPECKVERSION

2022-05-02 Thread Prarit Bhargava (via Email Bridge)
From: Prarit Bhargava 

redhat/Makefile: Rename RPMKVERSION to SPECKVERSION

Change RPMKVERSION to SPECVERSION so that readers understand it is passed
into the spec file.

Rename RPMKVERSION to SPECKVERSION.

Signed-off-by: Prarit Bhargava 

diff --git a/redhat/Makefile b/redhat/Makefile
index blahblah..blahblah 100644
--- a/redhat/Makefile
+++ b/redhat/Makefile
@@ -50,7 +50,7 @@ RPMBUILD:=$(shell if [ -x "/usr/bin/rpmbuild" ]; then echo 
rpmbuild; \
   else echo rpm; fi)
 
 MACH:=$(shell uname -m)
-RPMKVERSION:=$(shell $(GIT) show $(HEAD):Makefile | sed -ne '/^VERSION\ =\ 
/{s///;p;q}')
+SPECKVERSION:=$(shell $(GIT) show $(HEAD):Makefile | sed -ne '/^VERSION\ =\ 
/{s///;p;q}')
 RPMKPATCHLEVEL:=$(shell $(GIT) show $(HEAD):Makefile | sed -ne '/^PATCHLEVEL\ 
=\ /{s///;p;q}')
 RPMKSUBLEVEL:=$(shell $(GIT) show $(HEAD):Makefile | sed -ne '/^SUBLEVEL\ =\ 
/{s///;p;q}')
 RPMKEXTRAVERSION:=$(shell $(GIT) show $(HEAD):Makefile | sed -ne 
'/^EXTRAVERSION\ =\ /{s///;p;q}')
@@ -134,15 +134,15 @@ endif
 # Make sure MARKER uses RPMKPATCHLEVEL and RPMKEXTRAVERSION from the kernel
 # makefile as opposed to any adjusted version for snapshotting.
 ifneq ($(RPMKEXTRAVERSION),)
-  MARKER:=v$(RPMKVERSION).$(RPMKPATCHLEVEL)$(RPMKEXTRAVERSION)
+  MARKER:=v$(SPECKVERSION).$(RPMKPATCHLEVEL)$(RPMKEXTRAVERSION)
   KEXTRAVERSION:=$(shell echo $(RPMKEXTRAVERSION) | sed -e s/-/./)
   PREBUILD:=0$(KEXTRAVERSION).
-  UPSTREAM_TARBALL_NAME:=$(RPMKVERSION).$(RPMKPATCHLEVEL)$(RPMKEXTRAVERSION)
+  UPSTREAM_TARBALL_NAME:=$(SPECKVERSION).$(RPMKPATCHLEVEL)$(RPMKEXTRAVERSION)
 else
   KEXTRAVERSION:=
   ifeq ($(RPMKSUBLEVEL),0)
-MARKER:=v$(RPMKVERSION).$(RPMKPATCHLEVEL)
-UPSTREAM_TARBALL_NAME:=$(RPMKVERSION).$(RPMKPATCHLEVEL)
+MARKER:=v$(SPECKVERSION).$(RPMKPATCHLEVEL)
+UPSTREAM_TARBALL_NAME:=$(SPECKVERSION).$(RPMKPATCHLEVEL)
   else
 # Make sure MARKER uses RPMKPATCHLEVEL and RPMKEXTRAVERSION from the kernel
 # makefile as opposed to any adjusted version for snapshotting.  IOW,
@@ -207,7 +207,7 @@ else
   SNAPSHOT:=0
 endif
 
-SPECVERSION:=$(RPMKVERSION).$(RPMKPATCHLEVEL).$(RPMKSUBLEVEL)
+SPECVERSION:=$(SPECKVERSION).$(RPMKPATCHLEVEL).$(RPMKSUBLEVEL)
 PKGRELEASE:=$(PREBUILD)$(BUILD)$(BUILDID)
 
KABI_TARBALL:=$(SOURCES)/kernel-abi-stablelists-$(SPECVERSION)-$(PKGRELEASE).tar.bz2
 KABIDW := $(REDHAT)/kabi-dwarf
diff --git a/redhat/genspec.sh b/redhat/genspec.sh
index blahblah..blahblah 100755
--- a/redhat/genspec.sh
+++ b/redhat/genspec.sh
@@ -58,7 +58,7 @@ fi
 test -f "$SOURCES/$SPECFILE" &&
sed -i -e "
s/%%BUILDID%%/$BUILDID_DEFINE/
-   s/%%RPMKVERSION%%/$RPMKVERSION/
+   s/%%SPECKVERSION%%/$SPECKVERSION/
s/%%RPMKPATCHLEVEL%%/$RPMKPATCHLEVEL/
s/%%PKGRELEASE%%/$PKGRELEASE/
s/%%SPECRELEASE%%/$SPECRELEASE/
@@ -93,7 +93,7 @@ fi
 GIT_FORMAT="--format=- %s (%an)%n%N%n^^^NOTES-END^^^%n%b"
 GIT_NOTES="--notes=refs/notes/${RHEL_MAJOR}.${RHEL_MINOR}*"
 
-lasttag=$(git rev-list --first-parent --grep="^\[redhat\] 
kernel-${RPMKVERSION}.${RPMKPATCHLEVEL}" --max-count=1 HEAD)
+lasttag=$(git rev-list --first-parent --grep="^\[redhat\] 
kernel-${SPECKVERSION}.${RPMKPATCHLEVEL}" --max-count=1 HEAD)
 # if we didn't find the proper tag, assume this is the first release
 if [[ -z $lasttag ]]; then
 if [[ -z ${MARKER//[0-9a-f]/} ]]; then
@@ -174,12 +174,12 @@ if [ "$SINGLE_TARBALL" = 0 ]; then
# May need to preserve word splitting in EXCLUDE_FILES
# shellcheck disable=SC2086
git diff -p --no-renames --stat "$MARKER"..  $EXCLUDE_FILES \
-   > ${SOURCES}/patch-${RPMKVERSION}.${RPMKPATCHLEVEL}-redhat.patch
+   > 
${SOURCES}/patch-${SPECKVERSION}.${RPMKPATCHLEVEL}-redhat.patch
 else
# The tarball in the SRPM contains both upstream sources and OS-specifc
# commits.  Even though this is the case, an empty file for dist-git
# compatibility is necessary.
-   touch "${SOURCES}/patch-${RPMKVERSION}.${RPMKPATCHLEVEL}"-redhat.patch
+   touch "${SOURCES}/patch-${SPECKVERSION}.${RPMKPATCHLEVEL}"-redhat.patch
 fi
 
 rm -f "$clogf"{,.stripped};
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
@@ -125,10 +125,10 @@ Summary: The Linux kernel
 %endif
 
 # The kernel tarball/base version
-%define kversion %%RPMKVERSION%%.%%RPMKPATCHLEVEL%%
+%define kversion %%SPECKVERSION%%.%%RPMKPATCHLEVEL%%
 
 %define specversion %%SPECVERSION%%
-%define patchversion %%RPMKVERSION%%.%%RPMKPATCHLEVEL%%
+%define patchversion %%SPECKVERSION%%.%%RPMKPATCHLEVEL%%
 %define pkgrelease %%PKGRELEASE%%
 
 # This is needed to do merge window version magic
@@ -1355,7 +1355,7 @@ ApplyPatch()
 exit 1
   fi
   if ! grep -E "^Patch[0-9]+: $patch\$" %{_specdir}/${RPM_PACKAGE_NAME}.spec ; 
then
-if [ "${patch:0:8}" != "patch-%%RPMKVERSION%%." ] ; then
+if [ "${patch:0:8}" != "patch-%%SPECKVERSION%%." ] ; then
  

[OS-BUILD PATCHv2 6/17] redhat/Makfile: Rename RPMKSUBLEVEL to SPECKSUBLEVEL

2022-05-02 Thread Prarit Bhargava (via Email Bridge)
From: Prarit Bhargava 

redhat/Makfile: Rename RPMKSUBLEVEL to SPECKSUBLEVEL

Change RPMKSUBLEVEL to SPECSUBLEVEL so that readers understand it is passed
into the spec file.

Rename RPMKSUBLEVEL to SPECKSUBLEVEL.

Signed-off-by: Prarit Bhargava 

diff --git a/redhat/Makefile b/redhat/Makefile
index blahblah..blahblah 100644
--- a/redhat/Makefile
+++ b/redhat/Makefile
@@ -52,7 +52,7 @@ RPMBUILD:=$(shell if [ -x "/usr/bin/rpmbuild" ]; then echo 
rpmbuild; \
 MACH:=$(shell uname -m)
 SPECKVERSION:=$(shell $(GIT) show $(HEAD):Makefile | sed -ne '/^VERSION\ =\ 
/{s///;p;q}')
 SPECKPATCHLEVEL:=$(shell $(GIT) show $(HEAD):Makefile | sed -ne '/^PATCHLEVEL\ 
=\ /{s///;p;q}')
-RPMKSUBLEVEL:=$(shell $(GIT) show $(HEAD):Makefile | sed -ne '/^SUBLEVEL\ =\ 
/{s///;p;q}')
+SPECKSUBLEVEL:=$(shell $(GIT) show $(HEAD):Makefile | sed -ne '/^SUBLEVEL\ =\ 
/{s///;p;q}')
 RPMKEXTRAVERSION:=$(shell $(GIT) show $(HEAD):Makefile | sed -ne 
'/^EXTRAVERSION\ =\ /{s///;p;q}')
 GITID:= $(shell $(GIT) log --max-count=1 --pretty=format:%H $(HEAD))
 ifndef BUILD
@@ -140,7 +140,7 @@ ifneq ($(RPMKEXTRAVERSION),)
   UPSTREAM_TARBALL_NAME:=$(SPECKVERSION).$(SPECKPATCHLEVEL)$(RPMKEXTRAVERSION)
 else
   KEXTRAVERSION:=
-  ifeq ($(RPMKSUBLEVEL),0)
+  ifeq ($(SPECKSUBLEVEL),0)
 MARKER:=v$(SPECKVERSION).$(SPECKPATCHLEVEL)
 UPSTREAM_TARBALL_NAME:=$(SPECKVERSION).$(SPECKPATCHLEVEL)
   else
@@ -207,7 +207,7 @@ else
   SNAPSHOT:=0
 endif
 
-SPECVERSION:=$(SPECKVERSION).$(SPECKPATCHLEVEL).$(RPMKSUBLEVEL)
+SPECVERSION:=$(SPECKVERSION).$(SPECKPATCHLEVEL).$(SPECKSUBLEVEL)
 PKGRELEASE:=$(PREBUILD)$(BUILD)$(BUILDID)
 
KABI_TARBALL:=$(SOURCES)/kernel-abi-stablelists-$(SPECVERSION)-$(PKGRELEASE).tar.bz2
 KABIDW := $(REDHAT)/kabi-dwarf
diff --git a/redhat/self-test/data/centos-2585cf9dfaad.el7 
b/redhat/self-test/data/centos-2585cf9dfaad.el7
index blahblah..blahblah 100644
--- a/redhat/self-test/data/centos-2585cf9dfaad.el7
+++ b/redhat/self-test/data/centos-2585cf9dfaad.el7
@@ -51,7 +51,6 @@ RHSELFTESTDATA=1
 RPM=../redhat/rpm 
 RPMBUILD=rpmbuild 
 RPMKEXTRAVERSION=-rc5 
-RPMKSUBLEVEL=0 
 RPMVERSION=5.16.0-0.rc5.6.test 
 SHELL=/bin/sh 
 SINGLE_TARBALL=1 
@@ -59,6 +58,7 @@ SNAPSHOT=0
 SOURCES=../redhat/rpm/SOURCES 
 SPECFILE=kernel.spec 
 SPECKPATCHLEVEL=16 
+SPECKSUBLEVEL=0 
 SPECKVERSION=5 
 SPECRELEASE=0.rc5.6%{?buildid}%{?dist} 
 SPECVERSION=5.16.0 
diff --git a/redhat/self-test/data/centos-2585cf9dfaad.fc25 
b/redhat/self-test/data/centos-2585cf9dfaad.fc25
index blahblah..blahblah 100644
--- a/redhat/self-test/data/centos-2585cf9dfaad.fc25
+++ b/redhat/self-test/data/centos-2585cf9dfaad.fc25
@@ -51,7 +51,6 @@ RHSELFTESTDATA=1
 RPM=../redhat/rpm 
 RPMBUILD=rpmbuild 
 RPMKEXTRAVERSION=-rc5 
-RPMKSUBLEVEL=0 
 RPMVERSION=5.16.0-0.rc5.6.test 
 SHELL=/bin/sh 
 SINGLE_TARBALL=1 
@@ -59,6 +58,7 @@ SNAPSHOT=0
 SOURCES=../redhat/rpm/SOURCES 
 SPECFILE=kernel.spec 
 SPECKPATCHLEVEL=16 
+SPECKSUBLEVEL=0 
 SPECKVERSION=5 
 SPECRELEASE=0.rc5.6%{?buildid}%{?dist} 
 SPECVERSION=5.16.0 
diff --git a/redhat/self-test/data/centos-78e36f3b0dae.el7 
b/redhat/self-test/data/centos-78e36f3b0dae.el7
index blahblah..blahblah 100644
--- a/redhat/self-test/data/centos-78e36f3b0dae.el7
+++ b/redhat/self-test/data/centos-78e36f3b0dae.el7
@@ -51,7 +51,6 @@ RHSELFTESTDATA=1
 RPM=../redhat/rpm 
 RPMBUILD=rpmbuild 
 RPMKEXTRAVERSION= 
-RPMKSUBLEVEL=0 
 RPMVERSION=5.17.0-0.rc0.78e36f3b0dae586.6.test 
 SHELL=/bin/sh 
 SINGLE_TARBALL=1 
@@ -59,6 +58,7 @@ SNAPSHOT=1
 SOURCES=../redhat/rpm/SOURCES 
 SPECFILE=kernel.spec 
 SPECKPATCHLEVEL=17 
+SPECKSUBLEVEL=0 
 SPECKVERSION=5 
 SPECRELEASE=0.rc0.78e36f3b0dae586.6%{?buildid}%{?dist} 
 SPECVERSION=5.17.0 
diff --git a/redhat/self-test/data/centos-78e36f3b0dae.fc25 
b/redhat/self-test/data/centos-78e36f3b0dae.fc25
index blahblah..blahblah 100644
--- a/redhat/self-test/data/centos-78e36f3b0dae.fc25
+++ b/redhat/self-test/data/centos-78e36f3b0dae.fc25
@@ -51,7 +51,6 @@ RHSELFTESTDATA=1
 RPM=../redhat/rpm 
 RPMBUILD=rpmbuild 
 RPMKEXTRAVERSION= 
-RPMKSUBLEVEL=0 
 RPMVERSION=5.17.0-0.rc0.78e36f3b0dae586.6.test 
 SHELL=/bin/sh 
 SINGLE_TARBALL=1 
@@ -59,6 +58,7 @@ SNAPSHOT=1
 SOURCES=../redhat/rpm/SOURCES 
 SPECFILE=kernel.spec 
 SPECKPATCHLEVEL=17 
+SPECKSUBLEVEL=0 
 SPECKVERSION=5 
 SPECRELEASE=0.rc0.78e36f3b0dae586.6%{?buildid}%{?dist} 
 SPECVERSION=5.17.0 
diff --git a/redhat/self-test/data/centos-df0cc57e057f.el7 
b/redhat/self-test/data/centos-df0cc57e057f.el7
index blahblah..blahblah 100644
--- a/redhat/self-test/data/centos-df0cc57e057f.el7
+++ b/redhat/self-test/data/centos-df0cc57e057f.el7
@@ -51,7 +51,6 @@ RHSELFTESTDATA=1
 RPM=../redhat/rpm 
 RPMBUILD=rpmbuild 
 RPMKEXTRAVERSION= 
-RPMKSUBLEVEL=0 
 RPMVERSION=5.16.0-6.test 
 SHELL=/bin/sh 
 SINGLE_TARBALL=1 
@@ -59,6 +58,7 @@ SNAPSHOT=0
 SOURCES=../redhat/rpm/SOURCES 
 SPECFILE=kernel.spec 
 SPECKPATCHLEVEL=16 
+SPECKSUBLEVEL=0 
 SPECKVERSION=5 
 SPECRELEASE=6%{?buildid}%{?dist} 
 SPECVERSION=5.16.0 
diff --git a/redhat/self-test/data/centos-df0cc57e057f.fc25 

[OS-BUILD PATCHv2 3/17] redhat/Makefile: Rename KVERSION to SPECVERSION

2022-05-02 Thread Prarit Bhargava (via Email Bridge)
From: Prarit Bhargava 

redhat/Makefile: Rename KVERSION to SPECVERSION

KVERSION is passed into the spec file and is easy to confuse with the
kernel KVERSION.  Change the name to SPECVERSION so that readers
understand it is the %Version field of the specfile.

As a result RPMKSUBLEVEL can be dropped from genspec.sh.

Rename KVERSION to SPECVERSION and use it in the specfile.

Signed-off-by: Prarit Bhargava 

diff --git a/redhat/Makefile b/redhat/Makefile
index blahblah..blahblah 100644
--- a/redhat/Makefile
+++ b/redhat/Makefile
@@ -146,7 +146,7 @@ else
   else
 # Make sure MARKER uses RPMKPATCHLEVEL and RPMKEXTRAVERSION from the kernel
 # makefile as opposed to any adjusted version for snapshotting.  IOW,
-# these variables are *NOT* equivalent to the KVERSION variable.
+# these variables are *NOT* equivalent to the SPECVERSION variable.
 MARKER:=v$(RPMKVERSION).$(RPMKPATCHLEVEL).$(RPMKSUBLEVEL)
 UPSTREAM_TARBALL_NAME:=$(RPMKVERSION).$(RPMKPATCHLEVEL).$(RPMKSUBLEVEL)
   endif
@@ -207,12 +207,12 @@ else
   SNAPSHOT:=0
 endif
 
-KVERSION:=$(RPMKVERSION).$(RPMKPATCHLEVEL).$(RPMKSUBLEVEL)
+SPECVERSION:=$(RPMKVERSION).$(RPMKPATCHLEVEL).$(RPMKSUBLEVEL)
 PKGRELEASE:=$(PREBUILD)$(BUILD)$(BUILDID)
-KABI_TARBALL:=$(SOURCES)/kernel-abi-stablelists-$(KVERSION)-$(PKGRELEASE).tar.bz2
+KABI_TARBALL:=$(SOURCES)/kernel-abi-stablelists-$(SPECVERSION)-$(PKGRELEASE).tar.bz2
 KABIDW := $(REDHAT)/kabi-dwarf
-KABIDW_TARBALL:=$(SOURCES)/kernel-kabi-dw-$(KVERSION)-$(PKGRELEASE).tar.bz2
-RPMVERSION:=$(KVERSION)-$(PKGRELEASE)
+KABIDW_TARBALL:=$(SOURCES)/kernel-kabi-dw-$(SPECVERSION)-$(PKGRELEASE).tar.bz2
+RPMVERSION:=$(SPECVERSION)-$(PKGRELEASE)
 SPECRELEASE:=$(PREBUILD)$(BUILD)%{?buildid}%{?dist}
 SRPM:=$(SRPMS)/$(PACKAGE_NAME)-$(RPMVERSION)$(DIST).src.rpm
 
@@ -354,11 +354,11 @@ dist-kabi-dw-check: dist-kabi
 
 dist-configs-commit: dist-configs-prep
+@cd $(REDHAT)/configs; ./generate_all_configs.sh 1;\
-   ./process_configs.sh -z "$(KVERSION)" "$(FLAVOR)"
+   ./process_configs.sh -z "$(SPECVERSION)" "$(FLAVOR)"
 
 dist-configs: dist-configs-prep
+@cd $(REDHAT)/configs; ./generate_all_configs.sh 1;\
-   ./process_configs.sh $(PROCESS_CONFIGS_OPTS) "$(KVERSION)" ""
+   ./process_configs.sh $(PROCESS_CONFIGS_OPTS) "$(SPECVERSION)" ""
 
 dist-fedora-configs: FLAVOR = fedora
 dist-fedora-configs: dist-configs
@@ -427,12 +427,12 @@ dist-tarball: $(TARBALL)
 dist-kernelrelease:
# deprecated at 5.17.0
@echo "WARNING: This target will be deprecated in a future release."
-   @echo $(PACKAGE_NAME)-$(KVERSION)-$(PKGRELEASE)
+   @echo $(PACKAGE_NAME)-$(SPECVERSION)-$(PKGRELEASE)
 
 dist-kernelversion:
# deprecated at 5.17.0
@echo "WARNING: This target will be deprecated in a future release."
-   @echo $(KVERSION)-$(PKGRELEASE)
+   @echo $(SPECVERSION)-$(PKGRELEASE)
 
 dist-specfile: setup-source
# deprecated at 5.17.0
diff --git a/redhat/configs/generate_all_configs.sh 
b/redhat/configs/generate_all_configs.sh
index blahblah..blahblah 100755
--- a/redhat/configs/generate_all_configs.sh
+++ b/redhat/configs/generate_all_configs.sh
@@ -18,7 +18,7 @@ else
 fi
 
 for i in kernel-*-"$FLAVOR".config; do
-   NEW=kernel-"$KVERSION"-$(echo "$i" | cut -d - -f2- | sed s/-"$FLAVOR"//)
+   NEW=kernel-"$SPECVERSION"-$(echo "$i" | cut -d - -f2- | sed 
s/-"$FLAVOR"//)
#echo $NEW
mv "$i" "$NEW"
 done
diff --git a/redhat/docs/makefile-changes.rst b/redhat/docs/makefile-changes.rst
index blahblah..blahblah 100644
--- a/redhat/docs/makefile-changes.rst
+++ b/redhat/docs/makefile-changes.rst
@@ -73,4 +73,4 @@ or,
   dist-kernelversion:
 # deprecated in 5.17.0
 @echo "WARNING: This target will be removed in a later release."
-@echo $(KVERSION)-$(DISTRO_BUILD)
+@echo $(SPECVERSION)-$(DISTRO_BUILD)
diff --git a/redhat/genspec.sh b/redhat/genspec.sh
index blahblah..blahblah 100755
--- a/redhat/genspec.sh
+++ b/redhat/genspec.sh
@@ -60,7 +60,6 @@ test -f "$SOURCES/$SPECFILE" &&
s/%%BUILDID%%/$BUILDID_DEFINE/
s/%%RPMKVERSION%%/$RPMKVERSION/
s/%%RPMKPATCHLEVEL%%/$RPMKPATCHLEVEL/
-   s/%%RPMKSUBLEVEL%%/$RPMKSUBLEVEL/
s/%%PKGRELEASE%%/$PKGRELEASE/
s/%%SPECRELEASE%%/$SPECRELEASE/
s/%%RELEASED_KERNEL%%/$RELEASED_KERNEL/
@@ -68,6 +67,7 @@ test -f "$SOURCES/$SPECFILE" &&
s/%%INCLUDE_FEDORA_FILES%%/$INCLUDE_FEDORA_FILES/
s/%%INCLUDE_RHEL_FILES%%/$INCLUDE_RHEL_FILES/
s/%%PATCHLIST_CHANGELOG%%/$PATCHLIST_CHANGELOG/
+   s/%%SPECVERSION%%/$SPECVERSION/
s/%%TARFILE_RELEASE%%/$TARFILE_RELEASE/" "$SOURCES/$SPECFILE"
 
 # We depend on work splitting of BUILDOPTS
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
@@ -127,7 +127,7 @@ Summary: The Linux kernel
 # The kernel tarball/base version
 %define kversion 

[OS-BUILD PATCHv2 0/17] redhat: Use SPEC variable naming

2022-05-02 Thread Prarit Bhargava (via Email Bridge)
From: Prarit Bhargava on gitlab.com
Merge Request: https://gitlab.com/cki-project/kernel-ark/-/merge_requests/1727

Depends: https://gitlab.com/cki-project/kernel-ark/-/merge_requests/1647

One of the common complaints about the redhat Makefiles, genspec.sh, and
kernel.spec.template is that it is not possible to determine which
variables are being used in the Makefiles and which are being used in the
kernel.spec.template.

This changeset introduces a convention of prefixing all variables used in
the kernel.spec.template with SPEC so that knowledgeable readers can track
variable use and see how variable changes affect the kernel spec file.

Signed-off-by: Prarit Bhargava 

---
 redhat/configs/generate_all_configs.sh  |   2 +-
 redhat/docs/makefile-changes.rst|   8 +-
 redhat/scripts/create-tarball.sh|   5 +-
 redhat/scripts/rh-dist-git.sh   |   4 +-
 redhat/self-test/data/centos-2585cf9dfaad.el7   |  26 ++--
 redhat/self-test/data/centos-2585cf9dfaad.el7.spec  |  26 ++--
 redhat/self-test/data/centos-2585cf9dfaad.fc25  |  26 ++--
 redhat/self-test/data/centos-2585cf9dfaad.fc25.spec |  26 ++--
 redhat/self-test/data/centos-78e36f3b0dae.el7   |  24 ++--
 redhat/self-test/data/centos-78e36f3b0dae.el7.spec  |  26 ++--
 redhat/self-test/data/centos-78e36f3b0dae.fc25  |  24 ++--
 redhat/self-test/data/centos-78e36f3b0dae.fc25.spec |  26 ++--
 redhat/self-test/data/centos-df0cc57e057f.el7   |  26 ++--
 redhat/self-test/data/centos-df0cc57e057f.el7.spec  |  26 ++--
 redhat/self-test/data/centos-df0cc57e057f.fc25  |  26 ++--
 redhat/self-test/data/centos-df0cc57e057f.fc25.spec |  26 ++--
 redhat/self-test/data/centos-fce15c45d3fb.el7   |  24 ++--
 redhat/self-test/data/centos-fce15c45d3fb.el7.spec  |  26 ++--
 redhat/self-test/data/centos-fce15c45d3fb.fc25  |  24 ++--
 redhat/self-test/data/centos-fce15c45d3fb.fc25.spec |  26 ++--
 redhat/self-test/data/fedora-2585cf9dfaad.el7   |  26 ++--
 redhat/self-test/data/fedora-2585cf9dfaad.el7.spec  |  26 ++--
 redhat/self-test/data/fedora-2585cf9dfaad.fc25  |  26 ++--
 redhat/self-test/data/fedora-2585cf9dfaad.fc25.spec |  26 ++--
 redhat/self-test/data/fedora-78e36f3b0dae.el7   |  24 ++--
 redhat/self-test/data/fedora-78e36f3b0dae.el7.spec  |  26 ++--
 redhat/self-test/data/fedora-78e36f3b0dae.fc25  |  24 ++--
 redhat/self-test/data/fedora-78e36f3b0dae.fc25.spec |  26 ++--
 redhat/self-test/data/fedora-df0cc57e057f.el7   |  26 ++--
 redhat/self-test/data/fedora-df0cc57e057f.el7.spec  |  26 ++--
 redhat/self-test/data/fedora-df0cc57e057f.fc25  |  26 ++--
 redhat/self-test/data/fedora-df0cc57e057f.fc25.spec |  26 ++--
 redhat/self-test/data/fedora-fce15c45d3fb.el7   |  24 ++--
 redhat/self-test/data/fedora-fce15c45d3fb.el7.spec  |  26 ++--
 redhat/self-test/data/fedora-fce15c45d3fb.fc25  |  24 ++--
 redhat/self-test/data/fedora-fce15c45d3fb.fc25.spec |  26 ++--
 redhat/self-test/data/rhel-2585cf9dfaad.el7 |  26 ++--
 redhat/self-test/data/rhel-2585cf9dfaad.el7.spec|  26 ++--
 redhat/self-test/data/rhel-2585cf9dfaad.fc25|  26 ++--
 redhat/self-test/data/rhel-2585cf9dfaad.fc25.spec   |  26 ++--
 redhat/self-test/data/rhel-78e36f3b0dae.el7 |  24 ++--
 redhat/self-test/data/rhel-78e36f3b0dae.el7.spec|  26 ++--
 redhat/self-test/data/rhel-78e36f3b0dae.fc25|  24 ++--
 redhat/self-test/data/rhel-78e36f3b0dae.fc25.spec   |  26 ++--
 redhat/self-test/data/rhel-df0cc57e057f.el7 |  26 ++--
 redhat/self-test/data/rhel-df0cc57e057f.el7.spec|  26 ++--
 redhat/self-test/data/rhel-df0cc57e057f.fc25|  26 ++--
 redhat/self-test/data/rhel-df0cc57e057f.fc25.spec   |  26 ++--
 redhat/self-test/data/rhel-fce15c45d3fb.el7 |  24 ++--
 redhat/self-test/data/rhel-fce15c45d3fb.el7.spec|  26 ++--
 redhat/self-test/data/rhel-fce15c45d3fb.fc25|  24 ++--
 redhat/self-test/data/rhel-fce15c45d3fb.fc25.spec   |  26 ++--
 redhat/self-test/1006-verify-SPEC-variables.bats|  25 +
 redhat/Makefile |  99 
 redhat/Makefile.variables   |   2 +-
 redhat/genspec.sh   |  70 +++---
 redhat/kernel.spec.template |  54 +-
 redhat/update_scripts.sh|   2 +-
 58 files changed, 773 insertions(+), 722 deletions(-)
___
kernel mailing list -- kernel@lists.fedoraproject.org
To unsubscribe send an email to kernel-le...@lists.fedoraproject.org
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@lists.fedoraproject.org
Do not reply to spam on the list, report it: 
https://pagure.io/fedora-infrastructure


[OS-BUILD PATCHv2 1/17] redhat/Makefile: Use KVERSION

2022-05-02 Thread Prarit Bhargava (via Email Bridge)
From: Prarit Bhargava 

redhat/Makefile: Use KVERSION

Use KVERSION where appropriate in the Makefile.

Signed-off-by: Prarit Bhargava 

diff --git a/redhat/Makefile b/redhat/Makefile
index blahblah..blahblah 100644
--- a/redhat/Makefile
+++ b/redhat/Makefile
@@ -144,6 +144,9 @@ else
 MARKER:=v$(RPMKVERSION).$(RPMKPATCHLEVEL)
 UPSTREAM_TARBALL_NAME:=$(RPMKVERSION).$(RPMKPATCHLEVEL)
   else
+# Make sure MARKER uses RPMKPATCHLEVEL and RPMKEXTRAVERSION from the kernel
+# makefile as opposed to any adjusted version for snapshotting.  IOW,
+# these variables are *NOT* equivalent to the KVERSION variable.
 MARKER:=v$(RPMKVERSION).$(RPMKPATCHLEVEL).$(RPMKSUBLEVEL)
 UPSTREAM_TARBALL_NAME:=$(RPMKVERSION).$(RPMKPATCHLEVEL).$(RPMKSUBLEVEL)
   endif
@@ -209,7 +212,7 @@ PKGRELEASE:=$(PREBUILD)$(BUILD)$(BUILDID)
 
KABI_TARBALL:=$(SOURCES)/kernel-abi-stablelists-$(KVERSION)-$(PKGRELEASE).tar.bz2
 KABIDW := $(REDHAT)/kabi-dwarf
 KABIDW_TARBALL:=$(SOURCES)/kernel-kabi-dw-$(KVERSION)-$(PKGRELEASE).tar.bz2
-RPMVERSION:=$(RPMKVERSION).$(RPMKPATCHLEVEL).$(RPMKSUBLEVEL)-$(PKGRELEASE)
+RPMVERSION:=$(KVERSION)-$(PKGRELEASE)
 SPECRELEASE:=$(PREBUILD)$(BUILD)%{?buildid}%{?dist}
 SRPM:=$(SRPMS)/$(PACKAGE_NAME)-$(RPMVERSION)$(DIST).src.rpm
 

--
https://gitlab.com/cki-project/kernel-ark/-/merge_requests/1727
___
kernel mailing list -- kernel@lists.fedoraproject.org
To unsubscribe send an email to kernel-le...@lists.fedoraproject.org
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@lists.fedoraproject.org
Do not reply to spam on the list, report it: 
https://pagure.io/fedora-infrastructure


[OS-BUILD PATCHv2 2/17] redhat/Makefile: Deprecate some simple targets

2022-05-02 Thread Prarit Bhargava (via Email Bridge)
From: Prarit Bhargava 

redhat/Makefile: Deprecate some simple targets

Deprecate some simple targets.

Signed-off-by: Prarit Bhargava 

diff --git a/redhat/Makefile b/redhat/Makefile
index blahblah..blahblah 100644
--- a/redhat/Makefile
+++ b/redhat/Makefile
@@ -420,15 +420,23 @@ $(KABIDW_TARBALL):
 
 
 dist-tarball: $(TARBALL)
+   # deprecated at 5.17.0
+   @echo "WARNING: This target will be deprecated in a future release."
@echo "redhat/$(TARFILE)"
 
 dist-kernelrelease:
+   # deprecated at 5.17.0
+   @echo "WARNING: This target will be deprecated in a future release."
@echo $(PACKAGE_NAME)-$(KVERSION)-$(PKGRELEASE)
 
 dist-kernelversion:
+   # deprecated at 5.17.0
+   @echo "WARNING: This target will be deprecated in a future release."
@echo $(KVERSION)-$(PKGRELEASE)
 
 dist-specfile: setup-source
+   # deprecated at 5.17.0
+   @echo "WARNING: This target will be deprecated in a future release."
@echo $(SOURCES)/$(SPECFILE)
 
 dist-git-version-check:

--
https://gitlab.com/cki-project/kernel-ark/-/merge_requests/1727
___
kernel mailing list -- kernel@lists.fedoraproject.org
To unsubscribe send an email to kernel-le...@lists.fedoraproject.org
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@lists.fedoraproject.org
Do not reply to spam on the list, report it: 
https://pagure.io/fedora-infrastructure


[OS-BUILD PATCH 17/18] redhat/Makefile: Add RHTEST

2022-04-22 Thread Prarit Bhargava (via Email Bridge)
From: Prarit Bhargava 

redhat/Makefile: Add RHTEST

For a long time we have wanted a mechanism by which we could do a 'test
run' of Makefile targets.  Make has built-in options '-n, --just-print,
--dry-run, --recon' that can be added on the command line that allow users
to show the output for commands but not execute them.

However, as explained in the Make manual [1], Makefile lines beginning
with a '+' will still be executed if '-n' is specified.

Add a RHTEST variable that is set to 1 if '-n' (or any of the other
'dry run' parameters) is added to the make command.  Modify the scripts to
return without executing if RHTEST is set.

[1] 
https://www.gnu.org/software/automake/manual/html_node/Debugging-Make-Rules.html

Signed-off-by: Prarit Bhargava 

diff --git a/redhat/Makefile b/redhat/Makefile
index blahblah..blahblah 100644
--- a/redhat/Makefile
+++ b/redhat/Makefile
@@ -33,6 +33,12 @@ SPECRELEASED_KERNEL=$(RELEASED_KERNEL)
 SPECINCLUDE_FEDORA_FILES=$(INCLUDE_FEDORA_FILES)
 SPECINCLUDE_RHEL_FILES=$(INCLUDE_RHEL_FILES)
 
+ifneq (,$(findstring n,$(MAKEFLAGS)))
+  # Do not set RHTEST on the command line. Use the make command built-in 
options
+  # -n, --just-print, --dry-run, --recon on the command line.
+  RHTEST=1
+endif
+
 LANG=C
 
 ifndef RHSELFTESTDATA
diff --git a/redhat/configs/build_configs.sh b/redhat/configs/build_configs.sh
index blahblah..blahblah 100755
--- a/redhat/configs/build_configs.sh
+++ b/redhat/configs/build_configs.sh
@@ -4,6 +4,8 @@
 # and debug to form the necessary 
$PACKAGE_NAME--.config
 # files for building RHEL kernels, based on the contents of a control file
 
+test -n "$RHTEST" && exit 0
+
 PACKAGE_NAME="${1:-kernel}" # defines the package name used
 if [ -z "$2" ]; then
cat flavors > .flavors
diff --git a/redhat/configs/generate_all_configs.sh 
b/redhat/configs/generate_all_configs.sh
index blahblah..blahblah 100755
--- a/redhat/configs/generate_all_configs.sh
+++ b/redhat/configs/generate_all_configs.sh
@@ -2,6 +2,8 @@
 
 # Adjusts the configuration options to build the variants correctly
 
+test -n "$RHTEST" && exit 0
+
 DEBUGBUILDSENABLED=$1
 if [ -z "$DEBUGBUILDSENABLED" ]; then
exit 1
diff --git a/redhat/configs/process_configs.sh 
b/redhat/configs/process_configs.sh
index blahblah..blahblah 100755
--- a/redhat/configs/process_configs.sh
+++ b/redhat/configs/process_configs.sh
@@ -6,6 +6,8 @@
 # Globally disable suggestion of appending '|| exit' or '|| return' to 
cd/pushd/popd commands
 # shellcheck disable=SC2164
 
+test -n "$RHTEST" && exit 0
+
 usage()
 {
# alphabetical order please

--
https://gitlab.com/cki-project/kernel-ark/-/merge_requests/1728
___
kernel mailing list -- kernel@lists.fedoraproject.org
To unsubscribe send an email to kernel-le...@lists.fedoraproject.org
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@lists.fedoraproject.org
Do not reply to spam on the list, report it: 
https://pagure.io/fedora-infrastructure


[OS-BUILD PATCH 12/18] redhat/genspec: Rename DEBUG_BUILDS_ENABLED to SPECDEBUG_BUILDS_ENABLED

2022-04-22 Thread Prarit Bhargava (via Email Bridge)
From: Prarit Bhargava 

redhat/genspec: Rename DEBUG_BUILDS_ENABLED to SPECDEBUG_BUILDS_ENABLED

Change DEBUG_BUILDS_ENABLED to SPECDEBUG_BUILDS_ENABLED so that readers
understand it is passed into the spec file.

Rename DEBUG_BUILDS_ENABLED to SPECDEBUG_BUILDS_ENABLED.

Signed-off-by: Prarit Bhargava 

diff --git a/redhat/genspec.sh b/redhat/genspec.sh
index blahblah..blahblah 100755
--- a/redhat/genspec.sh
+++ b/redhat/genspec.sh
@@ -17,10 +17,10 @@ UPSTREAM=$(git rev-parse -q --verify 
origin/"${UPSTREAM_BRANCH}" || \
 if [ "$SNAPSHOT" = 0 ]; then
# This is based off a tag on Linus's tree (e.g. v5.5 or v5.5-rc5).
# Two kernels are built, one with debug configuration and one without.
-   DEBUG_BUILDS_ENABLED=1
+   SPECDEBUG_BUILDS_ENABLED=1
 else
# All kernels are built with debug configurations.
-   DEBUG_BUILDS_ENABLED=0
+   SPECDEBUG_BUILDS_ENABLED=0
 fi
 
 if [ -n "$BUILDID" ]; then
@@ -67,7 +67,7 @@ test -f "$SOURCES/$SPECFILE" &&
s/%%SPECRELEASE%%/$SPECRELEASE/
s/%%SPECDISTROBUILD%%/$SPECDISTROBUILD/
s/%%RELEASED_KERNEL%%/$RELEASED_KERNEL/
-   s/%%DEBUG_BUILDS_ENABLED%%/$DEBUG_BUILDS_ENABLED/
+   s/%%SPECDEBUG_BUILDS_ENABLED%%/$SPECDEBUG_BUILDS_ENABLED/
s/%%INCLUDE_FEDORA_FILES%%/$INCLUDE_FEDORA_FILES/
s/%%INCLUDE_RHEL_FILES%%/$INCLUDE_RHEL_FILES/
s/%%PATCHLIST_CHANGELOG%%/$PATCHLIST_CHANGELOG/
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
@@ -85,7 +85,7 @@ Summary: The Linux kernel
 # Set debugbuildsenabled to 0 to not build a separate debug kernel, but
 #  to build the base kernel using the debug configuration. (Specifying
 #  the --with-release option overrides this setting.)
-%define debugbuildsenabled %%DEBUG_BUILDS_ENABLED%%
+%define debugbuildsenabled %%SPECDEBUG_BUILDS_ENABLED%%
 
 %global distro_build %%SPECDISTROBUILD%%
 

--
https://gitlab.com/cki-project/kernel-ark/-/merge_requests/1728
___
kernel mailing list -- kernel@lists.fedoraproject.org
To unsubscribe send an email to kernel-le...@lists.fedoraproject.org
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@lists.fedoraproject.org
Do not reply to spam on the list, report it: 
https://pagure.io/fedora-infrastructure


[OS-BUILD PATCH 4/18] redhat/Makefile: Rename RPMKVERSION to SPECKVERSION

2022-04-22 Thread Prarit Bhargava (via Email Bridge)
From: Prarit Bhargava 

redhat/Makefile: Rename RPMKVERSION to SPECKVERSION

Change RPMKVERSION to SPECVERSION so that readers understand it is passed
into the spec file.

Rename RPMKVERSION to SPECKVERSION.

Signed-off-by: Prarit Bhargava 

diff --git a/redhat/Makefile b/redhat/Makefile
index blahblah..blahblah 100644
--- a/redhat/Makefile
+++ b/redhat/Makefile
@@ -50,7 +50,7 @@ RPMBUILD:=$(shell if [ -x "/usr/bin/rpmbuild" ]; then echo 
rpmbuild; \
   else echo rpm; fi)
 
 MACH:=$(shell uname -m)
-RPMKVERSION:=$(shell $(GIT) show $(HEAD):Makefile | sed -ne '/^VERSION\ =\ 
/{s///;p;q}')
+SPECKVERSION:=$(shell $(GIT) show $(HEAD):Makefile | sed -ne '/^VERSION\ =\ 
/{s///;p;q}')
 RPMKPATCHLEVEL:=$(shell $(GIT) show $(HEAD):Makefile | sed -ne '/^PATCHLEVEL\ 
=\ /{s///;p;q}')
 RPMKSUBLEVEL:=$(shell $(GIT) show $(HEAD):Makefile | sed -ne '/^SUBLEVEL\ =\ 
/{s///;p;q}')
 RPMKEXTRAVERSION:=$(shell $(GIT) show $(HEAD):Makefile | sed -ne 
'/^EXTRAVERSION\ =\ /{s///;p;q}')
@@ -134,15 +134,15 @@ endif
 # Make sure MARKER uses RPMKPATCHLEVEL and RPMKEXTRAVERSION from the kernel
 # makefile as opposed to any adjusted version for snapshotting.
 ifneq ($(RPMKEXTRAVERSION),)
-  MARKER:=v$(RPMKVERSION).$(RPMKPATCHLEVEL)$(RPMKEXTRAVERSION)
+  MARKER:=v$(SPECKVERSION).$(RPMKPATCHLEVEL)$(RPMKEXTRAVERSION)
   KEXTRAVERSION:=$(shell echo $(RPMKEXTRAVERSION) | sed -e s/-/./)
   PREBUILD:=0$(KEXTRAVERSION).
-  UPSTREAM_TARBALL_NAME:=$(RPMKVERSION).$(RPMKPATCHLEVEL)$(RPMKEXTRAVERSION)
+  UPSTREAM_TARBALL_NAME:=$(SPECKVERSION).$(RPMKPATCHLEVEL)$(RPMKEXTRAVERSION)
 else
   KEXTRAVERSION:=
   ifeq ($(RPMKSUBLEVEL),0)
-MARKER:=v$(RPMKVERSION).$(RPMKPATCHLEVEL)
-UPSTREAM_TARBALL_NAME:=$(RPMKVERSION).$(RPMKPATCHLEVEL)
+MARKER:=v$(SPECKVERSION).$(RPMKPATCHLEVEL)
+UPSTREAM_TARBALL_NAME:=$(SPECKVERSION).$(RPMKPATCHLEVEL)
   else
 MARKER:=v$(SPECVERSION)
 UPSTREAM_TARBALL_NAME:=$(SPECVERSION)
@@ -204,7 +204,7 @@ else
   SNAPSHOT:=0
 endif
 
-SPECVERSION:=$(RPMKVERSION).$(RPMKPATCHLEVEL).$(RPMKSUBLEVEL)
+SPECVERSION:=$(SPECKVERSION).$(RPMKPATCHLEVEL).$(RPMKSUBLEVEL)
 DISTRO_BUILD:=$(PREBUILD)$(shell echo $(BUILD) | sed -e 
's|\(^[0-9]\{1,4\}\)\..*|\1|')
 
KABI_TARBALL:=$(SOURCES)/kernel-abi-stablelists-$(SPECVERSION)-$(DISTRO_BUILD).tar.bz2
 KABIDW := $(REDHAT)/kabi-dwarf
diff --git a/redhat/genspec.sh b/redhat/genspec.sh
index blahblah..blahblah 100755
--- a/redhat/genspec.sh
+++ b/redhat/genspec.sh
@@ -60,7 +60,7 @@ test -f "$SOURCES/$SPECFILE" &&
/%%CHANGELOG%%/r $SOURCES/$CHANGELOG
/%%CHANGELOG%%/d
s/%%BUILDID%%/$BUILDID_DEFINE/
-   s/%%RPMKVERSION%%/$RPMKVERSION/
+   s/%%SPECKVERSION%%/$SPECKVERSION/
s/%%RPMKPATCHLEVEL%%/$RPMKPATCHLEVEL/
s/%%PKGRELEASE%%/$PKGRELEASE/
s/%%SPECRELEASE%%/$SPECRELEASE/
@@ -89,7 +89,7 @@ done
 
 echo > "$clogf"
 
-lasttag=$(git rev-list --first-parent --grep="^\[redhat\] 
kernel-${RPMKVERSION}.${RPMKPATCHLEVEL}" --max-count=1 HEAD)
+lasttag=$(git rev-list --first-parent --grep="^\[redhat\] 
kernel-${SPECKVERSION}.${RPMKPATCHLEVEL}" --max-count=1 HEAD)
 # if we didn't find the proper tag, assume this is the first release
 if [[ -z $lasttag ]]; then
 if [[ -z ${MARKER//[0-9a-f]/} ]]; then
@@ -168,12 +168,12 @@ if [ "$SINGLE_TARBALL" = 0 ]; then
# May need to preserve word splitting in EXCLUDE_FILES
# shellcheck disable=SC2086
git diff -p --no-renames --stat "$MARKER"..  $EXCLUDE_FILES \
-   > ${SOURCES}/patch-${RPMKVERSION}.${RPMKPATCHLEVEL}-redhat.patch
+   > 
${SOURCES}/patch-${SPECKVERSION}.${RPMKPATCHLEVEL}-redhat.patch
 else
# The tarball in the SRPM contains both upstream sources and OS-specifc
# commits.  Even though this is the case, an empty file for dist-git
# compatibility is necessary.
-   touch "${SOURCES}/patch-${RPMKVERSION}.${RPMKPATCHLEVEL}"-redhat.patch
+   touch "${SOURCES}/patch-${SPECKVERSION}.${RPMKPATCHLEVEL}"-redhat.patch
 fi
 
 rm -f "$clogf"{,.rev,.stripped};
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
@@ -127,10 +127,10 @@ Summary: The Linux kernel
 %endif
 
 # The kernel tarball/base version
-%define kversion %%RPMKVERSION%%.%%RPMKPATCHLEVEL%%
+%define kversion %%SPECKVERSION%%.%%RPMKPATCHLEVEL%%
 
 %define specversion %%SPECVERSION%%
-%define patchversion %%RPMKVERSION%%.%%RPMKPATCHLEVEL%%
+%define patchversion %%SPECKVERSION%%.%%RPMKPATCHLEVEL%%
 %define pkgrelease %%PKGRELEASE%%
 
 # This is needed to do merge window version magic
@@ -1357,7 +1357,7 @@ ApplyPatch()
 exit 1
   fi
   if ! grep -E "^Patch[0-9]+: $patch\$" %{_specdir}/${RPM_PACKAGE_NAME}.spec ; 
then
-if [ "${patch:0:8}" != "patch-%%RPMKVERSION%%." ] ; then
+if [ "${patch:0:8}" != "patch-%%SPECKVERSION%%." ] ; then
   echo "ERROR: Patch  $patch  not listed as a source patch in specfile"
   exit 

[OS-BUILD PATCH 3/18] redhat/Makefile: Rename KVERSION to SPECVERSION

2022-04-22 Thread Prarit Bhargava (via Email Bridge)
From: Prarit Bhargava 

redhat/Makefile: Rename KVERSION to SPECVERSION

KVERSION is passed into the spec file and is easy to confuse with the
kernel KVERSION.  Change the name to SPECVERSION so that readers
understand it is the %Version field of the specfile.

As a result RPMKSUBLEVEL can be dropped from genspec.sh.

Rename KVERSION to SPECVERSION and use it in the specfile.

Signed-off-by: Prarit Bhargava 

diff --git a/redhat/Makefile b/redhat/Makefile
index blahblah..blahblah 100644
--- a/redhat/Makefile
+++ b/redhat/Makefile
@@ -144,8 +144,8 @@ else
 MARKER:=v$(RPMKVERSION).$(RPMKPATCHLEVEL)
 UPSTREAM_TARBALL_NAME:=$(RPMKVERSION).$(RPMKPATCHLEVEL)
   else
-MARKER:=v$(KVERSION)
-UPSTREAM_TARBALL_NAME:=$(KVERSION)
+MARKER:=v$(SPECVERSION)
+UPSTREAM_TARBALL_NAME:=$(SPECVERSION)
   endif
   PREBUILD:=
 endif
@@ -204,13 +204,13 @@ else
   SNAPSHOT:=0
 endif
 
-KVERSION:=$(RPMKVERSION).$(RPMKPATCHLEVEL).$(RPMKSUBLEVEL)
+SPECVERSION:=$(RPMKVERSION).$(RPMKPATCHLEVEL).$(RPMKSUBLEVEL)
 DISTRO_BUILD:=$(PREBUILD)$(shell echo $(BUILD) | sed -e 
's|\(^[0-9]\{1,4\}\)\..*|\1|')
-KABI_TARBALL:=$(SOURCES)/kernel-abi-stablelists-$(KVERSION)-$(DISTRO_BUILD).tar.bz2
+KABI_TARBALL:=$(SOURCES)/kernel-abi-stablelists-$(SPECVERSION)-$(DISTRO_BUILD).tar.bz2
 KABIDW := $(REDHAT)/kabi-dwarf
-KABIDW_TARBALL:=$(SOURCES)/kernel-kabi-dw-$(KVERSION)-$(DISTRO_BUILD).tar.bz2
+KABIDW_TARBALL:=$(SOURCES)/kernel-kabi-dw-$(SPECVERSION)-$(DISTRO_BUILD).tar.bz2
 PKGRELEASE:=$(PREBUILD)$(BUILD)$(BUILDID)
-RPMVERSION:=$(KVERSION)-$(PKGRELEASE)
+RPMVERSION:=$(SPECVERSION)-$(PKGRELEASE)
 SPECRELEASE:=$(PREBUILD)$(BUILD)%{?buildid}%{?dist}
 SRPM:=$(SRPMS)/$(PACKAGE_NAME)-$(RPMVERSION)$(DIST).src.rpm
 
@@ -352,11 +352,11 @@ dist-kabi-dw-check: dist-kabi
 
 dist-configs-commit: dist-configs-prep
+@cd $(REDHAT)/configs; ./generate_all_configs.sh 1;\
-   ./process_configs.sh -z "$(KVERSION)" "$(FLAVOR)"
+   ./process_configs.sh -z "$(SPECVERSION)" "$(FLAVOR)"
 
 dist-configs: dist-configs-prep
+@cd $(REDHAT)/configs; ./generate_all_configs.sh 1;\
-   ./process_configs.sh $(PROCESS_CONFIGS_OPTS) "$(KVERSION)" ""
+   ./process_configs.sh $(PROCESS_CONFIGS_OPTS) "$(SPECVERSION)" ""
 
 dist-fedora-configs: FLAVOR = fedora
 dist-fedora-configs: dist-configs
@@ -425,12 +425,12 @@ dist-tarball: $(TARBALL)
 dist-kernelrelease:
# deprecated at 5.17.0
@echo "WARNING: This target will be deprecated in a future release."
-   @echo $(PACKAGE_NAME)-$(KVERSION)-$(DISTRO_BUILD)
+   @echo $(PACKAGE_NAME)-$(SPECVERSION)-$(DISTRO_BUILD)
 
 dist-kernelversion:
# deprecated at 5.17.0
@echo "WARNING: This target will be deprecated in a future release."
-   @echo $(KVERSION)-$(DISTRO_BUILD)
+   @echo $(SPECVERSION)-$(DISTRO_BUILD)
 
 dist-specfile: setup-source
# deprecated at 5.17.0
diff --git a/redhat/configs/generate_all_configs.sh 
b/redhat/configs/generate_all_configs.sh
index blahblah..blahblah 100755
--- a/redhat/configs/generate_all_configs.sh
+++ b/redhat/configs/generate_all_configs.sh
@@ -18,7 +18,7 @@ else
 fi
 
 for i in kernel-*-"$FLAVOR".config; do
-   NEW=kernel-"$KVERSION"-$(echo "$i" | cut -d - -f2- | sed s/-"$FLAVOR"//)
+   NEW=kernel-"$SPECVERSION"-$(echo "$i" | cut -d - -f2- | sed 
s/-"$FLAVOR"//)
#echo $NEW
mv "$i" "$NEW"
 done
diff --git a/redhat/docs/makefile-changes.rst b/redhat/docs/makefile-changes.rst
index blahblah..blahblah 100644
--- a/redhat/docs/makefile-changes.rst
+++ b/redhat/docs/makefile-changes.rst
@@ -73,4 +73,4 @@ or,
   dist-kernelversion:
 # deprecated in 5.17.0
 @echo "WARNING: This target will be removed in a later release."
-@echo $(KVERSION)-$(DISTRO_BUILD)
+@echo $(SPECVERSION)-$(DISTRO_BUILD)
diff --git a/redhat/genspec.sh b/redhat/genspec.sh
index blahblah..blahblah 100755
--- a/redhat/genspec.sh
+++ b/redhat/genspec.sh
@@ -62,7 +62,6 @@ test -f "$SOURCES/$SPECFILE" &&
s/%%BUILDID%%/$BUILDID_DEFINE/
s/%%RPMKVERSION%%/$RPMKVERSION/
s/%%RPMKPATCHLEVEL%%/$RPMKPATCHLEVEL/
-   s/%%RPMKSUBLEVEL%%/$RPMKSUBLEVEL/
s/%%PKGRELEASE%%/$PKGRELEASE/
s/%%SPECRELEASE%%/$SPECRELEASE/
s/%%DISTRO_BUILD%%/$DISTRO_BUILD/
@@ -71,6 +70,7 @@ test -f "$SOURCES/$SPECFILE" &&
s/%%INCLUDE_FEDORA_FILES%%/$INCLUDE_FEDORA_FILES/
s/%%INCLUDE_RHEL_FILES%%/$INCLUDE_RHEL_FILES/
s/%%PATCHLIST_CHANGELOG%%/$PATCHLIST_CHANGELOG/
+   s/%%SPECVERSION%%/$SPECVERSION/
s/%%TARFILE_RELEASE%%/$TARFILE_RELEASE/" "$SOURCES/$SPECFILE"
 
 # We depend on work splitting of BUILDOPTS
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
@@ -129,7 +129,7 @@ Summary: The Linux kernel
 # The kernel tarball/base version
 %define kversion %%RPMKVERSION%%.%%RPMKPATCHLEVEL%%
 
-%define rpmversion 

[OS-BUILD PATCH 11/18] redhat/Makefile: Rename DISTRO_BUILD to SPECDISTROBUILD

2022-04-22 Thread Prarit Bhargava (via Email Bridge)
From: Prarit Bhargava 

redhat/Makefile: Rename DISTRO_BUILD to SPECDISTROBUILD

Change DISTRO_BUILD to SPECDISTROBUILD so that readers understand it is passed
into the spec file.

Rename DISTRO_BUILD to SPECDISTROBUILD.

Signed-off-by: Prarit Bhargava 

diff --git a/redhat/Makefile b/redhat/Makefile
index blahblah..blahblah 100644
--- a/redhat/Makefile
+++ b/redhat/Makefile
@@ -205,10 +205,10 @@ else
 endif
 
 SPECVERSION:=$(SPECKVERSION).$(SPECKPATCHLEVEL).$(SPECKSUBLEVEL)
-DISTRO_BUILD:=$(PREBUILD)$(shell echo $(BUILD) | sed -e 
's|\(^[0-9]\{1,4\}\)\..*|\1|')
-KABI_TARBALL:=$(SOURCES)/kernel-abi-stablelists-$(SPECVERSION)-$(DISTRO_BUILD).tar.bz2
+SPECDISTROBUILD:=$(PREBUILD)$(shell echo $(BUILD) | sed -e 
's|\(^[0-9]\{1,4\}\)\..*|\1|')
+KABI_TARBALL:=$(SOURCES)/kernel-abi-stablelists-$(SPECVERSION)-$(SPECDISTROBUILD).tar.bz2
 KABIDW := $(REDHAT)/kabi-dwarf
-KABIDW_TARBALL:=$(SOURCES)/kernel-kabi-dw-$(SPECVERSION)-$(DISTRO_BUILD).tar.bz2
+KABIDW_TARBALL:=$(SOURCES)/kernel-kabi-dw-$(SPECVERSION)-$(SPECDISTROBUILD).tar.bz2
 SPECBUILD:=$(PREBUILD)$(BUILD)$(BUILDID)
 RPMVERSION:=$(SPECVERSION)-$(SPECBUILD)
 SPECRELEASE:=$(PREBUILD)$(BUILD)%{?buildid}%{?dist}
@@ -425,12 +425,12 @@ dist-tarball: $(TARBALL)
 dist-kernelrelease:
# deprecated at 5.17.0
@echo "WARNING: This target will be deprecated in a future release."
-   @echo $(PACKAGE_NAME)-$(SPECVERSION)-$(DISTRO_BUILD)
+   @echo $(PACKAGE_NAME)-$(SPECVERSION)-$(SPECDISTROBUILD)
 
 dist-kernelversion:
# deprecated at 5.17.0
@echo "WARNING: This target will be deprecated in a future release."
-   @echo $(SPECVERSION)-$(DISTRO_BUILD)
+   @echo $(SPECVERSION)-$(SPECDISTROBUILD)
 
 dist-specfile: setup-source
# deprecated at 5.17.0
diff --git a/redhat/genspec.sh b/redhat/genspec.sh
index blahblah..blahblah 100755
--- a/redhat/genspec.sh
+++ b/redhat/genspec.sh
@@ -65,7 +65,7 @@ test -f "$SOURCES/$SPECFILE" &&
s/%%SPECKPATCHLEVEL%%/$SPECKPATCHLEVEL/
s/%%SPECBUILD%%/$SPECBUILD/
s/%%SPECRELEASE%%/$SPECRELEASE/
-   s/%%DISTRO_BUILD%%/$DISTRO_BUILD/
+   s/%%SPECDISTROBUILD%%/$SPECDISTROBUILD/
s/%%RELEASED_KERNEL%%/$RELEASED_KERNEL/
s/%%DEBUG_BUILDS_ENABLED%%/$DEBUG_BUILDS_ENABLED/
s/%%INCLUDE_FEDORA_FILES%%/$INCLUDE_FEDORA_FILES/
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
@@ -87,7 +87,7 @@ Summary: The Linux kernel
 #  the --with-release option overrides this setting.)
 %define debugbuildsenabled %%DEBUG_BUILDS_ENABLED%%
 
-%global distro_build %%DISTRO_BUILD%%
+%global distro_build %%SPECDISTROBUILD%%
 
 %if 0%{?fedora}
 %define secure_boot_arch x86_64
diff --git a/redhat/self-test/data/centos-2585cf9dfaad.el7 
b/redhat/self-test/data/centos-2585cf9dfaad.el7
index blahblah..blahblah 100644
--- a/redhat/self-test/data/centos-2585cf9dfaad.el7
+++ b/redhat/self-test/data/centos-2585cf9dfaad.el7
@@ -12,7 +12,6 @@ CROSS_RPMFLAGS=rpmbuild --define "_sourcedir 
../redhat/rpm/SOURCES" --define "_b
 CURARCH=x86_64 
 DIST=.el7 
 DISTRO=centos 
-DISTRO_BUILD=0.rc5.6 
 EARLY_YBUILD= 
 EARLY_YRELEASE= 
 FLAVOR= 
@@ -55,6 +54,7 @@ SNAPSHOT=0
 SOURCES=../redhat/rpm/SOURCES 
 SPECBUILD=0.rc5.6.test 
 SPECCHANGELOG=kernel.changelog-9.99 
+SPECDISTROBUILD=0.rc5.6 
 SPECFILE=kernel.spec 
 SPECKEXTRAVERSION=-rc5 
 SPECKPATCHLEVEL=16 
diff --git a/redhat/self-test/data/centos-2585cf9dfaad.fc25 
b/redhat/self-test/data/centos-2585cf9dfaad.fc25
index blahblah..blahblah 100644
--- a/redhat/self-test/data/centos-2585cf9dfaad.fc25
+++ b/redhat/self-test/data/centos-2585cf9dfaad.fc25
@@ -12,7 +12,6 @@ CROSS_RPMFLAGS=rpmbuild --define "_sourcedir 
../redhat/rpm/SOURCES" --define "_b
 CURARCH=x86_64 
 DIST=.fc25 
 DISTRO=centos 
-DISTRO_BUILD=0.rc5.6 
 EARLY_YBUILD= 
 EARLY_YRELEASE= 
 FLAVOR= 
@@ -55,6 +54,7 @@ SNAPSHOT=0
 SOURCES=../redhat/rpm/SOURCES 
 SPECBUILD=0.rc5.6.test 
 SPECCHANGELOG=kernel.changelog-9.99 
+SPECDISTROBUILD=0.rc5.6 
 SPECFILE=kernel.spec 
 SPECKEXTRAVERSION=-rc5 
 SPECKPATCHLEVEL=16 
diff --git a/redhat/self-test/data/centos-78e36f3b0dae.el7 
b/redhat/self-test/data/centos-78e36f3b0dae.el7
index blahblah..blahblah 100644
--- a/redhat/self-test/data/centos-78e36f3b0dae.el7
+++ b/redhat/self-test/data/centos-78e36f3b0dae.el7
@@ -12,7 +12,6 @@ CROSS_RPMFLAGS=rpmbuild --define "_sourcedir 
../redhat/rpm/SOURCES" --define "_b
 CURARCH=x86_64 
 DIST=.el7 
 DISTRO=centos 
-DISTRO_BUILD=0.rc0.78e36f3b0dae586.6 
 EARLY_YBUILD= 
 EARLY_YRELEASE= 
 FLAVOR= 
@@ -55,6 +54,7 @@ SNAPSHOT=1
 SOURCES=../redhat/rpm/SOURCES 
 SPECBUILD=0.rc0.78e36f3b0dae586.6.test 
 SPECCHANGELOG=kernel.changelog-9.99 
+SPECDISTROBUILD=0.rc0.78e36f3b0dae586.6 
 SPECFILE=kernel.spec 
 SPECKEXTRAVERSION= 
 SPECKPATCHLEVEL=17 
diff --git a/redhat/self-test/data/centos-78e36f3b0dae.fc25 
b/redhat/self-test/data/centos-78e36f3b0dae.fc25
index blahblah..blahblah 100644
--- 

[OS-BUILD PATCH 18/18] redhat/self-test: Add test to verify Makefile declarations.

2022-04-22 Thread Prarit Bhargava (via Email Bridge)
From: Prarit Bhargava 

redhat/self-test: Add test to verify Makefile declarations.

The Makefiles have been organized such that only Makefile.variables
contain external variables that can be set on the command line, and
the Makefile only contains variables that can set within the Makefile
itself.

Add a test to verify these Makefile declarations.

Signed-off-by: Prarit Bhargava 

diff --git a/redhat/self-test/3001-Makefile-contents.bats 
b/redhat/self-test/3001-Makefile-contents.bats
new file mode 100755
index blahblah..blahblah 100755
--- /dev/null
+++ b/redhat/self-test/3001-Makefile-contents.bats
@@ -0,0 +1,17 @@
+#!/usr/bin/env bats
+
+@test "Makefile variable declarations" {
+   # By design, only the Makefile.variables file should have ?= 
declarations
+
+   value=$(git grep "?=" Makefile.variables | wc -l)
+   if [ $value -eq 0 ]; then
+   echo "Test failed: No ?= variables found in Makefile.variables"
+   exit 1
+   fi
+
+   value=$(git grep "?=" Makefile | wc -l)
+   if [ $value -gt 0 ]; then
+   echo "Test failed: Makefile should not ?= declarations."
+   exit 1
+   fi
+}

--
https://gitlab.com/cki-project/kernel-ark/-/merge_requests/1728
___
kernel mailing list -- kernel@lists.fedoraproject.org
To unsubscribe send an email to kernel-le...@lists.fedoraproject.org
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@lists.fedoraproject.org
Do not reply to spam on the list, report it: 
https://pagure.io/fedora-infrastructure


[OS-BUILD PATCH 6/18] redhat/Makfile: Rename RPMKSUBLEVEL to SPECKSUBLEVEL

2022-04-22 Thread Prarit Bhargava (via Email Bridge)
From: Prarit Bhargava 

redhat/Makfile: Rename RPMKSUBLEVEL to SPECKSUBLEVEL

Change RPMKSUBLEVEL to SPECSUBLEVEL so that readers understand it is passed
into the spec file.

Rename RPMKSUBLEVEL to SPECKSUBLEVEL.

Signed-off-by: Prarit Bhargava 

diff --git a/redhat/Makefile b/redhat/Makefile
index blahblah..blahblah 100644
--- a/redhat/Makefile
+++ b/redhat/Makefile
@@ -52,7 +52,7 @@ RPMBUILD:=$(shell if [ -x "/usr/bin/rpmbuild" ]; then echo 
rpmbuild; \
 MACH:=$(shell uname -m)
 SPECKVERSION:=$(shell $(GIT) show $(HEAD):Makefile | sed -ne '/^VERSION\ =\ 
/{s///;p;q}')
 SPECKPATCHLEVEL:=$(shell $(GIT) show $(HEAD):Makefile | sed -ne '/^PATCHLEVEL\ 
=\ /{s///;p;q}')
-RPMKSUBLEVEL:=$(shell $(GIT) show $(HEAD):Makefile | sed -ne '/^SUBLEVEL\ =\ 
/{s///;p;q}')
+SPECKSUBLEVEL:=$(shell $(GIT) show $(HEAD):Makefile | sed -ne '/^SUBLEVEL\ =\ 
/{s///;p;q}')
 RPMKEXTRAVERSION:=$(shell $(GIT) show $(HEAD):Makefile | sed -ne 
'/^EXTRAVERSION\ =\ /{s///;p;q}')
 GITID:= $(shell $(GIT) log --max-count=1 --pretty=format:%H $(HEAD))
 ifndef BUILD
@@ -140,7 +140,7 @@ ifneq ($(RPMKEXTRAVERSION),)
   UPSTREAM_TARBALL_NAME:=$(SPECKVERSION).$(SPECKPATCHLEVEL)$(RPMKEXTRAVERSION)
 else
   KEXTRAVERSION:=
-  ifeq ($(RPMKSUBLEVEL),0)
+  ifeq ($(SPECKSUBLEVEL),0)
 MARKER:=v$(SPECKVERSION).$(SPECKPATCHLEVEL)
 UPSTREAM_TARBALL_NAME:=$(SPECKVERSION).$(SPECKPATCHLEVEL)
   else
@@ -204,7 +204,7 @@ else
   SNAPSHOT:=0
 endif
 
-SPECVERSION:=$(SPECKVERSION).$(SPECKPATCHLEVEL).$(RPMKSUBLEVEL)
+SPECVERSION:=$(SPECKVERSION).$(SPECKPATCHLEVEL).$(SPECKSUBLEVEL)
 DISTRO_BUILD:=$(PREBUILD)$(shell echo $(BUILD) | sed -e 
's|\(^[0-9]\{1,4\}\)\..*|\1|')
 
KABI_TARBALL:=$(SOURCES)/kernel-abi-stablelists-$(SPECVERSION)-$(DISTRO_BUILD).tar.bz2
 KABIDW := $(REDHAT)/kabi-dwarf
diff --git a/redhat/self-test/data/centos-2585cf9dfaad.el7 
b/redhat/self-test/data/centos-2585cf9dfaad.el7
index blahblah..blahblah 100644
--- a/redhat/self-test/data/centos-2585cf9dfaad.el7
+++ b/redhat/self-test/data/centos-2585cf9dfaad.el7
@@ -51,7 +51,6 @@ RHSELFTESTDATA=1
 RPM=../redhat/rpm 
 RPMBUILD=rpmbuild 
 RPMKEXTRAVERSION=-rc5 
-RPMKSUBLEVEL=0 
 RPMVERSION=5.16.0-0.rc5.6.test 
 SHELL=/bin/sh 
 SINGLE_TARBALL=1 
@@ -59,6 +58,7 @@ SNAPSHOT=0
 SOURCES=../redhat/rpm/SOURCES 
 SPECFILE=kernel.spec 
 SPECKPATCHLEVEL=16 
+SPECKSUBLEVEL=0 
 SPECKVERSION=5 
 SPECRELEASE=0.rc5.6%{?buildid}%{?dist} 
 SPECVERSION=5.16.0 
diff --git a/redhat/self-test/data/centos-2585cf9dfaad.fc25 
b/redhat/self-test/data/centos-2585cf9dfaad.fc25
index blahblah..blahblah 100644
--- a/redhat/self-test/data/centos-2585cf9dfaad.fc25
+++ b/redhat/self-test/data/centos-2585cf9dfaad.fc25
@@ -51,7 +51,6 @@ RHSELFTESTDATA=1
 RPM=../redhat/rpm 
 RPMBUILD=rpmbuild 
 RPMKEXTRAVERSION=-rc5 
-RPMKSUBLEVEL=0 
 RPMVERSION=5.16.0-0.rc5.6.test 
 SHELL=/bin/sh 
 SINGLE_TARBALL=1 
@@ -59,6 +58,7 @@ SNAPSHOT=0
 SOURCES=../redhat/rpm/SOURCES 
 SPECFILE=kernel.spec 
 SPECKPATCHLEVEL=16 
+SPECKSUBLEVEL=0 
 SPECKVERSION=5 
 SPECRELEASE=0.rc5.6%{?buildid}%{?dist} 
 SPECVERSION=5.16.0 
diff --git a/redhat/self-test/data/centos-78e36f3b0dae.el7 
b/redhat/self-test/data/centos-78e36f3b0dae.el7
index blahblah..blahblah 100644
--- a/redhat/self-test/data/centos-78e36f3b0dae.el7
+++ b/redhat/self-test/data/centos-78e36f3b0dae.el7
@@ -51,7 +51,6 @@ RHSELFTESTDATA=1
 RPM=../redhat/rpm 
 RPMBUILD=rpmbuild 
 RPMKEXTRAVERSION= 
-RPMKSUBLEVEL=0 
 RPMVERSION=5.17.0-0.rc0.78e36f3b0dae586.6.test 
 SHELL=/bin/sh 
 SINGLE_TARBALL=1 
@@ -59,6 +58,7 @@ SNAPSHOT=1
 SOURCES=../redhat/rpm/SOURCES 
 SPECFILE=kernel.spec 
 SPECKPATCHLEVEL=17 
+SPECKSUBLEVEL=0 
 SPECKVERSION=5 
 SPECRELEASE=0.rc0.78e36f3b0dae586.6%{?buildid}%{?dist} 
 SPECVERSION=5.17.0 
diff --git a/redhat/self-test/data/centos-78e36f3b0dae.fc25 
b/redhat/self-test/data/centos-78e36f3b0dae.fc25
index blahblah..blahblah 100644
--- a/redhat/self-test/data/centos-78e36f3b0dae.fc25
+++ b/redhat/self-test/data/centos-78e36f3b0dae.fc25
@@ -51,7 +51,6 @@ RHSELFTESTDATA=1
 RPM=../redhat/rpm 
 RPMBUILD=rpmbuild 
 RPMKEXTRAVERSION= 
-RPMKSUBLEVEL=0 
 RPMVERSION=5.17.0-0.rc0.78e36f3b0dae586.6.test 
 SHELL=/bin/sh 
 SINGLE_TARBALL=1 
@@ -59,6 +58,7 @@ SNAPSHOT=1
 SOURCES=../redhat/rpm/SOURCES 
 SPECFILE=kernel.spec 
 SPECKPATCHLEVEL=17 
+SPECKSUBLEVEL=0 
 SPECKVERSION=5 
 SPECRELEASE=0.rc0.78e36f3b0dae586.6%{?buildid}%{?dist} 
 SPECVERSION=5.17.0 
diff --git a/redhat/self-test/data/centos-df0cc57e057f.el7 
b/redhat/self-test/data/centos-df0cc57e057f.el7
index blahblah..blahblah 100644
--- a/redhat/self-test/data/centos-df0cc57e057f.el7
+++ b/redhat/self-test/data/centos-df0cc57e057f.el7
@@ -51,7 +51,6 @@ RHSELFTESTDATA=1
 RPM=../redhat/rpm 
 RPMBUILD=rpmbuild 
 RPMKEXTRAVERSION= 
-RPMKSUBLEVEL=0 
 RPMVERSION=5.16.0-6.test 
 SHELL=/bin/sh 
 SINGLE_TARBALL=1 
@@ -59,6 +58,7 @@ SNAPSHOT=0
 SOURCES=../redhat/rpm/SOURCES 
 SPECFILE=kernel.spec 
 SPECKPATCHLEVEL=16 
+SPECKSUBLEVEL=0 
 SPECKVERSION=5 
 SPECRELEASE=6%{?buildid}%{?dist} 
 SPECVERSION=5.16.0 
diff --git 

[OS-BUILD PATCH 9/18] redhat/genspec: Rename BUILDID_DEFINE to SPECBUILDID

2022-04-22 Thread Prarit Bhargava (via Email Bridge)
From: Prarit Bhargava 

redhat/genspec: Rename BUILDID_DEFINE to SPECBUILDID

Change BUILDID_DEFINE to SPECBUILDID so that readers understand it is passed
into the spec file.

Rename BUILDID_DEFINE to SPECBUILDID.

Signed-off-by: Prarit Bhargava 

diff --git a/redhat/genspec.sh b/redhat/genspec.sh
index blahblah..blahblah 100755
--- a/redhat/genspec.sh
+++ b/redhat/genspec.sh
@@ -23,9 +23,9 @@ else
 fi
 
 if [ -n "$BUILDID" ]; then
-   BUILDID_DEFINE=$(printf "%%define buildid %s" "$BUILDID")
+   SPECBUILDID=$(printf "%%define buildid %s" "$BUILDID")
 else
-   BUILDID_DEFINE="# define buildid .local"
+   SPECBUILDID="# define buildid .local"
 fi
 
 EXCLUDE_FILES=":(exclude,top).get_maintainer.conf \
@@ -59,7 +59,7 @@ test -f "$SOURCES/$SPECFILE" &&
sed -i -e "
/%%SPECCHANGELOG%%/r $SOURCES/$SPECCHANGELOG
/%%SPECCHANGELOG%%/d
-   s/%%BUILDID%%/$BUILDID_DEFINE/
+   s/%%SPECBUILDID%%/$SPECBUILDID/
s/%%SPECKVERSION%%/$SPECKVERSION/
s/%%SPECKPATCHLEVEL%%/$SPECKPATCHLEVEL/
s/%%PKGRELEASE%%/$PKGRELEASE/
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
@@ -117,7 +117,7 @@ Summary: The Linux kernel
 # for parallel xz processes, replace with 1 to go back to single process
 %endif
 
-%%BUILDID%%
+%%SPECBUILDID%%
 
 
 %if 0%{?fedora}

--
https://gitlab.com/cki-project/kernel-ark/-/merge_requests/1728
___
kernel mailing list -- kernel@lists.fedoraproject.org
To unsubscribe send an email to kernel-le...@lists.fedoraproject.org
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@lists.fedoraproject.org
Do not reply to spam on the list, report it: 
https://pagure.io/fedora-infrastructure


[OS-BUILD PATCH 15/18] redhat/Makefile: Add 'duplicate' SPEC entries for user set variables

2022-04-22 Thread Prarit Bhargava (via Email Bridge)
From: Prarit Bhargava 

redhat/Makefile: Add 'duplicate' SPEC entries for user set variables

INCLUDE_FEDORA_FILES, INCLUDE_RHEL_FILES, and RELEASED_KERNEL are
specified in Makefile.variables as they can be set in userspace.

Create duplicate entries for these variables that begin with SPEC.  This
will make debugging easier and indicate that the variables are passed into
the spec file.

Signed-off-by: Prarit Bhargava 

diff --git a/redhat/Makefile b/redhat/Makefile
index blahblah..blahblah 100644
--- a/redhat/Makefile
+++ b/redhat/Makefile
@@ -26,6 +26,12 @@ ifdef SINGLE_TARBALL
 endif
 
 include Makefile.variables
+# These entries are 'duplicates' of variables specified in Makefile.variables
+# that are used in the SPEC file.  Specifying these with a SPEC prefix 
indicates
+# that the value is passed through to the spec file.
+SPECRELEASED_KERNEL=$(RELEASED_KERNEL)
+SPECINCLUDE_FEDORA_FILES=$(INCLUDE_FEDORA_FILES)
+SPECINCLUDE_RHEL_FILES=$(INCLUDE_RHEL_FILES)
 
 LANG=C
 
diff --git a/redhat/genspec.sh b/redhat/genspec.sh
index blahblah..blahblah 100755
--- a/redhat/genspec.sh
+++ b/redhat/genspec.sh
@@ -66,10 +66,10 @@ test -f "$SOURCES/$SPECFILE" &&
s/%%SPECBUILD%%/$SPECBUILD/
s/%%SPECRELEASE%%/$SPECRELEASE/
s/%%SPECDISTROBUILD%%/$SPECDISTROBUILD/
-   s/%%RELEASED_KERNEL%%/$RELEASED_KERNEL/
+   s/%%SPECRELEASED_KERNEL%%/$SPECRELEASED_KERNEL/
s/%%SPECDEBUG_BUILDS_ENABLED%%/$SPECDEBUG_BUILDS_ENABLED/
-   s/%%INCLUDE_FEDORA_FILES%%/$INCLUDE_FEDORA_FILES/
-   s/%%INCLUDE_RHEL_FILES%%/$INCLUDE_RHEL_FILES/
+   s/%%SPECINCLUDE_FEDORA_FILES%%/$SPECINCLUDE_FEDORA_FILES/
+   s/%%SPECINCLUDE_RHEL_FILES%%/$SPECINCLUDE_RHEL_FILES/
s/%%SPECPATCHLIST_CHANGELOG%%/$SPECPATCHLIST_CHANGELOG/
s/%%SPECVERSION%%/$SPECVERSION/
s/%%SPECTARFILE_RELEASE%%/$SPECTARFILE_RELEASE/" "$SOURCES/$SPECFILE"
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
@@ -4,9 +4,9 @@
 # here before the %%install macro is pre-built.
 
 # Include Fedora files
-%global include_fedora %%INCLUDE_FEDORA_FILES%%
+%global include_fedora %%SPECINCLUDE_FEDORA_FILES%%
 # Include RHEL files
-%global include_rhel %%INCLUDE_RHEL_FILES%%
+%global include_rhel %%SPECINCLUDE_RHEL_FILES%%
 # Provide Patchlist.changelog file
 %global patchlist_changelog %%SPECPATCHLIST_CHANGELOG%%
 
@@ -77,7 +77,7 @@ Summary: The Linux kernel
 #  kernel release. (This includes prepatch or "rc" releases.)
 # Set released_kernel to 0 when the upstream source tarball contains an
 #  unreleased kernel development snapshot.
-%global released_kernel %%RELEASED_KERNEL%%
+%global released_kernel %%SPECRELEASED_KERNEL%%
 
 # Set debugbuildsenabled to 1 to build separate base and debug kernels
 #  (on supported architectures). The kernel-debug-* subpackages will
diff --git a/redhat/self-test/data/centos-2585cf9dfaad.el7 
b/redhat/self-test/data/centos-2585cf9dfaad.el7
index blahblah..blahblah 100644
--- a/redhat/self-test/data/centos-2585cf9dfaad.el7
+++ b/redhat/self-test/data/centos-2585cf9dfaad.el7
@@ -56,11 +56,14 @@ SPECBUILD=0.rc5.6.test
 SPECCHANGELOG=kernel.changelog-9.99 
 SPECDISTROBUILD=0.rc5.6 
 SPECFILE=kernel.spec 
+SPECINCLUDE_FEDORA_FILES=1 
+SPECINCLUDE_RHEL_FILES=1 
 SPECKEXTRAVERSION=-rc5 
 SPECKPATCHLEVEL=16 
 SPECKSUBLEVEL=0 
 SPECKVERSION=5 
 SPECRELEASE=0.rc5.6%{?buildid}%{?dist} 
+SPECRELEASED_KERNEL=0 
 SPECTARFILE_RELEASE=5.16.0-0.rc5.6.test 
 SPECVERSION=5.16.0 
 SRPM=../redhat/rpm/SRPMS/kernel-5.16.0-0.rc5.6.test.el7.src.rpm 
diff --git a/redhat/self-test/data/centos-2585cf9dfaad.fc25 
b/redhat/self-test/data/centos-2585cf9dfaad.fc25
index blahblah..blahblah 100644
--- a/redhat/self-test/data/centos-2585cf9dfaad.fc25
+++ b/redhat/self-test/data/centos-2585cf9dfaad.fc25
@@ -56,11 +56,14 @@ SPECBUILD=0.rc5.6.test
 SPECCHANGELOG=kernel.changelog-9.99 
 SPECDISTROBUILD=0.rc5.6 
 SPECFILE=kernel.spec 
+SPECINCLUDE_FEDORA_FILES=1 
+SPECINCLUDE_RHEL_FILES=1 
 SPECKEXTRAVERSION=-rc5 
 SPECKPATCHLEVEL=16 
 SPECKSUBLEVEL=0 
 SPECKVERSION=5 
 SPECRELEASE=0.rc5.6%{?buildid}%{?dist} 
+SPECRELEASED_KERNEL=0 
 SPECTARFILE_RELEASE=5.16.0-0.rc5.6.test 
 SPECVERSION=5.16.0 
 SRPM=../redhat/rpm/SRPMS/kernel-5.16.0-0.rc5.6.test.fc25.src.rpm 
diff --git a/redhat/self-test/data/centos-78e36f3b0dae.el7 
b/redhat/self-test/data/centos-78e36f3b0dae.el7
index blahblah..blahblah 100644
--- a/redhat/self-test/data/centos-78e36f3b0dae.el7
+++ b/redhat/self-test/data/centos-78e36f3b0dae.el7
@@ -56,11 +56,14 @@ SPECBUILD=0.rc0.78e36f3b0dae586.6.test
 SPECCHANGELOG=kernel.changelog-9.99 
 SPECDISTROBUILD=0.rc0.78e36f3b0dae586.6 
 SPECFILE=kernel.spec 
+SPECINCLUDE_FEDORA_FILES=1 
+SPECINCLUDE_RHEL_FILES=1 
 SPECKEXTRAVERSION= 
 SPECKPATCHLEVEL=17 
 SPECKSUBLEVEL=0 
 SPECKVERSION=5 
 SPECRELEASE=0.rc0.78e36f3b0dae586.6%{?buildid}%{?dist} 
+SPECRELEASED_KERNEL=0 
 

[OS-BUILD PATCH 10/18] redhat/Makefile: Rename PKGRELEASE to SPECBUILD

2022-04-22 Thread Prarit Bhargava (via Email Bridge)
From: Prarit Bhargava 

redhat/Makefile: Rename PKGRELEASE to SPECBUILD

PKGRELEASE is a confusing variable name, and it really is the BUILD string
for the specfile.

Rename PKGRELEASE to SPECBUILD.

Signed-off-by: Prarit Bhargava 

diff --git a/redhat/Makefile b/redhat/Makefile
index blahblah..blahblah 100644
--- a/redhat/Makefile
+++ b/redhat/Makefile
@@ -209,8 +209,8 @@ DISTRO_BUILD:=$(PREBUILD)$(shell echo $(BUILD) | sed -e 
's|\(^[0-9]\{1,4\}\)\..*
 
KABI_TARBALL:=$(SOURCES)/kernel-abi-stablelists-$(SPECVERSION)-$(DISTRO_BUILD).tar.bz2
 KABIDW := $(REDHAT)/kabi-dwarf
 
KABIDW_TARBALL:=$(SOURCES)/kernel-kabi-dw-$(SPECVERSION)-$(DISTRO_BUILD).tar.bz2
-PKGRELEASE:=$(PREBUILD)$(BUILD)$(BUILDID)
-RPMVERSION:=$(SPECVERSION)-$(PKGRELEASE)
+SPECBUILD:=$(PREBUILD)$(BUILD)$(BUILDID)
+RPMVERSION:=$(SPECVERSION)-$(SPECBUILD)
 SPECRELEASE:=$(PREBUILD)$(BUILD)%{?buildid}%{?dist}
 SRPM:=$(SRPMS)/$(PACKAGE_NAME)-$(RPMVERSION)$(DIST).src.rpm
 
@@ -620,9 +620,9 @@ dist-fedora-release-push: dist-fedora-release
 dist-vr-check:
@# builds may include a s390x+zfcpdump arch build.  UTS_RELEASE can 
only have a
@# version-release string with max 64 chars.  The version-release for 
s390x+zfcpdump
-   @# is 29 characters, leaving a maximum of 35 characters for PKGRELEASE.
-   @if [ $$(echo -n $(PKGRELEASE) | wc -c) -gt 35 ]; then \
-   echo "PKGRELEASE ($(PKGRELEASE)) is too long.  Use a shorter 
localversion (currently $(BUILDID))"; \
+   @# is 29 characters, leaving a maximum of 35 characters for SPECBUILD.
+   @if [ $$(echo -n $(SPECBUILD) | wc -c) -gt 35 ]; then \
+   echo "SPECBUILD ($(SPECBUILD)) is too long.  Use a shorter 
localversion (currently $(BUILDID))"; \
exit 1; \
fi
 
diff --git a/redhat/Makefile.variables b/redhat/Makefile.variables
index blahblah..blahblah 100644
--- a/redhat/Makefile.variables
+++ b/redhat/Makefile.variables
@@ -100,7 +100,7 @@ BUILD ?=
 
 # Builds may include a s390x+zfcpdump arch build, which results in the build
 # failing because the UTS_RELEASE field exceeded 64 chars.  This variable can
-# be set to 1 to decrease the kernel UTS_RELEASE and PKGRELEASE by 11 
characters
+# be set to 1 to decrease the kernel UTS_RELEASE and SPECBUILD by 11 characters
 # (MMDDgit).
 PREBUILD_GIT_ONLY ?=
 
diff --git a/redhat/genspec.sh b/redhat/genspec.sh
index blahblah..blahblah 100755
--- a/redhat/genspec.sh
+++ b/redhat/genspec.sh
@@ -1,4 +1,5 @@
 #!/bin/bash
+# shellcheck disable=SC2153
 
 LAST_MARKER=$(cat "${REDHAT}"/marker)
 clogf="$SOURCES/changelog"
@@ -62,7 +63,7 @@ test -f "$SOURCES/$SPECFILE" &&
s/%%SPECBUILDID%%/$SPECBUILDID/
s/%%SPECKVERSION%%/$SPECKVERSION/
s/%%SPECKPATCHLEVEL%%/$SPECKPATCHLEVEL/
-   s/%%PKGRELEASE%%/$PKGRELEASE/
+   s/%%SPECBUILD%%/$SPECBUILD/
s/%%SPECRELEASE%%/$SPECRELEASE/
s/%%DISTRO_BUILD%%/$DISTRO_BUILD/
s/%%RELEASED_KERNEL%%/$RELEASED_KERNEL/
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
@@ -131,7 +131,7 @@ Summary: The Linux kernel
 
 %define specversion %%SPECVERSION%%
 %define patchversion %%SPECKVERSION%%.%%SPECKPATCHLEVEL%%
-%define pkgrelease %%PKGRELEASE%%
+%define pkgrelease %%SPECBUILD%%
 
 # This is needed to do merge window version magic
 %define patchlevel %%SPECKPATCHLEVEL%%
diff --git a/redhat/self-test/data/centos-2585cf9dfaad.el7 
b/redhat/self-test/data/centos-2585cf9dfaad.el7
index blahblah..blahblah 100644
--- a/redhat/self-test/data/centos-2585cf9dfaad.el7
+++ b/redhat/self-test/data/centos-2585cf9dfaad.el7
@@ -33,7 +33,6 @@ MAKEFILE_LIST=Makefile Makefile.variables ../Makefile.rhelver 
Makefile.rhpkg Mak
 MAKEFLAGS=w -- HEAD=2585cf9dfaad DISTRO=centos DIST=.el7 RHSELFTESTDATA=1 
 MARKER=v5.16-rc5 
 MERGE_BASE=2585cf9dfaaddf00b069673f27bb3f8530e2039c 
-PKGRELEASE=0.rc5.6.test 
 PREBUILD=0.rc5. 
 PROCESS_CONFIGS_CHECK_OPTS=-n -t -c 
 PROCESS_CONFIGS_OPTS=-n -w -c 
@@ -54,6 +53,7 @@ SHELL=/bin/sh
 SINGLE_TARBALL=1 
 SNAPSHOT=0 
 SOURCES=../redhat/rpm/SOURCES 
+SPECBUILD=0.rc5.6.test 
 SPECCHANGELOG=kernel.changelog-9.99 
 SPECFILE=kernel.spec 
 SPECKEXTRAVERSION=-rc5 
diff --git a/redhat/self-test/data/centos-2585cf9dfaad.fc25 
b/redhat/self-test/data/centos-2585cf9dfaad.fc25
index blahblah..blahblah 100644
--- a/redhat/self-test/data/centos-2585cf9dfaad.fc25
+++ b/redhat/self-test/data/centos-2585cf9dfaad.fc25
@@ -33,7 +33,6 @@ MAKEFILE_LIST=Makefile Makefile.variables ../Makefile.rhelver 
Makefile.rhpkg Mak
 MAKEFLAGS=w -- HEAD=2585cf9dfaad DISTRO=centos DIST=.fc25 RHSELFTESTDATA=1 
 MARKER=v5.16-rc5 
 MERGE_BASE=2585cf9dfaaddf00b069673f27bb3f8530e2039c 
-PKGRELEASE=0.rc5.6.test 
 PREBUILD=0.rc5. 
 PROCESS_CONFIGS_CHECK_OPTS=-n -t -c 
 PROCESS_CONFIGS_OPTS=-n -w -c 
@@ -54,6 +53,7 @@ SHELL=/bin/sh
 SINGLE_TARBALL=1 
 SNAPSHOT=0 
 SOURCES=../redhat/rpm/SOURCES 
+SPECBUILD=0.rc5.6.test 
 

[OS-BUILD PATCH 7/18] redhat/Makfile: Rename RPMKEXTRAVERSION to SPECKEXTRAVERSION

2022-04-22 Thread Prarit Bhargava (via Email Bridge)
From: Prarit Bhargava 

redhat/Makfile: Rename RPMKEXTRAVERSION to SPECKEXTRAVERSION

Change RPMKEXTRAVERSION to SPECEXTRAVERSION so that readers understand it is 
passed
into the spec file.

Rename RPMKEXTRAVERSION to SPECKEXTRAVERSION.

Signed-off-by: Prarit Bhargava 

diff --git a/redhat/Makefile b/redhat/Makefile
index blahblah..blahblah 100644
--- a/redhat/Makefile
+++ b/redhat/Makefile
@@ -53,7 +53,7 @@ MACH:=$(shell uname -m)
 SPECKVERSION:=$(shell $(GIT) show $(HEAD):Makefile | sed -ne '/^VERSION\ =\ 
/{s///;p;q}')
 SPECKPATCHLEVEL:=$(shell $(GIT) show $(HEAD):Makefile | sed -ne '/^PATCHLEVEL\ 
=\ /{s///;p;q}')
 SPECKSUBLEVEL:=$(shell $(GIT) show $(HEAD):Makefile | sed -ne '/^SUBLEVEL\ =\ 
/{s///;p;q}')
-RPMKEXTRAVERSION:=$(shell $(GIT) show $(HEAD):Makefile | sed -ne 
'/^EXTRAVERSION\ =\ /{s///;p;q}')
+SPECKEXTRAVERSION:=$(shell $(GIT) show $(HEAD):Makefile | sed -ne 
'/^EXTRAVERSION\ =\ /{s///;p;q}')
 GITID:= $(shell $(GIT) log --max-count=1 --pretty=format:%H $(HEAD))
 ifndef BUILD
   BUILD:=$(RHEL_RELEASE)
@@ -131,13 +131,13 @@ ifeq ("$(origin O)", "command line")
 endif
 
 # MARKER is the git tag which we base off of for exporting patches
-# Make sure MARKER uses SPECKPATCHLEVEL and RPMKEXTRAVERSION from the kernel
+# Make sure MARKER uses SPECKPATCHLEVEL and SPECKEXTRAVERSION from the kernel
 # makefile as opposed to any adjusted version for snapshotting.
-ifneq ($(RPMKEXTRAVERSION),)
-  MARKER:=v$(SPECKVERSION).$(SPECKPATCHLEVEL)$(RPMKEXTRAVERSION)
-  KEXTRAVERSION:=$(shell echo $(RPMKEXTRAVERSION) | sed -e s/-/./)
+ifneq ($(SPECKEXTRAVERSION),)
+  MARKER:=v$(SPECKVERSION).$(SPECKPATCHLEVEL)$(SPECKEXTRAVERSION)
+  KEXTRAVERSION:=$(shell echo $(SPECKEXTRAVERSION) | sed -e s/-/./)
   PREBUILD:=0$(KEXTRAVERSION).
-  UPSTREAM_TARBALL_NAME:=$(SPECKVERSION).$(SPECKPATCHLEVEL)$(RPMKEXTRAVERSION)
+  UPSTREAM_TARBALL_NAME:=$(SPECKVERSION).$(SPECKPATCHLEVEL)$(SPECKEXTRAVERSION)
 else
   KEXTRAVERSION:=
   ifeq ($(SPECKSUBLEVEL),0)
@@ -179,7 +179,7 @@ ifeq ($(VERSION_ON_UPSTREAM),1)
 # been updated but we still need something that works for
 # packaging. Fix this by bumping the patch level and marking
 # this as rc0
-ifeq ($(RPMKEXTRAVERSION),)
+ifeq ($(SPECKEXTRAVERSION),)
   KEXTRAVERSION:=.rc0
   PREBUILD:=0$(KEXTRAVERSION).
   SPECKPATCHLEVEL:=$(shell expr $(SPECKPATCHLEVEL) + 1)
diff --git a/redhat/self-test/data/centos-2585cf9dfaad.el7 
b/redhat/self-test/data/centos-2585cf9dfaad.el7
index blahblah..blahblah 100644
--- a/redhat/self-test/data/centos-2585cf9dfaad.el7
+++ b/redhat/self-test/data/centos-2585cf9dfaad.el7
@@ -50,13 +50,13 @@ RHPKG_BIN=centpkg
 RHSELFTESTDATA=1 
 RPM=../redhat/rpm 
 RPMBUILD=rpmbuild 
-RPMKEXTRAVERSION=-rc5 
 RPMVERSION=5.16.0-0.rc5.6.test 
 SHELL=/bin/sh 
 SINGLE_TARBALL=1 
 SNAPSHOT=0 
 SOURCES=../redhat/rpm/SOURCES 
 SPECFILE=kernel.spec 
+SPECKEXTRAVERSION=-rc5 
 SPECKPATCHLEVEL=16 
 SPECKSUBLEVEL=0 
 SPECKVERSION=5 
diff --git a/redhat/self-test/data/centos-2585cf9dfaad.fc25 
b/redhat/self-test/data/centos-2585cf9dfaad.fc25
index blahblah..blahblah 100644
--- a/redhat/self-test/data/centos-2585cf9dfaad.fc25
+++ b/redhat/self-test/data/centos-2585cf9dfaad.fc25
@@ -50,13 +50,13 @@ RHPKG_BIN=centpkg
 RHSELFTESTDATA=1 
 RPM=../redhat/rpm 
 RPMBUILD=rpmbuild 
-RPMKEXTRAVERSION=-rc5 
 RPMVERSION=5.16.0-0.rc5.6.test 
 SHELL=/bin/sh 
 SINGLE_TARBALL=1 
 SNAPSHOT=0 
 SOURCES=../redhat/rpm/SOURCES 
 SPECFILE=kernel.spec 
+SPECKEXTRAVERSION=-rc5 
 SPECKPATCHLEVEL=16 
 SPECKSUBLEVEL=0 
 SPECKVERSION=5 
diff --git a/redhat/self-test/data/centos-78e36f3b0dae.el7 
b/redhat/self-test/data/centos-78e36f3b0dae.el7
index blahblah..blahblah 100644
--- a/redhat/self-test/data/centos-78e36f3b0dae.el7
+++ b/redhat/self-test/data/centos-78e36f3b0dae.el7
@@ -50,13 +50,13 @@ RHPKG_BIN=centpkg
 RHSELFTESTDATA=1 
 RPM=../redhat/rpm 
 RPMBUILD=rpmbuild 
-RPMKEXTRAVERSION= 
 RPMVERSION=5.17.0-0.rc0.78e36f3b0dae586.6.test 
 SHELL=/bin/sh 
 SINGLE_TARBALL=1 
 SNAPSHOT=1 
 SOURCES=../redhat/rpm/SOURCES 
 SPECFILE=kernel.spec 
+SPECKEXTRAVERSION= 
 SPECKPATCHLEVEL=17 
 SPECKSUBLEVEL=0 
 SPECKVERSION=5 
diff --git a/redhat/self-test/data/centos-78e36f3b0dae.fc25 
b/redhat/self-test/data/centos-78e36f3b0dae.fc25
index blahblah..blahblah 100644
--- a/redhat/self-test/data/centos-78e36f3b0dae.fc25
+++ b/redhat/self-test/data/centos-78e36f3b0dae.fc25
@@ -50,13 +50,13 @@ RHPKG_BIN=centpkg
 RHSELFTESTDATA=1 
 RPM=../redhat/rpm 
 RPMBUILD=rpmbuild 
-RPMKEXTRAVERSION= 
 RPMVERSION=5.17.0-0.rc0.78e36f3b0dae586.6.test 
 SHELL=/bin/sh 
 SINGLE_TARBALL=1 
 SNAPSHOT=1 
 SOURCES=../redhat/rpm/SOURCES 
 SPECFILE=kernel.spec 
+SPECKEXTRAVERSION= 
 SPECKPATCHLEVEL=17 
 SPECKSUBLEVEL=0 
 SPECKVERSION=5 
diff --git a/redhat/self-test/data/centos-df0cc57e057f.el7 
b/redhat/self-test/data/centos-df0cc57e057f.el7
index blahblah..blahblah 100644
--- a/redhat/self-test/data/centos-df0cc57e057f.el7
+++ b/redhat/self-test/data/centos-df0cc57e057f.el7
@@ -50,13 +50,13 @@ RHPKG_BIN=centpkg
 

[OS-BUILD PATCH 13/18] redhat/genspec: Rename PATCHLIST_CHANGELOG to SPECPATCHLIST_CHANGELOG

2022-04-22 Thread Prarit Bhargava (via Email Bridge)
From: Prarit Bhargava 

redhat/genspec: Rename PATCHLIST_CHANGELOG to SPECPATCHLIST_CHANGELOG

Change PATCHLIST_CHANGELOG to SPECPATCHLIST_CHANGELOG so that readers
understand it is passed into the spec file.

Rename PATCHLIST_CHANGELOG to SPECPATCHLIST_CHANGELOG.

Signed-off-by: Prarit Bhargava 

diff --git a/redhat/genspec.sh b/redhat/genspec.sh
index blahblah..blahblah 100755
--- a/redhat/genspec.sh
+++ b/redhat/genspec.sh
@@ -40,7 +40,7 @@ EXCLUDE_FILES=":(exclude,top).get_maintainer.conf \
 
 # If PATCHLIST_URL is not set to "none", generate Patchlist.changelog file that
 # holds the shas and commits not included upstream and git commit url.
-PATCHLIST_CHANGELOG=0
+SPECPATCHLIST_CHANGELOG=0
 if [ "$PATCHLIST_URL" != "none" ]; then
# sed convert
#  
@@ -53,7 +53,7 @@ if [ "$PATCHLIST_URL" != "none" ]; then
git log --no-merges --pretty=oneline --no-decorate ${UPSTREAM}.. 
$EXCLUDE_FILES | \
sed "s!^\([^ ]*\)!$PATCHLIST_URL/\1\n &!; s!\$!\n!" \
> "$SOURCES"/Patchlist.changelog
-   PATCHLIST_CHANGELOG=1
+   SPECPATCHLIST_CHANGELOG=1
 fi
 
 test -f "$SOURCES/$SPECFILE" &&
@@ -70,7 +70,7 @@ test -f "$SOURCES/$SPECFILE" &&
s/%%SPECDEBUG_BUILDS_ENABLED%%/$SPECDEBUG_BUILDS_ENABLED/
s/%%INCLUDE_FEDORA_FILES%%/$INCLUDE_FEDORA_FILES/
s/%%INCLUDE_RHEL_FILES%%/$INCLUDE_RHEL_FILES/
-   s/%%PATCHLIST_CHANGELOG%%/$PATCHLIST_CHANGELOG/
+   s/%%SPECPATCHLIST_CHANGELOG%%/$SPECPATCHLIST_CHANGELOG/
s/%%SPECVERSION%%/$SPECVERSION/
s/%%TARFILE_RELEASE%%/$TARFILE_RELEASE/" "$SOURCES/$SPECFILE"
 
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
@@ -8,7 +8,7 @@
 # Include RHEL files
 %global include_rhel %%INCLUDE_RHEL_FILES%%
 # Provide Patchlist.changelog file
-%global patchlist_changelog %%PATCHLIST_CHANGELOG%%
+%global patchlist_changelog %%SPECPATCHLIST_CHANGELOG%%
 
 # Disable LTO in userspace packages.
 %global _lto_cflags %{nil}

--
https://gitlab.com/cki-project/kernel-ark/-/merge_requests/1728
___
kernel mailing list -- kernel@lists.fedoraproject.org
To unsubscribe send an email to kernel-le...@lists.fedoraproject.org
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@lists.fedoraproject.org
Do not reply to spam on the list, report it: 
https://pagure.io/fedora-infrastructure


[OS-BUILD PATCH 5/18] redhat/Makfile: Rename RPMKPATCHLEVEL to SPECKPATCHLEVEL

2022-04-22 Thread Prarit Bhargava (via Email Bridge)
From: Prarit Bhargava 

redhat/Makfile: Rename RPMKPATCHLEVEL to SPECKPATCHLEVEL

Change RPMKPATCHLEVEL to SPECPATCHLEVEL so that readers understand it is passed
into the spec file.

Rename RPMKPATCHLEVEL to SPECKPATCHLEVEL.

Signed-off-by: Prarit Bhargava 

diff --git a/redhat/Makefile b/redhat/Makefile
index blahblah..blahblah 100644
--- a/redhat/Makefile
+++ b/redhat/Makefile
@@ -51,7 +51,7 @@ RPMBUILD:=$(shell if [ -x "/usr/bin/rpmbuild" ]; then echo 
rpmbuild; \
 
 MACH:=$(shell uname -m)
 SPECKVERSION:=$(shell $(GIT) show $(HEAD):Makefile | sed -ne '/^VERSION\ =\ 
/{s///;p;q}')
-RPMKPATCHLEVEL:=$(shell $(GIT) show $(HEAD):Makefile | sed -ne '/^PATCHLEVEL\ 
=\ /{s///;p;q}')
+SPECKPATCHLEVEL:=$(shell $(GIT) show $(HEAD):Makefile | sed -ne '/^PATCHLEVEL\ 
=\ /{s///;p;q}')
 RPMKSUBLEVEL:=$(shell $(GIT) show $(HEAD):Makefile | sed -ne '/^SUBLEVEL\ =\ 
/{s///;p;q}')
 RPMKEXTRAVERSION:=$(shell $(GIT) show $(HEAD):Makefile | sed -ne 
'/^EXTRAVERSION\ =\ /{s///;p;q}')
 GITID:= $(shell $(GIT) log --max-count=1 --pretty=format:%H $(HEAD))
@@ -131,18 +131,18 @@ ifeq ("$(origin O)", "command line")
 endif
 
 # MARKER is the git tag which we base off of for exporting patches
-# Make sure MARKER uses RPMKPATCHLEVEL and RPMKEXTRAVERSION from the kernel
+# Make sure MARKER uses SPECKPATCHLEVEL and RPMKEXTRAVERSION from the kernel
 # makefile as opposed to any adjusted version for snapshotting.
 ifneq ($(RPMKEXTRAVERSION),)
-  MARKER:=v$(SPECKVERSION).$(RPMKPATCHLEVEL)$(RPMKEXTRAVERSION)
+  MARKER:=v$(SPECKVERSION).$(SPECKPATCHLEVEL)$(RPMKEXTRAVERSION)
   KEXTRAVERSION:=$(shell echo $(RPMKEXTRAVERSION) | sed -e s/-/./)
   PREBUILD:=0$(KEXTRAVERSION).
-  UPSTREAM_TARBALL_NAME:=$(SPECKVERSION).$(RPMKPATCHLEVEL)$(RPMKEXTRAVERSION)
+  UPSTREAM_TARBALL_NAME:=$(SPECKVERSION).$(SPECKPATCHLEVEL)$(RPMKEXTRAVERSION)
 else
   KEXTRAVERSION:=
   ifeq ($(RPMKSUBLEVEL),0)
-MARKER:=v$(SPECKVERSION).$(RPMKPATCHLEVEL)
-UPSTREAM_TARBALL_NAME:=$(SPECKVERSION).$(RPMKPATCHLEVEL)
+MARKER:=v$(SPECKVERSION).$(SPECKPATCHLEVEL)
+UPSTREAM_TARBALL_NAME:=$(SPECKVERSION).$(SPECKPATCHLEVEL)
   else
 MARKER:=v$(SPECVERSION)
 UPSTREAM_TARBALL_NAME:=$(SPECVERSION)
@@ -182,7 +182,7 @@ ifeq ($(VERSION_ON_UPSTREAM),1)
 ifeq ($(RPMKEXTRAVERSION),)
   KEXTRAVERSION:=.rc0
   PREBUILD:=0$(KEXTRAVERSION).
-  RPMKPATCHLEVEL:=$(shell expr $(RPMKPATCHLEVEL) + 1)
+  SPECKPATCHLEVEL:=$(shell expr $(SPECKPATCHLEVEL) + 1)
 endif
 ifndef PREBUILD_GIT_ONLY
   ifneq ($(filter $(MAKECMDGOALS),dist-git-test dist-git),)
@@ -204,7 +204,7 @@ else
   SNAPSHOT:=0
 endif
 
-SPECVERSION:=$(SPECKVERSION).$(RPMKPATCHLEVEL).$(RPMKSUBLEVEL)
+SPECVERSION:=$(SPECKVERSION).$(SPECKPATCHLEVEL).$(RPMKSUBLEVEL)
 DISTRO_BUILD:=$(PREBUILD)$(shell echo $(BUILD) | sed -e 
's|\(^[0-9]\{1,4\}\)\..*|\1|')
 
KABI_TARBALL:=$(SOURCES)/kernel-abi-stablelists-$(SPECVERSION)-$(DISTRO_BUILD).tar.bz2
 KABIDW := $(REDHAT)/kabi-dwarf
diff --git a/redhat/genspec.sh b/redhat/genspec.sh
index blahblah..blahblah 100755
--- a/redhat/genspec.sh
+++ b/redhat/genspec.sh
@@ -61,7 +61,7 @@ test -f "$SOURCES/$SPECFILE" &&
/%%CHANGELOG%%/d
s/%%BUILDID%%/$BUILDID_DEFINE/
s/%%SPECKVERSION%%/$SPECKVERSION/
-   s/%%RPMKPATCHLEVEL%%/$RPMKPATCHLEVEL/
+   s/%%SPECKPATCHLEVEL%%/$SPECKPATCHLEVEL/
s/%%PKGRELEASE%%/$PKGRELEASE/
s/%%SPECRELEASE%%/$SPECRELEASE/
s/%%DISTRO_BUILD%%/$DISTRO_BUILD/
@@ -89,7 +89,7 @@ done
 
 echo > "$clogf"
 
-lasttag=$(git rev-list --first-parent --grep="^\[redhat\] 
kernel-${SPECKVERSION}.${RPMKPATCHLEVEL}" --max-count=1 HEAD)
+lasttag=$(git rev-list --first-parent --grep="^\[redhat\] 
kernel-${SPECKVERSION}.${SPECKPATCHLEVEL}" --max-count=1 HEAD)
 # if we didn't find the proper tag, assume this is the first release
 if [[ -z $lasttag ]]; then
 if [[ -z ${MARKER//[0-9a-f]/} ]]; then
@@ -168,12 +168,12 @@ if [ "$SINGLE_TARBALL" = 0 ]; then
# May need to preserve word splitting in EXCLUDE_FILES
# shellcheck disable=SC2086
git diff -p --no-renames --stat "$MARKER"..  $EXCLUDE_FILES \
-   > 
${SOURCES}/patch-${SPECKVERSION}.${RPMKPATCHLEVEL}-redhat.patch
+   > 
${SOURCES}/patch-${SPECKVERSION}.${SPECKPATCHLEVEL}-redhat.patch
 else
# The tarball in the SRPM contains both upstream sources and OS-specifc
# commits.  Even though this is the case, an empty file for dist-git
# compatibility is necessary.
-   touch "${SOURCES}/patch-${SPECKVERSION}.${RPMKPATCHLEVEL}"-redhat.patch
+   touch "${SOURCES}/patch-${SPECKVERSION}.${SPECKPATCHLEVEL}"-redhat.patch
 fi
 
 rm -f "$clogf"{,.rev,.stripped};
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
@@ -127,14 +127,14 @@ Summary: The Linux kernel
 %endif
 
 # The kernel tarball/base version
-%define kversion %%SPECKVERSION%%.%%RPMKPATCHLEVEL%%
+%define 

[OS-BUILD PATCH 8/18] redhat/Makefile: Rename CHANGELOG to SPECCHANGELOG

2022-04-22 Thread Prarit Bhargava (via Email Bridge)
From: Prarit Bhargava 

redhat/Makefile: Rename CHANGELOG to SPECCHANGELOG

Change CHANGELOG to SPECCHANGELOG so that readers understand it is passed
into the spec file.  While the CHANGELOG does have use other than in the
spec file it is useful to know that the string is used in the spec file.

Rename CHANGELOG to SPECKCHANGELOG.

Signed-off-by: Prarit Bhargava 

diff --git a/redhat/Makefile b/redhat/Makefile
index blahblah..blahblah 100644
--- a/redhat/Makefile
+++ b/redhat/Makefile
@@ -69,7 +69,7 @@ RPM:=$(REDHAT)/rpm
 SRPMS:=$(RPM)/SRPMS
 SOURCES:=$(RPM)/SOURCES
 TESTPATCH:=$(REDHAT)/linux-kernel-test.patch
-CHANGELOG:=$(PACKAGE_NAME).changelog-$(RHEL_MAJOR).$(RHEL_MINOR)
+SPECCHANGELOG:=$(PACKAGE_NAME).changelog-$(RHEL_MAJOR).$(RHEL_MINOR)
 CHANGELOG_PREV:=$(PACKAGE_NAME).changelog-$(RHEL_MAJOR).$(shell expr 
$(RHEL_MINOR) - 1)
 ARCH_LIST=aarch64 ppc64le s390x x86_64
 
@@ -460,14 +460,14 @@ dist-buildreq-check: setup-source
 
 setup-source: dist-git-version-check dist-clean-sources
@cp $(REDHAT)/$(SPECFILE).template $(SOURCES)/$(SPECFILE)
-   @if [ ! -e  $(REDHAT)/$(CHANGELOG) ]; then \
-   echo "Creating $(CHANGELOG) as copy of $(CHANGELOG_PREV)"; \
-   cp $(REDHAT)/$(CHANGELOG_PREV) $(REDHAT)/$(CHANGELOG); \
+   @if [ ! -e  $(REDHAT)/$(SPECCHANGELOG) ]; then \
+   echo "Creating $(SPECCHANGELOG) as copy of $(CHANGELOG_PREV)"; \
+   cp $(REDHAT)/$(CHANGELOG_PREV) $(REDHAT)/$(SPECCHANGELOG); \
fi
@if [ -z "$(RHSELFTESTDATA)" ]; then \
-   cp $(REDHAT)/$(CHANGELOG) $(SOURCES)/$(CHANGELOG); \
+   cp $(REDHAT)/$(SPECCHANGELOG) $(SOURCES)/$(SPECCHANGELOG); \
else \
-   echo "Mon Mar 28 2022 Fedora Kernel Team 
 [$(RPMVERSION)]" > $(SOURCES)/$(CHANGELOG); \
+   echo "Mon Mar 28 2022 Fedora Kernel Team 
 [$(RPMVERSION)]" > $(SOURCES)/$(SPECCHANGELOG); 
\
fi
@if [ -z "$(PATCHLIST_URL)" ]; then \
echo "Error: PATCHLIST_URL must be set (to 'none' or any URL)"; 
\
@@ -566,19 +566,19 @@ dist-rpm-baseonly: dist-sources do-rpmbuild
 
 # unless you know what you're doing, you don't want to use the next four ones
 dist-release-finish: setup-source
-   @cp $(SOURCES)/$(CHANGELOG) $(REDHAT)/$(CHANGELOG)
-   @$(GIT) add $(REDHAT)/$(CHANGELOG)
+   @cp $(SOURCES)/$(SPECCHANGELOG) $(REDHAT)/$(SPECCHANGELOG)
+   @$(GIT) add $(REDHAT)/$(SPECCHANGELOG)
@$(GIT) add $(REDHAT)/marker
-   @$(GIT) commit -s ../Makefile.rhelver $(REDHAT)/marker 
$(REDHAT)/$(CHANGELOG) $(PACKAGE_NAME).spec.template -m "[redhat] 
$(PACKAGE_NAME)-$(RPMVERSION)"
+   @$(GIT) commit -s ../Makefile.rhelver $(REDHAT)/marker 
$(REDHAT)/$(SPECCHANGELOG) $(PACKAGE_NAME).spec.template -m "[redhat] 
$(PACKAGE_NAME)-$(RPMVERSION)"
 dist-release-changed: setup-source
-   @cp $(SOURCES)/$(CHANGELOG) $(REDHAT)/$(CHANGELOG)
+   @cp $(SOURCES)/$(SPECCHANGELOG) $(REDHAT)/$(SPECCHANGELOG)
@echo $(MARKER) > $(REDHAT)/marker
@# if neither changelog nor marker was updated, skip bumping a release
@$(GIT) update-index -q --really-refresh
@if $(GIT) diff-index --quiet HEAD; then \
echo "Nothing changed, skipping updates"; \
else \
-   $(GIT) checkout -- $(REDHAT)/$(CHANGELOG); \
+   $(GIT) checkout -- $(REDHAT)/$(SPECCHANGELOG); \
$(REDHAT)/scripts/new_release.sh $(REDHAT) $(__YSTREAM) 
$(__ZSTREAM) $(BUMP_RELEASE); \
$(MAKE) dist-release-finish; \
fi
diff --git a/redhat/genspec.sh b/redhat/genspec.sh
index blahblah..blahblah 100755
--- a/redhat/genspec.sh
+++ b/redhat/genspec.sh
@@ -57,8 +57,8 @@ fi
 
 test -f "$SOURCES/$SPECFILE" &&
sed -i -e "
-   /%%CHANGELOG%%/r $SOURCES/$CHANGELOG
-   /%%CHANGELOG%%/d
+   /%%SPECCHANGELOG%%/r $SOURCES/$SPECCHANGELOG
+   /%%SPECCHANGELOG%%/d
s/%%BUILDID%%/$BUILDID_DEFINE/
s/%%SPECKVERSION%%/$SPECKVERSION/
s/%%SPECKPATCHLEVEL%%/$SPECKPATCHLEVEL/
@@ -124,7 +124,7 @@ fi
 # This means we need to zap entries that are already present in the changelog.
 if [ "$MARKER" != "$LAST_MARKER" ]; then
# awk trick to get all unique lines
-   awk '!seen[$0]++' "$SOURCES/$CHANGELOG" "$clogf" > "$clogf.unique"
+   awk '!seen[$0]++' "$SOURCES/$SPECCHANGELOG" "$clogf" > "$clogf.unique"
# sed trick to get the end of the changelog minus the line
sed -e '1,/# END OF CHANGELOG/ d' "$clogf.unique" > "$clogf.tmp"
# Add an explicit entry to indicate a rebase.
@@ -157,8 +157,8 @@ if [ "$LENGTH" = 0 ]; then
rm -f "$clogf.rev"; touch "$clogf.rev"
 fi
 
-cat "$clogf.rev" "$SOURCES/$CHANGELOG" > "$clogf.full"
-mv -f "$clogf.full" "$SOURCES/$CHANGELOG"
+cat "$clogf.rev" "$SOURCES/$SPECCHANGELOG" > "$clogf.full"
+mv -f "$clogf.full" "$SOURCES/$SPECCHANGELOG"
 
 echo "MARKER is $MARKER"
 
diff --git a/redhat/kernel.spec.template 

[OS-BUILD PATCH 1/18] redhat/Makefile: Use KVERSION

2022-04-22 Thread Prarit Bhargava (via Email Bridge)
From: Prarit Bhargava 

redhat/Makefile: Use KVERSION

Use KVERSION where appropriate in the Makefile.

Signed-off-by: Prarit Bhargava 

diff --git a/redhat/Makefile b/redhat/Makefile
index blahblah..blahblah 100644
--- a/redhat/Makefile
+++ b/redhat/Makefile
@@ -144,8 +144,8 @@ else
 MARKER:=v$(RPMKVERSION).$(RPMKPATCHLEVEL)
 UPSTREAM_TARBALL_NAME:=$(RPMKVERSION).$(RPMKPATCHLEVEL)
   else
-MARKER:=v$(RPMKVERSION).$(RPMKPATCHLEVEL).$(RPMKSUBLEVEL)
-UPSTREAM_TARBALL_NAME:=$(RPMKVERSION).$(RPMKPATCHLEVEL).$(RPMKSUBLEVEL)
+MARKER:=v$(KVERSION)
+UPSTREAM_TARBALL_NAME:=$(KVERSION)
   endif
   PREBUILD:=
 endif
@@ -210,7 +210,7 @@ 
KABI_TARBALL:=$(SOURCES)/kernel-abi-stablelists-$(KVERSION)-$(DISTRO_BUILD).tar.
 KABIDW := $(REDHAT)/kabi-dwarf
 KABIDW_TARBALL:=$(SOURCES)/kernel-kabi-dw-$(KVERSION)-$(DISTRO_BUILD).tar.bz2
 PKGRELEASE:=$(PREBUILD)$(BUILD)$(BUILDID)
-RPMVERSION:=$(RPMKVERSION).$(RPMKPATCHLEVEL).$(RPMKSUBLEVEL)-$(PKGRELEASE)
+RPMVERSION:=$(KVERSION)-$(PKGRELEASE)
 SPECRELEASE:=$(PREBUILD)$(BUILD)%{?buildid}%{?dist}
 SRPM:=$(SRPMS)/$(PACKAGE_NAME)-$(RPMVERSION)$(DIST).src.rpm
 

--
https://gitlab.com/cki-project/kernel-ark/-/merge_requests/1728
___
kernel mailing list -- kernel@lists.fedoraproject.org
To unsubscribe send an email to kernel-le...@lists.fedoraproject.org
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@lists.fedoraproject.org
Do not reply to spam on the list, report it: 
https://pagure.io/fedora-infrastructure


[OS-BUILD PATCH 0/18] redhat: test updates

2022-04-22 Thread Prarit Bhargava (via Email Bridge)
From: Prarit Bhargava on gitlab.com
Merge Request: https://gitlab.com/cki-project/kernel-ark/-/merge_requests/1728

Depends: https://gitlab.com/cki-project/kernel-ark/-/merge_requests/1727

Add a test to verify Makefile declarations, and add the RHTEST variable.
The latter of these changes allows users to execute make commands
with -n, --dry-run, and other "test" commands.

Signed-off-by: Prarit Bhargava 

---
 redhat/configs/build_configs.sh |2 +
 redhat/configs/generate_all_configs.sh  |4 +-
 redhat/configs/process_configs.sh   |2 +
 redhat/docs/makefile-changes.rst|8 +-
 redhat/scripts/create-tarball.sh|2 +-
 redhat/self-test/data/centos-2585cf9dfaad.el7   |   21 ++-
 redhat/self-test/data/centos-2585cf9dfaad.el7.spec  |   24 ++--
 redhat/self-test/data/centos-2585cf9dfaad.fc25  |   21 ++-
 redhat/self-test/data/centos-2585cf9dfaad.fc25.spec |   24 ++--
 redhat/self-test/data/centos-78e36f3b0dae.el7   |   21 ++-
 redhat/self-test/data/centos-78e36f3b0dae.el7.spec  |   24 ++--
 redhat/self-test/data/centos-78e36f3b0dae.fc25  |   21 ++-
 redhat/self-test/data/centos-78e36f3b0dae.fc25.spec |   24 ++--
 redhat/self-test/data/centos-df0cc57e057f.el7   |   21 ++-
 redhat/self-test/data/centos-df0cc57e057f.el7.spec  |   24 ++--
 redhat/self-test/data/centos-df0cc57e057f.fc25  |   21 ++-
 redhat/self-test/data/centos-df0cc57e057f.fc25.spec |   24 ++--
 redhat/self-test/data/centos-fce15c45d3fb.el7   |   21 ++-
 redhat/self-test/data/centos-fce15c45d3fb.el7.spec  |   24 ++--
 redhat/self-test/data/centos-fce15c45d3fb.fc25  |   21 ++-
 redhat/self-test/data/centos-fce15c45d3fb.fc25.spec |   24 ++--
 redhat/self-test/data/fedora-2585cf9dfaad.el7   |   21 ++-
 redhat/self-test/data/fedora-2585cf9dfaad.el7.spec  |   24 ++--
 redhat/self-test/data/fedora-2585cf9dfaad.fc25  |   21 ++-
 redhat/self-test/data/fedora-2585cf9dfaad.fc25.spec |   24 ++--
 redhat/self-test/data/fedora-78e36f3b0dae.el7   |   21 ++-
 redhat/self-test/data/fedora-78e36f3b0dae.el7.spec  |   24 ++--
 redhat/self-test/data/fedora-78e36f3b0dae.fc25  |   21 ++-
 redhat/self-test/data/fedora-78e36f3b0dae.fc25.spec |   24 ++--
 redhat/self-test/data/fedora-df0cc57e057f.el7   |   21 ++-
 redhat/self-test/data/fedora-df0cc57e057f.el7.spec  |   24 ++--
 redhat/self-test/data/fedora-df0cc57e057f.fc25  |   21 ++-
 redhat/self-test/data/fedora-df0cc57e057f.fc25.spec |   24 ++--
 redhat/self-test/data/fedora-fce15c45d3fb.el7   |   21 ++-
 redhat/self-test/data/fedora-fce15c45d3fb.el7.spec  |   24 ++--
 redhat/self-test/data/fedora-fce15c45d3fb.fc25  |   21 ++-
 redhat/self-test/data/fedora-fce15c45d3fb.fc25.spec |   24 ++--
 redhat/self-test/data/rhel-2585cf9dfaad.el7 |   21 ++-
 redhat/self-test/data/rhel-2585cf9dfaad.el7.spec|   24 ++--
 redhat/self-test/data/rhel-2585cf9dfaad.fc25|   21 ++-
 redhat/self-test/data/rhel-2585cf9dfaad.fc25.spec   |   24 ++--
 redhat/self-test/data/rhel-78e36f3b0dae.el7 |   21 ++-
 redhat/self-test/data/rhel-78e36f3b0dae.el7.spec|   24 ++--
 redhat/self-test/data/rhel-78e36f3b0dae.fc25|   21 ++-
 redhat/self-test/data/rhel-78e36f3b0dae.fc25.spec   |   24 ++--
 redhat/self-test/data/rhel-df0cc57e057f.el7 |   21 ++-
 redhat/self-test/data/rhel-df0cc57e057f.el7.spec|   24 ++--
 redhat/self-test/data/rhel-df0cc57e057f.fc25|   21 ++-
 redhat/self-test/data/rhel-df0cc57e057f.fc25.spec   |   24 ++--
 redhat/self-test/data/rhel-fce15c45d3fb.el7 |   21 ++-
 redhat/self-test/data/rhel-fce15c45d3fb.el7.spec|   24 ++--
 redhat/self-test/data/rhel-fce15c45d3fb.fc25|   21 ++-
 redhat/self-test/data/rhel-fce15c45d3fb.fc25.spec   |   24 ++--
 redhat/self-test/1006-verify-SPEC-variables.bats|   24 
 redhat/self-test/3001-Makefile-contents.bats|   17 +++
 redhat/Makefile |  108 +++
 redhat/Makefile.variables   |2 +-
 redhat/genspec.sh   |   55 +
 redhat/kernel.spec.template |   56 +-
 59 files changed, 754 insertions(+), 606 deletions(-)
___
kernel mailing list -- kernel@lists.fedoraproject.org
To unsubscribe send an email to kernel-le...@lists.fedoraproject.org
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@lists.fedoraproject.org
Do not reply to spam on the list, report it: 
https://pagure.io/fedora-infrastructure


[OS-BUILD PATCH 14/18] redhat/Makefile: Rename TARFILE_RELEASE to SPECTARFILE_RELEASE

2022-04-22 Thread Prarit Bhargava (via Email Bridge)
From: Prarit Bhargava 

redhat/Makefile: Rename TARFILE_RELEASE to SPECTARFILE_RELEASE

Change TARFILE_RELEASE to SPECTARFILE_RELEASE so that readers
understand it is passed into the spec file.

Rename TARFILE_RELEASE to SPECTARFILE_RELEASE.

Signed-off-by: Prarit Bhargava 

diff --git a/redhat/Makefile b/redhat/Makefile
index blahblah..blahblah 100644
--- a/redhat/Makefile
+++ b/redhat/Makefile
@@ -220,7 +220,7 @@ SRPM:=$(SRPMS)/$(PACKAGE_NAME)-$(RPMVERSION)$(DIST).src.rpm
 #
 ifeq ("$(DISTRO)", "fedora")
   SINGLE_TARBALL:=0
-  TARFILE_RELEASE:=$(UPSTREAM_TARBALL_NAME)
+  SPECTARFILE_RELEASE:=$(UPSTREAM_TARBALL_NAME)
   RHDISTGIT_BRANCH:=rawhide
   ifndef BUILD_SCRATCH_TARGET
 BUILD_SCRATCH_TARGET:=temp-ark-rhel-8-test
@@ -234,21 +234,21 @@ else ifeq ("$(DISTRO)", "centos")
   ifndef BUILD_SCRATCH_TARGET
 BUILD_SCRATCH_TARGET:=c$(RHEL_MAJOR)s-candidate
   endif
-  TARFILE_RELEASE:=$(RPMVERSION)
+  SPECTARFILE_RELEASE:=$(RPMVERSION)
 else
   SINGLE_TARBALL:=1
   RHDISTGIT_BRANCH:=rhel-$(RHEL_MAJOR).$(RHEL_MINOR).0
   ifndef BUILD_SCRATCH_TARGET
 BUILD_SCRATCH_TARGET:=rhel-$(RHEL_MAJOR).$(RHEL_MINOR).0-test-pesign
   endif
-  TARFILE_RELEASE:=$(RPMVERSION)
+  SPECTARFILE_RELEASE:=$(RPMVERSION)
 endif
 
 ifndef BUILD_TARGET
   BUILD_TARGET:=--scratch $(BUILD_SCRATCH_TARGET)
 endif
 
-TARFILE:=linux-$(TARFILE_RELEASE).tar.xz
+TARFILE:=linux-$(SPECTARFILE_RELEASE).tar.xz
 TARBALL:=$(REDHAT)/$(TARFILE)
 
 include Makefile.rhpkg
diff --git a/redhat/genspec.sh b/redhat/genspec.sh
index blahblah..blahblah 100755
--- a/redhat/genspec.sh
+++ b/redhat/genspec.sh
@@ -72,7 +72,7 @@ test -f "$SOURCES/$SPECFILE" &&
s/%%INCLUDE_RHEL_FILES%%/$INCLUDE_RHEL_FILES/
s/%%SPECPATCHLIST_CHANGELOG%%/$SPECPATCHLIST_CHANGELOG/
s/%%SPECVERSION%%/$SPECVERSION/
-   s/%%TARFILE_RELEASE%%/$TARFILE_RELEASE/" "$SOURCES/$SPECFILE"
+   s/%%SPECTARFILE_RELEASE%%/$SPECTARFILE_RELEASE/" "$SOURCES/$SPECFILE"
 
 # We depend on work splitting of BUILDOPTS
 # shellcheck disable=SC2086
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
@@ -692,7 +692,7 @@ BuildRequires: lld
 # exact git commit you can run
 #
 # xzcat -qq ${TARBALL} | git get-tar-commit-id
-Source0: linux-%%TARFILE_RELEASE%%.tar.xz
+Source0: linux-%%SPECTARFILE_RELEASE%%.tar.xz
 
 Source1: Makefile.rhelver
 
@@ -1384,8 +1384,8 @@ ApplyOptionalPatch()
   fi
 }
 
-%setup -q -n kernel-%%TARFILE_RELEASE%% -c
-mv linux-%%TARFILE_RELEASE%% linux-%{KVERREL}
+%setup -q -n kernel-%%SPECTARFILE_RELEASE%% -c
+mv linux-%%SPECTARFILE_RELEASE%% linux-%{KVERREL}
 
 cd linux-%{KVERREL}
 cp -a %{SOURCE1} .
diff --git a/redhat/scripts/create-tarball.sh b/redhat/scripts/create-tarball.sh
index blahblah..blahblah 100755
--- a/redhat/scripts/create-tarball.sh
+++ b/redhat/scripts/create-tarball.sh
@@ -27,4 +27,4 @@ trap 'rm -vf "$TARBALL"' INT
 # XZ_OPTIONS and XZ_THREADS DEPEND on word splitting, so don't disable it here:
 # shellcheck disable=SC2086
 cd ../ &&
-  git archive --prefix="linux-$TARFILE_RELEASE"/ --format=tar "$_GITID" | xz 
$XZ_OPTIONS $XZ_THREADS > "$TARBALL";
+  git archive --prefix="linux-$SPECTARFILE_RELEASE"/ --format=tar "$_GITID" | 
xz $XZ_OPTIONS $XZ_THREADS > "$TARBALL";
diff --git a/redhat/self-test/data/centos-2585cf9dfaad.el7 
b/redhat/self-test/data/centos-2585cf9dfaad.el7
index blahblah..blahblah 100644
--- a/redhat/self-test/data/centos-2585cf9dfaad.el7
+++ b/redhat/self-test/data/centos-2585cf9dfaad.el7
@@ -61,12 +61,12 @@ SPECKPATCHLEVEL=16
 SPECKSUBLEVEL=0 
 SPECKVERSION=5 
 SPECRELEASE=0.rc5.6%{?buildid}%{?dist} 
+SPECTARFILE_RELEASE=5.16.0-0.rc5.6.test 
 SPECVERSION=5.16.0 
 SRPM=../redhat/rpm/SRPMS/kernel-5.16.0-0.rc5.6.test.el7.src.rpm 
 SRPMS=../redhat/rpm/SRPMS 
 TARBALL=../redhat/linux-5.16.0-0.rc5.6.test.tar.xz 
 TARFILE=linux-5.16.0-0.rc5.6.test.tar.xz 
-TARFILE_RELEASE=5.16.0-0.rc5.6.test 
 TESTPATCH=../redhat/linux-kernel-test.patch 
 TOPDIR=.. 
 UPSTREAM_TARBALL_NAME=5.16-rc5 
diff --git a/redhat/self-test/data/centos-2585cf9dfaad.fc25 
b/redhat/self-test/data/centos-2585cf9dfaad.fc25
index blahblah..blahblah 100644
--- a/redhat/self-test/data/centos-2585cf9dfaad.fc25
+++ b/redhat/self-test/data/centos-2585cf9dfaad.fc25
@@ -61,12 +61,12 @@ SPECKPATCHLEVEL=16
 SPECKSUBLEVEL=0 
 SPECKVERSION=5 
 SPECRELEASE=0.rc5.6%{?buildid}%{?dist} 
+SPECTARFILE_RELEASE=5.16.0-0.rc5.6.test 
 SPECVERSION=5.16.0 
 SRPM=../redhat/rpm/SRPMS/kernel-5.16.0-0.rc5.6.test.fc25.src.rpm 
 SRPMS=../redhat/rpm/SRPMS 
 TARBALL=../redhat/linux-5.16.0-0.rc5.6.test.tar.xz 
 TARFILE=linux-5.16.0-0.rc5.6.test.tar.xz 
-TARFILE_RELEASE=5.16.0-0.rc5.6.test 
 TESTPATCH=../redhat/linux-kernel-test.patch 
 TOPDIR=.. 
 UPSTREAM_TARBALL_NAME=5.16-rc5 
diff --git a/redhat/self-test/data/centos-78e36f3b0dae.el7 
b/redhat/self-test/data/centos-78e36f3b0dae.el7
index blahblah..blahblah 100644
--- a/redhat/self-test/data/centos-78e36f3b0dae.el7

[OS-BUILD PATCH 16/18] redhat/self-test: Add test to verify SPEC variables

2022-04-22 Thread Prarit Bhargava (via Email Bridge)
From: Prarit Bhargava 

redhat/self-test: Add test to verify SPEC variables

This test looks at the spec file variable replacement code in
redhat/genspec.sh and confirms that each variable begins with "SPEC".

Signed-off-by: Prarit Bhargava 

diff --git a/redhat/docs/makefile-changes.rst b/redhat/docs/makefile-changes.rst
index blahblah..blahblah 100644
--- a/redhat/docs/makefile-changes.rst
+++ b/redhat/docs/makefile-changes.rst
@@ -46,6 +46,12 @@ external scripts.  Variables in this file should be 
considered stable.
 Variables still may be deprecated and will follow the guidelines in
 "Deprecating variables and targets" section below.
 
+Variable Naming
+===
+
+Variables names prefixed with SPEC indicate that the variable is used
+in redhat/kernel.spec.template (see redhat/genspec.sh).
+
 Deprecating variables and targets
 =
 
diff --git a/redhat/genspec.sh b/redhat/genspec.sh
index blahblah..blahblah 100755
--- a/redhat/genspec.sh
+++ b/redhat/genspec.sh
@@ -56,6 +56,7 @@ if [ "$PATCHLIST_URL" != "none" ]; then
SPECPATCHLIST_CHANGELOG=1
 fi
 
+# self-test begin
 test -f "$SOURCES/$SPECFILE" &&
sed -i -e "
/%%SPECCHANGELOG%%/r $SOURCES/$SPECCHANGELOG
@@ -73,6 +74,7 @@ test -f "$SOURCES/$SPECFILE" &&
s/%%SPECPATCHLIST_CHANGELOG%%/$SPECPATCHLIST_CHANGELOG/
s/%%SPECVERSION%%/$SPECVERSION/
s/%%SPECTARFILE_RELEASE%%/$SPECTARFILE_RELEASE/" "$SOURCES/$SPECFILE"
+# self-test end
 
 # We depend on work splitting of BUILDOPTS
 # shellcheck disable=SC2086
diff --git a/redhat/self-test/1006-verify-SPEC-variables.bats 
b/redhat/self-test/1006-verify-SPEC-variables.bats
new file mode 100644
index blahblah..blahblah 100644
--- /dev/null
+++ b/redhat/self-test/1006-verify-SPEC-variables.bats
@@ -0,0 +1,24 @@
+#!/usr/bin/env bats
+
+@test "verify SPEC variables" {
+# This test looks at the spec file variable replacement code in
+# redhat/genspec.sh and confirms that each variable begins with "SPEC".
+
+# This looks at the code and replaces each / with a new-line character, removes
+# any whitespace and entry entries beginning with valid "%%SPEC" or $"SPEC".
+# "$SOURCES" lines are also okay as it is used to point to the changelog and
+# the specfile.
+awk '/# self-test begin/, /# self-test end/' $BATS_TEST_DIRNAME/../genspec.sh 
| grep -v "^#" | tr "/" "\n" | tr -d "\"" | sed -r '/^\s*$/d' | grep -v 
"%%SPEC" | grep -v "\$SPEC" | grep -v "\$SOURCES" | while read LINE
+do
+   case $(echo $LINE | xargs) in
+   s) ;;
+   d) ;;
+#"sed -i -e") ;;
+   *)
+   echo " "
+   echo "ERROR: Variables passed between genspec.sh and the spec 
file must begin with %%SPEC or \$SPEC."
+   exit 1
+   ;;
+   esac
+done
+}

--
https://gitlab.com/cki-project/kernel-ark/-/merge_requests/1728
___
kernel mailing list -- kernel@lists.fedoraproject.org
To unsubscribe send an email to kernel-le...@lists.fedoraproject.org
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@lists.fedoraproject.org
Do not reply to spam on the list, report it: 
https://pagure.io/fedora-infrastructure


[OS-BUILD PATCH 12/16] redhat/genspec: Rename DEBUG_BUILDS_ENABLED to SPECDEBUG_BUILDS_ENABLED

2022-04-22 Thread Prarit Bhargava (via Email Bridge)
From: Prarit Bhargava 

redhat/genspec: Rename DEBUG_BUILDS_ENABLED to SPECDEBUG_BUILDS_ENABLED

Change DEBUG_BUILDS_ENABLED to SPECDEBUG_BUILDS_ENABLED so that readers
understand it is passed into the spec file.

Rename DEBUG_BUILDS_ENABLED to SPECDEBUG_BUILDS_ENABLED.

Signed-off-by: Prarit Bhargava 

diff --git a/redhat/genspec.sh b/redhat/genspec.sh
index blahblah..blahblah 100755
--- a/redhat/genspec.sh
+++ b/redhat/genspec.sh
@@ -17,10 +17,10 @@ UPSTREAM=$(git rev-parse -q --verify 
origin/"${UPSTREAM_BRANCH}" || \
 if [ "$SNAPSHOT" = 0 ]; then
# This is based off a tag on Linus's tree (e.g. v5.5 or v5.5-rc5).
# Two kernels are built, one with debug configuration and one without.
-   DEBUG_BUILDS_ENABLED=1
+   SPECDEBUG_BUILDS_ENABLED=1
 else
# All kernels are built with debug configurations.
-   DEBUG_BUILDS_ENABLED=0
+   SPECDEBUG_BUILDS_ENABLED=0
 fi
 
 if [ -n "$BUILDID" ]; then
@@ -67,7 +67,7 @@ test -f "$SOURCES/$SPECFILE" &&
s/%%SPECRELEASE%%/$SPECRELEASE/
s/%%SPECDISTROBUILD%%/$SPECDISTROBUILD/
s/%%RELEASED_KERNEL%%/$RELEASED_KERNEL/
-   s/%%DEBUG_BUILDS_ENABLED%%/$DEBUG_BUILDS_ENABLED/
+   s/%%SPECDEBUG_BUILDS_ENABLED%%/$SPECDEBUG_BUILDS_ENABLED/
s/%%INCLUDE_FEDORA_FILES%%/$INCLUDE_FEDORA_FILES/
s/%%INCLUDE_RHEL_FILES%%/$INCLUDE_RHEL_FILES/
s/%%PATCHLIST_CHANGELOG%%/$PATCHLIST_CHANGELOG/
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
@@ -85,7 +85,7 @@ Summary: The Linux kernel
 # Set debugbuildsenabled to 0 to not build a separate debug kernel, but
 #  to build the base kernel using the debug configuration. (Specifying
 #  the --with-release option overrides this setting.)
-%define debugbuildsenabled %%DEBUG_BUILDS_ENABLED%%
+%define debugbuildsenabled %%SPECDEBUG_BUILDS_ENABLED%%
 
 %global distro_build %%SPECDISTROBUILD%%
 

--
https://gitlab.com/cki-project/kernel-ark/-/merge_requests/1727
___
kernel mailing list -- kernel@lists.fedoraproject.org
To unsubscribe send an email to kernel-le...@lists.fedoraproject.org
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@lists.fedoraproject.org
Do not reply to spam on the list, report it: 
https://pagure.io/fedora-infrastructure


[OS-BUILD PATCH 8/16] redhat/Makefile: Rename CHANGELOG to SPECCHANGELOG

2022-04-22 Thread Prarit Bhargava (via Email Bridge)
From: Prarit Bhargava 

redhat/Makefile: Rename CHANGELOG to SPECCHANGELOG

Change CHANGELOG to SPECCHANGELOG so that readers understand it is passed
into the spec file.  While the CHANGELOG does have use other than in the
spec file it is useful to know that the string is used in the spec file.

Rename CHANGELOG to SPECKCHANGELOG.

Signed-off-by: Prarit Bhargava 

diff --git a/redhat/Makefile b/redhat/Makefile
index blahblah..blahblah 100644
--- a/redhat/Makefile
+++ b/redhat/Makefile
@@ -69,7 +69,7 @@ RPM:=$(REDHAT)/rpm
 SRPMS:=$(RPM)/SRPMS
 SOURCES:=$(RPM)/SOURCES
 TESTPATCH:=$(REDHAT)/linux-kernel-test.patch
-CHANGELOG:=$(PACKAGE_NAME).changelog-$(RHEL_MAJOR).$(RHEL_MINOR)
+SPECCHANGELOG:=$(PACKAGE_NAME).changelog-$(RHEL_MAJOR).$(RHEL_MINOR)
 CHANGELOG_PREV:=$(PACKAGE_NAME).changelog-$(RHEL_MAJOR).$(shell expr 
$(RHEL_MINOR) - 1)
 ARCH_LIST=aarch64 ppc64le s390x x86_64
 
@@ -460,14 +460,14 @@ dist-buildreq-check: setup-source
 
 setup-source: dist-git-version-check dist-clean-sources
@cp $(REDHAT)/$(SPECFILE).template $(SOURCES)/$(SPECFILE)
-   @if [ ! -e  $(REDHAT)/$(CHANGELOG) ]; then \
-   echo "Creating $(CHANGELOG) as copy of $(CHANGELOG_PREV)"; \
-   cp $(REDHAT)/$(CHANGELOG_PREV) $(REDHAT)/$(CHANGELOG); \
+   @if [ ! -e  $(REDHAT)/$(SPECCHANGELOG) ]; then \
+   echo "Creating $(SPECCHANGELOG) as copy of $(CHANGELOG_PREV)"; \
+   cp $(REDHAT)/$(CHANGELOG_PREV) $(REDHAT)/$(SPECCHANGELOG); \
fi
@if [ -z "$(RHSELFTESTDATA)" ]; then \
-   cp $(REDHAT)/$(CHANGELOG) $(SOURCES)/$(CHANGELOG); \
+   cp $(REDHAT)/$(SPECCHANGELOG) $(SOURCES)/$(SPECCHANGELOG); \
else \
-   echo "Mon Mar 28 2022 Fedora Kernel Team 
 [$(RPMVERSION)]" > $(SOURCES)/$(CHANGELOG); \
+   echo "Mon Mar 28 2022 Fedora Kernel Team 
 [$(RPMVERSION)]" > $(SOURCES)/$(SPECCHANGELOG); 
\
fi
@if [ -z "$(PATCHLIST_URL)" ]; then \
echo "Error: PATCHLIST_URL must be set (to 'none' or any URL)"; 
\
@@ -566,19 +566,19 @@ dist-rpm-baseonly: dist-sources do-rpmbuild
 
 # unless you know what you're doing, you don't want to use the next four ones
 dist-release-finish: setup-source
-   @cp $(SOURCES)/$(CHANGELOG) $(REDHAT)/$(CHANGELOG)
-   @$(GIT) add $(REDHAT)/$(CHANGELOG)
+   @cp $(SOURCES)/$(SPECCHANGELOG) $(REDHAT)/$(SPECCHANGELOG)
+   @$(GIT) add $(REDHAT)/$(SPECCHANGELOG)
@$(GIT) add $(REDHAT)/marker
-   @$(GIT) commit -s ../Makefile.rhelver $(REDHAT)/marker 
$(REDHAT)/$(CHANGELOG) $(PACKAGE_NAME).spec.template -m "[redhat] 
$(PACKAGE_NAME)-$(RPMVERSION)"
+   @$(GIT) commit -s ../Makefile.rhelver $(REDHAT)/marker 
$(REDHAT)/$(SPECCHANGELOG) $(PACKAGE_NAME).spec.template -m "[redhat] 
$(PACKAGE_NAME)-$(RPMVERSION)"
 dist-release-changed: setup-source
-   @cp $(SOURCES)/$(CHANGELOG) $(REDHAT)/$(CHANGELOG)
+   @cp $(SOURCES)/$(SPECCHANGELOG) $(REDHAT)/$(SPECCHANGELOG)
@echo $(MARKER) > $(REDHAT)/marker
@# if neither changelog nor marker was updated, skip bumping a release
@$(GIT) update-index -q --really-refresh
@if $(GIT) diff-index --quiet HEAD; then \
echo "Nothing changed, skipping updates"; \
else \
-   $(GIT) checkout -- $(REDHAT)/$(CHANGELOG); \
+   $(GIT) checkout -- $(REDHAT)/$(SPECCHANGELOG); \
$(REDHAT)/scripts/new_release.sh $(REDHAT) $(__YSTREAM) 
$(__ZSTREAM) $(BUMP_RELEASE); \
$(MAKE) dist-release-finish; \
fi
diff --git a/redhat/genspec.sh b/redhat/genspec.sh
index blahblah..blahblah 100755
--- a/redhat/genspec.sh
+++ b/redhat/genspec.sh
@@ -57,8 +57,8 @@ fi
 
 test -f "$SOURCES/$SPECFILE" &&
sed -i -e "
-   /%%CHANGELOG%%/r $SOURCES/$CHANGELOG
-   /%%CHANGELOG%%/d
+   /%%SPECCHANGELOG%%/r $SOURCES/$SPECCHANGELOG
+   /%%SPECCHANGELOG%%/d
s/%%BUILDID%%/$BUILDID_DEFINE/
s/%%SPECKVERSION%%/$SPECKVERSION/
s/%%SPECKPATCHLEVEL%%/$SPECKPATCHLEVEL/
@@ -124,7 +124,7 @@ fi
 # This means we need to zap entries that are already present in the changelog.
 if [ "$MARKER" != "$LAST_MARKER" ]; then
# awk trick to get all unique lines
-   awk '!seen[$0]++' "$SOURCES/$CHANGELOG" "$clogf" > "$clogf.unique"
+   awk '!seen[$0]++' "$SOURCES/$SPECCHANGELOG" "$clogf" > "$clogf.unique"
# sed trick to get the end of the changelog minus the line
sed -e '1,/# END OF CHANGELOG/ d' "$clogf.unique" > "$clogf.tmp"
# Add an explicit entry to indicate a rebase.
@@ -157,8 +157,8 @@ if [ "$LENGTH" = 0 ]; then
rm -f "$clogf.rev"; touch "$clogf.rev"
 fi
 
-cat "$clogf.rev" "$SOURCES/$CHANGELOG" > "$clogf.full"
-mv -f "$clogf.full" "$SOURCES/$CHANGELOG"
+cat "$clogf.rev" "$SOURCES/$SPECCHANGELOG" > "$clogf.full"
+mv -f "$clogf.full" "$SOURCES/$SPECCHANGELOG"
 
 echo "MARKER is $MARKER"
 
diff --git a/redhat/kernel.spec.template 

[OS-BUILD PATCH 11/16] redhat/Makefile: Rename DISTRO_BUILD to SPECDISTROBUILD

2022-04-22 Thread Prarit Bhargava (via Email Bridge)
From: Prarit Bhargava 

redhat/Makefile: Rename DISTRO_BUILD to SPECDISTROBUILD

Change DISTRO_BUILD to SPECDISTROBUILD so that readers understand it is passed
into the spec file.

Rename DISTRO_BUILD to SPECDISTROBUILD.

Signed-off-by: Prarit Bhargava 

diff --git a/redhat/Makefile b/redhat/Makefile
index blahblah..blahblah 100644
--- a/redhat/Makefile
+++ b/redhat/Makefile
@@ -205,10 +205,10 @@ else
 endif
 
 SPECVERSION:=$(SPECKVERSION).$(SPECKPATCHLEVEL).$(SPECKSUBLEVEL)
-DISTRO_BUILD:=$(PREBUILD)$(shell echo $(BUILD) | sed -e 
's|\(^[0-9]\{1,4\}\)\..*|\1|')
-KABI_TARBALL:=$(SOURCES)/kernel-abi-stablelists-$(SPECVERSION)-$(DISTRO_BUILD).tar.bz2
+SPECDISTROBUILD:=$(PREBUILD)$(shell echo $(BUILD) | sed -e 
's|\(^[0-9]\{1,4\}\)\..*|\1|')
+KABI_TARBALL:=$(SOURCES)/kernel-abi-stablelists-$(SPECVERSION)-$(SPECDISTROBUILD).tar.bz2
 KABIDW := $(REDHAT)/kabi-dwarf
-KABIDW_TARBALL:=$(SOURCES)/kernel-kabi-dw-$(SPECVERSION)-$(DISTRO_BUILD).tar.bz2
+KABIDW_TARBALL:=$(SOURCES)/kernel-kabi-dw-$(SPECVERSION)-$(SPECDISTROBUILD).tar.bz2
 SPECBUILD:=$(PREBUILD)$(BUILD)$(BUILDID)
 RPMVERSION:=$(SPECVERSION)-$(SPECBUILD)
 SPECRELEASE:=$(PREBUILD)$(BUILD)%{?buildid}%{?dist}
@@ -425,12 +425,12 @@ dist-tarball: $(TARBALL)
 dist-kernelrelease:
# deprecated at 5.17.0
@echo "WARNING: This target will be deprecated in a future release."
-   @echo $(PACKAGE_NAME)-$(SPECVERSION)-$(DISTRO_BUILD)
+   @echo $(PACKAGE_NAME)-$(SPECVERSION)-$(SPECDISTROBUILD)
 
 dist-kernelversion:
# deprecated at 5.17.0
@echo "WARNING: This target will be deprecated in a future release."
-   @echo $(SPECVERSION)-$(DISTRO_BUILD)
+   @echo $(SPECVERSION)-$(SPECDISTROBUILD)
 
 dist-specfile: setup-source
# deprecated at 5.17.0
diff --git a/redhat/genspec.sh b/redhat/genspec.sh
index blahblah..blahblah 100755
--- a/redhat/genspec.sh
+++ b/redhat/genspec.sh
@@ -65,7 +65,7 @@ test -f "$SOURCES/$SPECFILE" &&
s/%%SPECKPATCHLEVEL%%/$SPECKPATCHLEVEL/
s/%%SPECBUILD%%/$SPECBUILD/
s/%%SPECRELEASE%%/$SPECRELEASE/
-   s/%%DISTRO_BUILD%%/$DISTRO_BUILD/
+   s/%%SPECDISTROBUILD%%/$SPECDISTROBUILD/
s/%%RELEASED_KERNEL%%/$RELEASED_KERNEL/
s/%%DEBUG_BUILDS_ENABLED%%/$DEBUG_BUILDS_ENABLED/
s/%%INCLUDE_FEDORA_FILES%%/$INCLUDE_FEDORA_FILES/
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
@@ -87,7 +87,7 @@ Summary: The Linux kernel
 #  the --with-release option overrides this setting.)
 %define debugbuildsenabled %%DEBUG_BUILDS_ENABLED%%
 
-%global distro_build %%DISTRO_BUILD%%
+%global distro_build %%SPECDISTROBUILD%%
 
 %if 0%{?fedora}
 %define secure_boot_arch x86_64
diff --git a/redhat/self-test/data/centos-2585cf9dfaad.el7 
b/redhat/self-test/data/centos-2585cf9dfaad.el7
index blahblah..blahblah 100644
--- a/redhat/self-test/data/centos-2585cf9dfaad.el7
+++ b/redhat/self-test/data/centos-2585cf9dfaad.el7
@@ -12,7 +12,6 @@ CROSS_RPMFLAGS=rpmbuild --define "_sourcedir 
../redhat/rpm/SOURCES" --define "_b
 CURARCH=x86_64 
 DIST=.el7 
 DISTRO=centos 
-DISTRO_BUILD=0.rc5.6 
 EARLY_YBUILD= 
 EARLY_YRELEASE= 
 FLAVOR= 
@@ -55,6 +54,7 @@ SNAPSHOT=0
 SOURCES=../redhat/rpm/SOURCES 
 SPECBUILD=0.rc5.6.test 
 SPECCHANGELOG=kernel.changelog-9.99 
+SPECDISTROBUILD=0.rc5.6 
 SPECFILE=kernel.spec 
 SPECKEXTRAVERSION=-rc5 
 SPECKPATCHLEVEL=16 
diff --git a/redhat/self-test/data/centos-2585cf9dfaad.fc25 
b/redhat/self-test/data/centos-2585cf9dfaad.fc25
index blahblah..blahblah 100644
--- a/redhat/self-test/data/centos-2585cf9dfaad.fc25
+++ b/redhat/self-test/data/centos-2585cf9dfaad.fc25
@@ -12,7 +12,6 @@ CROSS_RPMFLAGS=rpmbuild --define "_sourcedir 
../redhat/rpm/SOURCES" --define "_b
 CURARCH=x86_64 
 DIST=.fc25 
 DISTRO=centos 
-DISTRO_BUILD=0.rc5.6 
 EARLY_YBUILD= 
 EARLY_YRELEASE= 
 FLAVOR= 
@@ -55,6 +54,7 @@ SNAPSHOT=0
 SOURCES=../redhat/rpm/SOURCES 
 SPECBUILD=0.rc5.6.test 
 SPECCHANGELOG=kernel.changelog-9.99 
+SPECDISTROBUILD=0.rc5.6 
 SPECFILE=kernel.spec 
 SPECKEXTRAVERSION=-rc5 
 SPECKPATCHLEVEL=16 
diff --git a/redhat/self-test/data/centos-78e36f3b0dae.el7 
b/redhat/self-test/data/centos-78e36f3b0dae.el7
index blahblah..blahblah 100644
--- a/redhat/self-test/data/centos-78e36f3b0dae.el7
+++ b/redhat/self-test/data/centos-78e36f3b0dae.el7
@@ -12,7 +12,6 @@ CROSS_RPMFLAGS=rpmbuild --define "_sourcedir 
../redhat/rpm/SOURCES" --define "_b
 CURARCH=x86_64 
 DIST=.el7 
 DISTRO=centos 
-DISTRO_BUILD=0.rc0.78e36f3b0dae586.6 
 EARLY_YBUILD= 
 EARLY_YRELEASE= 
 FLAVOR= 
@@ -55,6 +54,7 @@ SNAPSHOT=1
 SOURCES=../redhat/rpm/SOURCES 
 SPECBUILD=0.rc0.78e36f3b0dae586.6.test 
 SPECCHANGELOG=kernel.changelog-9.99 
+SPECDISTROBUILD=0.rc0.78e36f3b0dae586.6 
 SPECFILE=kernel.spec 
 SPECKEXTRAVERSION= 
 SPECKPATCHLEVEL=17 
diff --git a/redhat/self-test/data/centos-78e36f3b0dae.fc25 
b/redhat/self-test/data/centos-78e36f3b0dae.fc25
index blahblah..blahblah 100644
--- 

[OS-BUILD PATCH 5/16] redhat/Makfile: Rename RPMKPATCHLEVEL to SPECKPATCHLEVEL

2022-04-22 Thread Prarit Bhargava (via Email Bridge)
From: Prarit Bhargava 

redhat/Makfile: Rename RPMKPATCHLEVEL to SPECKPATCHLEVEL

Change RPMKPATCHLEVEL to SPECPATCHLEVEL so that readers understand it is passed
into the spec file.

Rename RPMKPATCHLEVEL to SPECKPATCHLEVEL.

Signed-off-by: Prarit Bhargava 

diff --git a/redhat/Makefile b/redhat/Makefile
index blahblah..blahblah 100644
--- a/redhat/Makefile
+++ b/redhat/Makefile
@@ -51,7 +51,7 @@ RPMBUILD:=$(shell if [ -x "/usr/bin/rpmbuild" ]; then echo 
rpmbuild; \
 
 MACH:=$(shell uname -m)
 SPECKVERSION:=$(shell $(GIT) show $(HEAD):Makefile | sed -ne '/^VERSION\ =\ 
/{s///;p;q}')
-RPMKPATCHLEVEL:=$(shell $(GIT) show $(HEAD):Makefile | sed -ne '/^PATCHLEVEL\ 
=\ /{s///;p;q}')
+SPECKPATCHLEVEL:=$(shell $(GIT) show $(HEAD):Makefile | sed -ne '/^PATCHLEVEL\ 
=\ /{s///;p;q}')
 RPMKSUBLEVEL:=$(shell $(GIT) show $(HEAD):Makefile | sed -ne '/^SUBLEVEL\ =\ 
/{s///;p;q}')
 RPMKEXTRAVERSION:=$(shell $(GIT) show $(HEAD):Makefile | sed -ne 
'/^EXTRAVERSION\ =\ /{s///;p;q}')
 GITID:= $(shell $(GIT) log --max-count=1 --pretty=format:%H $(HEAD))
@@ -131,18 +131,18 @@ ifeq ("$(origin O)", "command line")
 endif
 
 # MARKER is the git tag which we base off of for exporting patches
-# Make sure MARKER uses RPMKPATCHLEVEL and RPMKEXTRAVERSION from the kernel
+# Make sure MARKER uses SPECKPATCHLEVEL and RPMKEXTRAVERSION from the kernel
 # makefile as opposed to any adjusted version for snapshotting.
 ifneq ($(RPMKEXTRAVERSION),)
-  MARKER:=v$(SPECKVERSION).$(RPMKPATCHLEVEL)$(RPMKEXTRAVERSION)
+  MARKER:=v$(SPECKVERSION).$(SPECKPATCHLEVEL)$(RPMKEXTRAVERSION)
   KEXTRAVERSION:=$(shell echo $(RPMKEXTRAVERSION) | sed -e s/-/./)
   PREBUILD:=0$(KEXTRAVERSION).
-  UPSTREAM_TARBALL_NAME:=$(SPECKVERSION).$(RPMKPATCHLEVEL)$(RPMKEXTRAVERSION)
+  UPSTREAM_TARBALL_NAME:=$(SPECKVERSION).$(SPECKPATCHLEVEL)$(RPMKEXTRAVERSION)
 else
   KEXTRAVERSION:=
   ifeq ($(RPMKSUBLEVEL),0)
-MARKER:=v$(SPECKVERSION).$(RPMKPATCHLEVEL)
-UPSTREAM_TARBALL_NAME:=$(SPECKVERSION).$(RPMKPATCHLEVEL)
+MARKER:=v$(SPECKVERSION).$(SPECKPATCHLEVEL)
+UPSTREAM_TARBALL_NAME:=$(SPECKVERSION).$(SPECKPATCHLEVEL)
   else
 MARKER:=v$(SPECVERSION)
 UPSTREAM_TARBALL_NAME:=$(SPECVERSION)
@@ -182,7 +182,7 @@ ifeq ($(VERSION_ON_UPSTREAM),1)
 ifeq ($(RPMKEXTRAVERSION),)
   KEXTRAVERSION:=.rc0
   PREBUILD:=0$(KEXTRAVERSION).
-  RPMKPATCHLEVEL:=$(shell expr $(RPMKPATCHLEVEL) + 1)
+  SPECKPATCHLEVEL:=$(shell expr $(SPECKPATCHLEVEL) + 1)
 endif
 ifndef PREBUILD_GIT_ONLY
   ifneq ($(filter $(MAKECMDGOALS),dist-git-test dist-git),)
@@ -204,7 +204,7 @@ else
   SNAPSHOT:=0
 endif
 
-SPECVERSION:=$(SPECKVERSION).$(RPMKPATCHLEVEL).$(RPMKSUBLEVEL)
+SPECVERSION:=$(SPECKVERSION).$(SPECKPATCHLEVEL).$(RPMKSUBLEVEL)
 DISTRO_BUILD:=$(PREBUILD)$(shell echo $(BUILD) | sed -e 
's|\(^[0-9]\{1,4\}\)\..*|\1|')
 
KABI_TARBALL:=$(SOURCES)/kernel-abi-stablelists-$(SPECVERSION)-$(DISTRO_BUILD).tar.bz2
 KABIDW := $(REDHAT)/kabi-dwarf
diff --git a/redhat/genspec.sh b/redhat/genspec.sh
index blahblah..blahblah 100755
--- a/redhat/genspec.sh
+++ b/redhat/genspec.sh
@@ -61,7 +61,7 @@ test -f "$SOURCES/$SPECFILE" &&
/%%CHANGELOG%%/d
s/%%BUILDID%%/$BUILDID_DEFINE/
s/%%SPECKVERSION%%/$SPECKVERSION/
-   s/%%RPMKPATCHLEVEL%%/$RPMKPATCHLEVEL/
+   s/%%SPECKPATCHLEVEL%%/$SPECKPATCHLEVEL/
s/%%PKGRELEASE%%/$PKGRELEASE/
s/%%SPECRELEASE%%/$SPECRELEASE/
s/%%DISTRO_BUILD%%/$DISTRO_BUILD/
@@ -89,7 +89,7 @@ done
 
 echo > "$clogf"
 
-lasttag=$(git rev-list --first-parent --grep="^\[redhat\] 
kernel-${SPECKVERSION}.${RPMKPATCHLEVEL}" --max-count=1 HEAD)
+lasttag=$(git rev-list --first-parent --grep="^\[redhat\] 
kernel-${SPECKVERSION}.${SPECKPATCHLEVEL}" --max-count=1 HEAD)
 # if we didn't find the proper tag, assume this is the first release
 if [[ -z $lasttag ]]; then
 if [[ -z ${MARKER//[0-9a-f]/} ]]; then
@@ -168,12 +168,12 @@ if [ "$SINGLE_TARBALL" = 0 ]; then
# May need to preserve word splitting in EXCLUDE_FILES
# shellcheck disable=SC2086
git diff -p --no-renames --stat "$MARKER"..  $EXCLUDE_FILES \
-   > 
${SOURCES}/patch-${SPECKVERSION}.${RPMKPATCHLEVEL}-redhat.patch
+   > 
${SOURCES}/patch-${SPECKVERSION}.${SPECKPATCHLEVEL}-redhat.patch
 else
# The tarball in the SRPM contains both upstream sources and OS-specifc
# commits.  Even though this is the case, an empty file for dist-git
# compatibility is necessary.
-   touch "${SOURCES}/patch-${SPECKVERSION}.${RPMKPATCHLEVEL}"-redhat.patch
+   touch "${SOURCES}/patch-${SPECKVERSION}.${SPECKPATCHLEVEL}"-redhat.patch
 fi
 
 rm -f "$clogf"{,.rev,.stripped};
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
@@ -127,14 +127,14 @@ Summary: The Linux kernel
 %endif
 
 # The kernel tarball/base version
-%define kversion %%SPECKVERSION%%.%%RPMKPATCHLEVEL%%
+%define 

[OS-BUILD PATCH 6/16] redhat/Makfile: Rename RPMKSUBLEVEL to SPECKSUBLEVEL

2022-04-22 Thread Prarit Bhargava (via Email Bridge)
From: Prarit Bhargava 

redhat/Makfile: Rename RPMKSUBLEVEL to SPECKSUBLEVEL

Change RPMKSUBLEVEL to SPECSUBLEVEL so that readers understand it is passed
into the spec file.

Rename RPMKSUBLEVEL to SPECKSUBLEVEL.

Signed-off-by: Prarit Bhargava 

diff --git a/redhat/Makefile b/redhat/Makefile
index blahblah..blahblah 100644
--- a/redhat/Makefile
+++ b/redhat/Makefile
@@ -52,7 +52,7 @@ RPMBUILD:=$(shell if [ -x "/usr/bin/rpmbuild" ]; then echo 
rpmbuild; \
 MACH:=$(shell uname -m)
 SPECKVERSION:=$(shell $(GIT) show $(HEAD):Makefile | sed -ne '/^VERSION\ =\ 
/{s///;p;q}')
 SPECKPATCHLEVEL:=$(shell $(GIT) show $(HEAD):Makefile | sed -ne '/^PATCHLEVEL\ 
=\ /{s///;p;q}')
-RPMKSUBLEVEL:=$(shell $(GIT) show $(HEAD):Makefile | sed -ne '/^SUBLEVEL\ =\ 
/{s///;p;q}')
+SPECKSUBLEVEL:=$(shell $(GIT) show $(HEAD):Makefile | sed -ne '/^SUBLEVEL\ =\ 
/{s///;p;q}')
 RPMKEXTRAVERSION:=$(shell $(GIT) show $(HEAD):Makefile | sed -ne 
'/^EXTRAVERSION\ =\ /{s///;p;q}')
 GITID:= $(shell $(GIT) log --max-count=1 --pretty=format:%H $(HEAD))
 ifndef BUILD
@@ -140,7 +140,7 @@ ifneq ($(RPMKEXTRAVERSION),)
   UPSTREAM_TARBALL_NAME:=$(SPECKVERSION).$(SPECKPATCHLEVEL)$(RPMKEXTRAVERSION)
 else
   KEXTRAVERSION:=
-  ifeq ($(RPMKSUBLEVEL),0)
+  ifeq ($(SPECKSUBLEVEL),0)
 MARKER:=v$(SPECKVERSION).$(SPECKPATCHLEVEL)
 UPSTREAM_TARBALL_NAME:=$(SPECKVERSION).$(SPECKPATCHLEVEL)
   else
@@ -204,7 +204,7 @@ else
   SNAPSHOT:=0
 endif
 
-SPECVERSION:=$(SPECKVERSION).$(SPECKPATCHLEVEL).$(RPMKSUBLEVEL)
+SPECVERSION:=$(SPECKVERSION).$(SPECKPATCHLEVEL).$(SPECKSUBLEVEL)
 DISTRO_BUILD:=$(PREBUILD)$(shell echo $(BUILD) | sed -e 
's|\(^[0-9]\{1,4\}\)\..*|\1|')
 
KABI_TARBALL:=$(SOURCES)/kernel-abi-stablelists-$(SPECVERSION)-$(DISTRO_BUILD).tar.bz2
 KABIDW := $(REDHAT)/kabi-dwarf
diff --git a/redhat/self-test/data/centos-2585cf9dfaad.el7 
b/redhat/self-test/data/centos-2585cf9dfaad.el7
index blahblah..blahblah 100644
--- a/redhat/self-test/data/centos-2585cf9dfaad.el7
+++ b/redhat/self-test/data/centos-2585cf9dfaad.el7
@@ -51,7 +51,6 @@ RHSELFTESTDATA=1
 RPM=../redhat/rpm 
 RPMBUILD=rpmbuild 
 RPMKEXTRAVERSION=-rc5 
-RPMKSUBLEVEL=0 
 RPMVERSION=5.16.0-0.rc5.6.test 
 SHELL=/bin/sh 
 SINGLE_TARBALL=1 
@@ -59,6 +58,7 @@ SNAPSHOT=0
 SOURCES=../redhat/rpm/SOURCES 
 SPECFILE=kernel.spec 
 SPECKPATCHLEVEL=16 
+SPECKSUBLEVEL=0 
 SPECKVERSION=5 
 SPECRELEASE=0.rc5.6%{?buildid}%{?dist} 
 SPECVERSION=5.16.0 
diff --git a/redhat/self-test/data/centos-2585cf9dfaad.fc25 
b/redhat/self-test/data/centos-2585cf9dfaad.fc25
index blahblah..blahblah 100644
--- a/redhat/self-test/data/centos-2585cf9dfaad.fc25
+++ b/redhat/self-test/data/centos-2585cf9dfaad.fc25
@@ -51,7 +51,6 @@ RHSELFTESTDATA=1
 RPM=../redhat/rpm 
 RPMBUILD=rpmbuild 
 RPMKEXTRAVERSION=-rc5 
-RPMKSUBLEVEL=0 
 RPMVERSION=5.16.0-0.rc5.6.test 
 SHELL=/bin/sh 
 SINGLE_TARBALL=1 
@@ -59,6 +58,7 @@ SNAPSHOT=0
 SOURCES=../redhat/rpm/SOURCES 
 SPECFILE=kernel.spec 
 SPECKPATCHLEVEL=16 
+SPECKSUBLEVEL=0 
 SPECKVERSION=5 
 SPECRELEASE=0.rc5.6%{?buildid}%{?dist} 
 SPECVERSION=5.16.0 
diff --git a/redhat/self-test/data/centos-78e36f3b0dae.el7 
b/redhat/self-test/data/centos-78e36f3b0dae.el7
index blahblah..blahblah 100644
--- a/redhat/self-test/data/centos-78e36f3b0dae.el7
+++ b/redhat/self-test/data/centos-78e36f3b0dae.el7
@@ -51,7 +51,6 @@ RHSELFTESTDATA=1
 RPM=../redhat/rpm 
 RPMBUILD=rpmbuild 
 RPMKEXTRAVERSION= 
-RPMKSUBLEVEL=0 
 RPMVERSION=5.17.0-0.rc0.78e36f3b0dae586.6.test 
 SHELL=/bin/sh 
 SINGLE_TARBALL=1 
@@ -59,6 +58,7 @@ SNAPSHOT=1
 SOURCES=../redhat/rpm/SOURCES 
 SPECFILE=kernel.spec 
 SPECKPATCHLEVEL=17 
+SPECKSUBLEVEL=0 
 SPECKVERSION=5 
 SPECRELEASE=0.rc0.78e36f3b0dae586.6%{?buildid}%{?dist} 
 SPECVERSION=5.17.0 
diff --git a/redhat/self-test/data/centos-78e36f3b0dae.fc25 
b/redhat/self-test/data/centos-78e36f3b0dae.fc25
index blahblah..blahblah 100644
--- a/redhat/self-test/data/centos-78e36f3b0dae.fc25
+++ b/redhat/self-test/data/centos-78e36f3b0dae.fc25
@@ -51,7 +51,6 @@ RHSELFTESTDATA=1
 RPM=../redhat/rpm 
 RPMBUILD=rpmbuild 
 RPMKEXTRAVERSION= 
-RPMKSUBLEVEL=0 
 RPMVERSION=5.17.0-0.rc0.78e36f3b0dae586.6.test 
 SHELL=/bin/sh 
 SINGLE_TARBALL=1 
@@ -59,6 +58,7 @@ SNAPSHOT=1
 SOURCES=../redhat/rpm/SOURCES 
 SPECFILE=kernel.spec 
 SPECKPATCHLEVEL=17 
+SPECKSUBLEVEL=0 
 SPECKVERSION=5 
 SPECRELEASE=0.rc0.78e36f3b0dae586.6%{?buildid}%{?dist} 
 SPECVERSION=5.17.0 
diff --git a/redhat/self-test/data/centos-df0cc57e057f.el7 
b/redhat/self-test/data/centos-df0cc57e057f.el7
index blahblah..blahblah 100644
--- a/redhat/self-test/data/centos-df0cc57e057f.el7
+++ b/redhat/self-test/data/centos-df0cc57e057f.el7
@@ -51,7 +51,6 @@ RHSELFTESTDATA=1
 RPM=../redhat/rpm 
 RPMBUILD=rpmbuild 
 RPMKEXTRAVERSION= 
-RPMKSUBLEVEL=0 
 RPMVERSION=5.16.0-6.test 
 SHELL=/bin/sh 
 SINGLE_TARBALL=1 
@@ -59,6 +58,7 @@ SNAPSHOT=0
 SOURCES=../redhat/rpm/SOURCES 
 SPECFILE=kernel.spec 
 SPECKPATCHLEVEL=16 
+SPECKSUBLEVEL=0 
 SPECKVERSION=5 
 SPECRELEASE=6%{?buildid}%{?dist} 
 SPECVERSION=5.16.0 
diff --git 

[OS-BUILD PATCH 10/16] redhat/Makefile: Rename PKGRELEASE to SPECBUILD

2022-04-22 Thread Prarit Bhargava (via Email Bridge)
From: Prarit Bhargava 

redhat/Makefile: Rename PKGRELEASE to SPECBUILD

PKGRELEASE is a confusing variable name, and it really is the BUILD string
for the specfile.

Rename PKGRELEASE to SPECBUILD.

Signed-off-by: Prarit Bhargava 

diff --git a/redhat/Makefile b/redhat/Makefile
index blahblah..blahblah 100644
--- a/redhat/Makefile
+++ b/redhat/Makefile
@@ -209,8 +209,8 @@ DISTRO_BUILD:=$(PREBUILD)$(shell echo $(BUILD) | sed -e 
's|\(^[0-9]\{1,4\}\)\..*
 
KABI_TARBALL:=$(SOURCES)/kernel-abi-stablelists-$(SPECVERSION)-$(DISTRO_BUILD).tar.bz2
 KABIDW := $(REDHAT)/kabi-dwarf
 
KABIDW_TARBALL:=$(SOURCES)/kernel-kabi-dw-$(SPECVERSION)-$(DISTRO_BUILD).tar.bz2
-PKGRELEASE:=$(PREBUILD)$(BUILD)$(BUILDID)
-RPMVERSION:=$(SPECVERSION)-$(PKGRELEASE)
+SPECBUILD:=$(PREBUILD)$(BUILD)$(BUILDID)
+RPMVERSION:=$(SPECVERSION)-$(SPECBUILD)
 SPECRELEASE:=$(PREBUILD)$(BUILD)%{?buildid}%{?dist}
 SRPM:=$(SRPMS)/$(PACKAGE_NAME)-$(RPMVERSION)$(DIST).src.rpm
 
@@ -620,9 +620,9 @@ dist-fedora-release-push: dist-fedora-release
 dist-vr-check:
@# builds may include a s390x+zfcpdump arch build.  UTS_RELEASE can 
only have a
@# version-release string with max 64 chars.  The version-release for 
s390x+zfcpdump
-   @# is 29 characters, leaving a maximum of 35 characters for PKGRELEASE.
-   @if [ $$(echo -n $(PKGRELEASE) | wc -c) -gt 35 ]; then \
-   echo "PKGRELEASE ($(PKGRELEASE)) is too long.  Use a shorter 
localversion (currently $(BUILDID))"; \
+   @# is 29 characters, leaving a maximum of 35 characters for SPECBUILD.
+   @if [ $$(echo -n $(SPECBUILD) | wc -c) -gt 35 ]; then \
+   echo "SPECBUILD ($(SPECBUILD)) is too long.  Use a shorter 
localversion (currently $(BUILDID))"; \
exit 1; \
fi
 
diff --git a/redhat/Makefile.variables b/redhat/Makefile.variables
index blahblah..blahblah 100644
--- a/redhat/Makefile.variables
+++ b/redhat/Makefile.variables
@@ -100,7 +100,7 @@ BUILD ?=
 
 # Builds may include a s390x+zfcpdump arch build, which results in the build
 # failing because the UTS_RELEASE field exceeded 64 chars.  This variable can
-# be set to 1 to decrease the kernel UTS_RELEASE and PKGRELEASE by 11 
characters
+# be set to 1 to decrease the kernel UTS_RELEASE and SPECBUILD by 11 characters
 # (MMDDgit).
 PREBUILD_GIT_ONLY ?=
 
diff --git a/redhat/genspec.sh b/redhat/genspec.sh
index blahblah..blahblah 100755
--- a/redhat/genspec.sh
+++ b/redhat/genspec.sh
@@ -1,4 +1,5 @@
 #!/bin/bash
+# shellcheck disable=SC2153
 
 LAST_MARKER=$(cat "${REDHAT}"/marker)
 clogf="$SOURCES/changelog"
@@ -62,7 +63,7 @@ test -f "$SOURCES/$SPECFILE" &&
s/%%SPECBUILDID%%/$SPECBUILDID/
s/%%SPECKVERSION%%/$SPECKVERSION/
s/%%SPECKPATCHLEVEL%%/$SPECKPATCHLEVEL/
-   s/%%PKGRELEASE%%/$PKGRELEASE/
+   s/%%SPECBUILD%%/$SPECBUILD/
s/%%SPECRELEASE%%/$SPECRELEASE/
s/%%DISTRO_BUILD%%/$DISTRO_BUILD/
s/%%RELEASED_KERNEL%%/$RELEASED_KERNEL/
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
@@ -131,7 +131,7 @@ Summary: The Linux kernel
 
 %define specversion %%SPECVERSION%%
 %define patchversion %%SPECKVERSION%%.%%SPECKPATCHLEVEL%%
-%define pkgrelease %%PKGRELEASE%%
+%define pkgrelease %%SPECBUILD%%
 
 # This is needed to do merge window version magic
 %define patchlevel %%SPECKPATCHLEVEL%%
diff --git a/redhat/self-test/data/centos-2585cf9dfaad.el7 
b/redhat/self-test/data/centos-2585cf9dfaad.el7
index blahblah..blahblah 100644
--- a/redhat/self-test/data/centos-2585cf9dfaad.el7
+++ b/redhat/self-test/data/centos-2585cf9dfaad.el7
@@ -33,7 +33,6 @@ MAKEFILE_LIST=Makefile Makefile.variables ../Makefile.rhelver 
Makefile.rhpkg Mak
 MAKEFLAGS=w -- HEAD=2585cf9dfaad DISTRO=centos DIST=.el7 RHSELFTESTDATA=1 
 MARKER=v5.16-rc5 
 MERGE_BASE=2585cf9dfaaddf00b069673f27bb3f8530e2039c 
-PKGRELEASE=0.rc5.6.test 
 PREBUILD=0.rc5. 
 PROCESS_CONFIGS_CHECK_OPTS=-n -t -c 
 PROCESS_CONFIGS_OPTS=-n -w -c 
@@ -54,6 +53,7 @@ SHELL=/bin/sh
 SINGLE_TARBALL=1 
 SNAPSHOT=0 
 SOURCES=../redhat/rpm/SOURCES 
+SPECBUILD=0.rc5.6.test 
 SPECCHANGELOG=kernel.changelog-9.99 
 SPECFILE=kernel.spec 
 SPECKEXTRAVERSION=-rc5 
diff --git a/redhat/self-test/data/centos-2585cf9dfaad.fc25 
b/redhat/self-test/data/centos-2585cf9dfaad.fc25
index blahblah..blahblah 100644
--- a/redhat/self-test/data/centos-2585cf9dfaad.fc25
+++ b/redhat/self-test/data/centos-2585cf9dfaad.fc25
@@ -33,7 +33,6 @@ MAKEFILE_LIST=Makefile Makefile.variables ../Makefile.rhelver 
Makefile.rhpkg Mak
 MAKEFLAGS=w -- HEAD=2585cf9dfaad DISTRO=centos DIST=.fc25 RHSELFTESTDATA=1 
 MARKER=v5.16-rc5 
 MERGE_BASE=2585cf9dfaaddf00b069673f27bb3f8530e2039c 
-PKGRELEASE=0.rc5.6.test 
 PREBUILD=0.rc5. 
 PROCESS_CONFIGS_CHECK_OPTS=-n -t -c 
 PROCESS_CONFIGS_OPTS=-n -w -c 
@@ -54,6 +53,7 @@ SHELL=/bin/sh
 SINGLE_TARBALL=1 
 SNAPSHOT=0 
 SOURCES=../redhat/rpm/SOURCES 
+SPECBUILD=0.rc5.6.test 
 

[OS-BUILD PATCH 7/16] redhat/Makfile: Rename RPMKEXTRAVERSION to SPECKEXTRAVERSION

2022-04-22 Thread Prarit Bhargava (via Email Bridge)
From: Prarit Bhargava 

redhat/Makfile: Rename RPMKEXTRAVERSION to SPECKEXTRAVERSION

Change RPMKEXTRAVERSION to SPECEXTRAVERSION so that readers understand it is 
passed
into the spec file.

Rename RPMKEXTRAVERSION to SPECKEXTRAVERSION.

Signed-off-by: Prarit Bhargava 

diff --git a/redhat/Makefile b/redhat/Makefile
index blahblah..blahblah 100644
--- a/redhat/Makefile
+++ b/redhat/Makefile
@@ -53,7 +53,7 @@ MACH:=$(shell uname -m)
 SPECKVERSION:=$(shell $(GIT) show $(HEAD):Makefile | sed -ne '/^VERSION\ =\ 
/{s///;p;q}')
 SPECKPATCHLEVEL:=$(shell $(GIT) show $(HEAD):Makefile | sed -ne '/^PATCHLEVEL\ 
=\ /{s///;p;q}')
 SPECKSUBLEVEL:=$(shell $(GIT) show $(HEAD):Makefile | sed -ne '/^SUBLEVEL\ =\ 
/{s///;p;q}')
-RPMKEXTRAVERSION:=$(shell $(GIT) show $(HEAD):Makefile | sed -ne 
'/^EXTRAVERSION\ =\ /{s///;p;q}')
+SPECKEXTRAVERSION:=$(shell $(GIT) show $(HEAD):Makefile | sed -ne 
'/^EXTRAVERSION\ =\ /{s///;p;q}')
 GITID:= $(shell $(GIT) log --max-count=1 --pretty=format:%H $(HEAD))
 ifndef BUILD
   BUILD:=$(RHEL_RELEASE)
@@ -131,13 +131,13 @@ ifeq ("$(origin O)", "command line")
 endif
 
 # MARKER is the git tag which we base off of for exporting patches
-# Make sure MARKER uses SPECKPATCHLEVEL and RPMKEXTRAVERSION from the kernel
+# Make sure MARKER uses SPECKPATCHLEVEL and SPECKEXTRAVERSION from the kernel
 # makefile as opposed to any adjusted version for snapshotting.
-ifneq ($(RPMKEXTRAVERSION),)
-  MARKER:=v$(SPECKVERSION).$(SPECKPATCHLEVEL)$(RPMKEXTRAVERSION)
-  KEXTRAVERSION:=$(shell echo $(RPMKEXTRAVERSION) | sed -e s/-/./)
+ifneq ($(SPECKEXTRAVERSION),)
+  MARKER:=v$(SPECKVERSION).$(SPECKPATCHLEVEL)$(SPECKEXTRAVERSION)
+  KEXTRAVERSION:=$(shell echo $(SPECKEXTRAVERSION) | sed -e s/-/./)
   PREBUILD:=0$(KEXTRAVERSION).
-  UPSTREAM_TARBALL_NAME:=$(SPECKVERSION).$(SPECKPATCHLEVEL)$(RPMKEXTRAVERSION)
+  UPSTREAM_TARBALL_NAME:=$(SPECKVERSION).$(SPECKPATCHLEVEL)$(SPECKEXTRAVERSION)
 else
   KEXTRAVERSION:=
   ifeq ($(SPECKSUBLEVEL),0)
@@ -179,7 +179,7 @@ ifeq ($(VERSION_ON_UPSTREAM),1)
 # been updated but we still need something that works for
 # packaging. Fix this by bumping the patch level and marking
 # this as rc0
-ifeq ($(RPMKEXTRAVERSION),)
+ifeq ($(SPECKEXTRAVERSION),)
   KEXTRAVERSION:=.rc0
   PREBUILD:=0$(KEXTRAVERSION).
   SPECKPATCHLEVEL:=$(shell expr $(SPECKPATCHLEVEL) + 1)
diff --git a/redhat/self-test/data/centos-2585cf9dfaad.el7 
b/redhat/self-test/data/centos-2585cf9dfaad.el7
index blahblah..blahblah 100644
--- a/redhat/self-test/data/centos-2585cf9dfaad.el7
+++ b/redhat/self-test/data/centos-2585cf9dfaad.el7
@@ -50,13 +50,13 @@ RHPKG_BIN=centpkg
 RHSELFTESTDATA=1 
 RPM=../redhat/rpm 
 RPMBUILD=rpmbuild 
-RPMKEXTRAVERSION=-rc5 
 RPMVERSION=5.16.0-0.rc5.6.test 
 SHELL=/bin/sh 
 SINGLE_TARBALL=1 
 SNAPSHOT=0 
 SOURCES=../redhat/rpm/SOURCES 
 SPECFILE=kernel.spec 
+SPECKEXTRAVERSION=-rc5 
 SPECKPATCHLEVEL=16 
 SPECKSUBLEVEL=0 
 SPECKVERSION=5 
diff --git a/redhat/self-test/data/centos-2585cf9dfaad.fc25 
b/redhat/self-test/data/centos-2585cf9dfaad.fc25
index blahblah..blahblah 100644
--- a/redhat/self-test/data/centos-2585cf9dfaad.fc25
+++ b/redhat/self-test/data/centos-2585cf9dfaad.fc25
@@ -50,13 +50,13 @@ RHPKG_BIN=centpkg
 RHSELFTESTDATA=1 
 RPM=../redhat/rpm 
 RPMBUILD=rpmbuild 
-RPMKEXTRAVERSION=-rc5 
 RPMVERSION=5.16.0-0.rc5.6.test 
 SHELL=/bin/sh 
 SINGLE_TARBALL=1 
 SNAPSHOT=0 
 SOURCES=../redhat/rpm/SOURCES 
 SPECFILE=kernel.spec 
+SPECKEXTRAVERSION=-rc5 
 SPECKPATCHLEVEL=16 
 SPECKSUBLEVEL=0 
 SPECKVERSION=5 
diff --git a/redhat/self-test/data/centos-78e36f3b0dae.el7 
b/redhat/self-test/data/centos-78e36f3b0dae.el7
index blahblah..blahblah 100644
--- a/redhat/self-test/data/centos-78e36f3b0dae.el7
+++ b/redhat/self-test/data/centos-78e36f3b0dae.el7
@@ -50,13 +50,13 @@ RHPKG_BIN=centpkg
 RHSELFTESTDATA=1 
 RPM=../redhat/rpm 
 RPMBUILD=rpmbuild 
-RPMKEXTRAVERSION= 
 RPMVERSION=5.17.0-0.rc0.78e36f3b0dae586.6.test 
 SHELL=/bin/sh 
 SINGLE_TARBALL=1 
 SNAPSHOT=1 
 SOURCES=../redhat/rpm/SOURCES 
 SPECFILE=kernel.spec 
+SPECKEXTRAVERSION= 
 SPECKPATCHLEVEL=17 
 SPECKSUBLEVEL=0 
 SPECKVERSION=5 
diff --git a/redhat/self-test/data/centos-78e36f3b0dae.fc25 
b/redhat/self-test/data/centos-78e36f3b0dae.fc25
index blahblah..blahblah 100644
--- a/redhat/self-test/data/centos-78e36f3b0dae.fc25
+++ b/redhat/self-test/data/centos-78e36f3b0dae.fc25
@@ -50,13 +50,13 @@ RHPKG_BIN=centpkg
 RHSELFTESTDATA=1 
 RPM=../redhat/rpm 
 RPMBUILD=rpmbuild 
-RPMKEXTRAVERSION= 
 RPMVERSION=5.17.0-0.rc0.78e36f3b0dae586.6.test 
 SHELL=/bin/sh 
 SINGLE_TARBALL=1 
 SNAPSHOT=1 
 SOURCES=../redhat/rpm/SOURCES 
 SPECFILE=kernel.spec 
+SPECKEXTRAVERSION= 
 SPECKPATCHLEVEL=17 
 SPECKSUBLEVEL=0 
 SPECKVERSION=5 
diff --git a/redhat/self-test/data/centos-df0cc57e057f.el7 
b/redhat/self-test/data/centos-df0cc57e057f.el7
index blahblah..blahblah 100644
--- a/redhat/self-test/data/centos-df0cc57e057f.el7
+++ b/redhat/self-test/data/centos-df0cc57e057f.el7
@@ -50,13 +50,13 @@ RHPKG_BIN=centpkg
 

[OS-BUILD PATCH 4/16] redhat/Makefile: Rename RPMKVERSION to SPECKVERSION

2022-04-22 Thread Prarit Bhargava (via Email Bridge)
From: Prarit Bhargava 

redhat/Makefile: Rename RPMKVERSION to SPECKVERSION

Change RPMKVERSION to SPECVERSION so that readers understand it is passed
into the spec file.

Rename RPMKVERSION to SPECKVERSION.

Signed-off-by: Prarit Bhargava 

diff --git a/redhat/Makefile b/redhat/Makefile
index blahblah..blahblah 100644
--- a/redhat/Makefile
+++ b/redhat/Makefile
@@ -50,7 +50,7 @@ RPMBUILD:=$(shell if [ -x "/usr/bin/rpmbuild" ]; then echo 
rpmbuild; \
   else echo rpm; fi)
 
 MACH:=$(shell uname -m)
-RPMKVERSION:=$(shell $(GIT) show $(HEAD):Makefile | sed -ne '/^VERSION\ =\ 
/{s///;p;q}')
+SPECKVERSION:=$(shell $(GIT) show $(HEAD):Makefile | sed -ne '/^VERSION\ =\ 
/{s///;p;q}')
 RPMKPATCHLEVEL:=$(shell $(GIT) show $(HEAD):Makefile | sed -ne '/^PATCHLEVEL\ 
=\ /{s///;p;q}')
 RPMKSUBLEVEL:=$(shell $(GIT) show $(HEAD):Makefile | sed -ne '/^SUBLEVEL\ =\ 
/{s///;p;q}')
 RPMKEXTRAVERSION:=$(shell $(GIT) show $(HEAD):Makefile | sed -ne 
'/^EXTRAVERSION\ =\ /{s///;p;q}')
@@ -134,15 +134,15 @@ endif
 # Make sure MARKER uses RPMKPATCHLEVEL and RPMKEXTRAVERSION from the kernel
 # makefile as opposed to any adjusted version for snapshotting.
 ifneq ($(RPMKEXTRAVERSION),)
-  MARKER:=v$(RPMKVERSION).$(RPMKPATCHLEVEL)$(RPMKEXTRAVERSION)
+  MARKER:=v$(SPECKVERSION).$(RPMKPATCHLEVEL)$(RPMKEXTRAVERSION)
   KEXTRAVERSION:=$(shell echo $(RPMKEXTRAVERSION) | sed -e s/-/./)
   PREBUILD:=0$(KEXTRAVERSION).
-  UPSTREAM_TARBALL_NAME:=$(RPMKVERSION).$(RPMKPATCHLEVEL)$(RPMKEXTRAVERSION)
+  UPSTREAM_TARBALL_NAME:=$(SPECKVERSION).$(RPMKPATCHLEVEL)$(RPMKEXTRAVERSION)
 else
   KEXTRAVERSION:=
   ifeq ($(RPMKSUBLEVEL),0)
-MARKER:=v$(RPMKVERSION).$(RPMKPATCHLEVEL)
-UPSTREAM_TARBALL_NAME:=$(RPMKVERSION).$(RPMKPATCHLEVEL)
+MARKER:=v$(SPECKVERSION).$(RPMKPATCHLEVEL)
+UPSTREAM_TARBALL_NAME:=$(SPECKVERSION).$(RPMKPATCHLEVEL)
   else
 MARKER:=v$(SPECVERSION)
 UPSTREAM_TARBALL_NAME:=$(SPECVERSION)
@@ -204,7 +204,7 @@ else
   SNAPSHOT:=0
 endif
 
-SPECVERSION:=$(RPMKVERSION).$(RPMKPATCHLEVEL).$(RPMKSUBLEVEL)
+SPECVERSION:=$(SPECKVERSION).$(RPMKPATCHLEVEL).$(RPMKSUBLEVEL)
 DISTRO_BUILD:=$(PREBUILD)$(shell echo $(BUILD) | sed -e 
's|\(^[0-9]\{1,4\}\)\..*|\1|')
 
KABI_TARBALL:=$(SOURCES)/kernel-abi-stablelists-$(SPECVERSION)-$(DISTRO_BUILD).tar.bz2
 KABIDW := $(REDHAT)/kabi-dwarf
diff --git a/redhat/genspec.sh b/redhat/genspec.sh
index blahblah..blahblah 100755
--- a/redhat/genspec.sh
+++ b/redhat/genspec.sh
@@ -60,7 +60,7 @@ test -f "$SOURCES/$SPECFILE" &&
/%%CHANGELOG%%/r $SOURCES/$CHANGELOG
/%%CHANGELOG%%/d
s/%%BUILDID%%/$BUILDID_DEFINE/
-   s/%%RPMKVERSION%%/$RPMKVERSION/
+   s/%%SPECKVERSION%%/$SPECKVERSION/
s/%%RPMKPATCHLEVEL%%/$RPMKPATCHLEVEL/
s/%%PKGRELEASE%%/$PKGRELEASE/
s/%%SPECRELEASE%%/$SPECRELEASE/
@@ -89,7 +89,7 @@ done
 
 echo > "$clogf"
 
-lasttag=$(git rev-list --first-parent --grep="^\[redhat\] 
kernel-${RPMKVERSION}.${RPMKPATCHLEVEL}" --max-count=1 HEAD)
+lasttag=$(git rev-list --first-parent --grep="^\[redhat\] 
kernel-${SPECKVERSION}.${RPMKPATCHLEVEL}" --max-count=1 HEAD)
 # if we didn't find the proper tag, assume this is the first release
 if [[ -z $lasttag ]]; then
 if [[ -z ${MARKER//[0-9a-f]/} ]]; then
@@ -168,12 +168,12 @@ if [ "$SINGLE_TARBALL" = 0 ]; then
# May need to preserve word splitting in EXCLUDE_FILES
# shellcheck disable=SC2086
git diff -p --no-renames --stat "$MARKER"..  $EXCLUDE_FILES \
-   > ${SOURCES}/patch-${RPMKVERSION}.${RPMKPATCHLEVEL}-redhat.patch
+   > 
${SOURCES}/patch-${SPECKVERSION}.${RPMKPATCHLEVEL}-redhat.patch
 else
# The tarball in the SRPM contains both upstream sources and OS-specifc
# commits.  Even though this is the case, an empty file for dist-git
# compatibility is necessary.
-   touch "${SOURCES}/patch-${RPMKVERSION}.${RPMKPATCHLEVEL}"-redhat.patch
+   touch "${SOURCES}/patch-${SPECKVERSION}.${RPMKPATCHLEVEL}"-redhat.patch
 fi
 
 rm -f "$clogf"{,.rev,.stripped};
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
@@ -127,10 +127,10 @@ Summary: The Linux kernel
 %endif
 
 # The kernel tarball/base version
-%define kversion %%RPMKVERSION%%.%%RPMKPATCHLEVEL%%
+%define kversion %%SPECKVERSION%%.%%RPMKPATCHLEVEL%%
 
 %define specversion %%SPECVERSION%%
-%define patchversion %%RPMKVERSION%%.%%RPMKPATCHLEVEL%%
+%define patchversion %%SPECKVERSION%%.%%RPMKPATCHLEVEL%%
 %define pkgrelease %%PKGRELEASE%%
 
 # This is needed to do merge window version magic
@@ -1357,7 +1357,7 @@ ApplyPatch()
 exit 1
   fi
   if ! grep -E "^Patch[0-9]+: $patch\$" %{_specdir}/${RPM_PACKAGE_NAME}.spec ; 
then
-if [ "${patch:0:8}" != "patch-%%RPMKVERSION%%." ] ; then
+if [ "${patch:0:8}" != "patch-%%SPECKVERSION%%." ] ; then
   echo "ERROR: Patch  $patch  not listed as a source patch in specfile"
   exit 

[OS-BUILD PATCH 0/16] redhat: Use SPEC variable naming

2022-04-22 Thread Prarit Bhargava (via Email Bridge)
From: Prarit Bhargava on gitlab.com
Merge Request: https://gitlab.com/cki-project/kernel-ark/-/merge_requests/1727

Depends: https://gitlab.com/cki-project/kernel-ark/-/merge_requests/1647

One of the common complaints about the redhat Makefiles, genspec.sh, and
kernel.spec.template is that it is not possible to determine which
variables are being used in the Makefiles and which are being used in the
kernel.spec.template.

This changeset introduces a convention of prefixing all variables used in
the kernel.spec.template with SPEC so that knowledgeable readers can track
variable use and see how variable changes affect the kernel spec file.

Signed-off-by: Prarit Bhargava 

---
 redhat/configs/generate_all_configs.sh  |2 +-
 redhat/docs/makefile-changes.rst|8 +-
 redhat/scripts/create-tarball.sh|2 +-
 redhat/self-test/data/centos-2585cf9dfaad.el7   |   21 ++-
 redhat/self-test/data/centos-2585cf9dfaad.el7.spec  |   24 ++--
 redhat/self-test/data/centos-2585cf9dfaad.fc25  |   21 ++-
 redhat/self-test/data/centos-2585cf9dfaad.fc25.spec |   24 ++--
 redhat/self-test/data/centos-78e36f3b0dae.el7   |   21 ++-
 redhat/self-test/data/centos-78e36f3b0dae.el7.spec  |   24 ++--
 redhat/self-test/data/centos-78e36f3b0dae.fc25  |   21 ++-
 redhat/self-test/data/centos-78e36f3b0dae.fc25.spec |   24 ++--
 redhat/self-test/data/centos-df0cc57e057f.el7   |   21 ++-
 redhat/self-test/data/centos-df0cc57e057f.el7.spec  |   24 ++--
 redhat/self-test/data/centos-df0cc57e057f.fc25  |   21 ++-
 redhat/self-test/data/centos-df0cc57e057f.fc25.spec |   24 ++--
 redhat/self-test/data/centos-fce15c45d3fb.el7   |   21 ++-
 redhat/self-test/data/centos-fce15c45d3fb.el7.spec  |   24 ++--
 redhat/self-test/data/centos-fce15c45d3fb.fc25  |   21 ++-
 redhat/self-test/data/centos-fce15c45d3fb.fc25.spec |   24 ++--
 redhat/self-test/data/fedora-2585cf9dfaad.el7   |   21 ++-
 redhat/self-test/data/fedora-2585cf9dfaad.el7.spec  |   24 ++--
 redhat/self-test/data/fedora-2585cf9dfaad.fc25  |   21 ++-
 redhat/self-test/data/fedora-2585cf9dfaad.fc25.spec |   24 ++--
 redhat/self-test/data/fedora-78e36f3b0dae.el7   |   21 ++-
 redhat/self-test/data/fedora-78e36f3b0dae.el7.spec  |   24 ++--
 redhat/self-test/data/fedora-78e36f3b0dae.fc25  |   21 ++-
 redhat/self-test/data/fedora-78e36f3b0dae.fc25.spec |   24 ++--
 redhat/self-test/data/fedora-df0cc57e057f.el7   |   21 ++-
 redhat/self-test/data/fedora-df0cc57e057f.el7.spec  |   24 ++--
 redhat/self-test/data/fedora-df0cc57e057f.fc25  |   21 ++-
 redhat/self-test/data/fedora-df0cc57e057f.fc25.spec |   24 ++--
 redhat/self-test/data/fedora-fce15c45d3fb.el7   |   21 ++-
 redhat/self-test/data/fedora-fce15c45d3fb.el7.spec  |   24 ++--
 redhat/self-test/data/fedora-fce15c45d3fb.fc25  |   21 ++-
 redhat/self-test/data/fedora-fce15c45d3fb.fc25.spec |   24 ++--
 redhat/self-test/data/rhel-2585cf9dfaad.el7 |   21 ++-
 redhat/self-test/data/rhel-2585cf9dfaad.el7.spec|   24 ++--
 redhat/self-test/data/rhel-2585cf9dfaad.fc25|   21 ++-
 redhat/self-test/data/rhel-2585cf9dfaad.fc25.spec   |   24 ++--
 redhat/self-test/data/rhel-78e36f3b0dae.el7 |   21 ++-
 redhat/self-test/data/rhel-78e36f3b0dae.el7.spec|   24 ++--
 redhat/self-test/data/rhel-78e36f3b0dae.fc25|   21 ++-
 redhat/self-test/data/rhel-78e36f3b0dae.fc25.spec   |   24 ++--
 redhat/self-test/data/rhel-df0cc57e057f.el7 |   21 ++-
 redhat/self-test/data/rhel-df0cc57e057f.el7.spec|   24 ++--
 redhat/self-test/data/rhel-df0cc57e057f.fc25|   21 ++-
 redhat/self-test/data/rhel-df0cc57e057f.fc25.spec   |   24 ++--
 redhat/self-test/data/rhel-fce15c45d3fb.el7 |   21 ++-
 redhat/self-test/data/rhel-fce15c45d3fb.el7.spec|   24 ++--
 redhat/self-test/data/rhel-fce15c45d3fb.fc25|   21 ++-
 redhat/self-test/data/rhel-fce15c45d3fb.fc25.spec   |   24 ++--
 redhat/self-test/1006-verify-SPEC-variables.bats|   24 
 redhat/Makefile |  102 +++
 redhat/Makefile.variables   |2 +-
 redhat/genspec.sh   |   55 +-
 redhat/kernel.spec.template |   56 +-
 56 files changed, 725 insertions(+), 606 deletions(-)
___
kernel mailing list -- kernel@lists.fedoraproject.org
To unsubscribe send an email to kernel-le...@lists.fedoraproject.org
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@lists.fedoraproject.org
Do not reply to spam on the list, report it: 
https://pagure.io/fedora-infrastructure


[OS-BUILD PATCH 9/16] redhat/genspec: Rename BUILDID_DEFINE to SPECBUILDID

2022-04-22 Thread Prarit Bhargava (via Email Bridge)
From: Prarit Bhargava 

redhat/genspec: Rename BUILDID_DEFINE to SPECBUILDID

Change BUILDID_DEFINE to SPECBUILDID so that readers understand it is passed
into the spec file.

Rename BUILDID_DEFINE to SPECBUILDID.

Signed-off-by: Prarit Bhargava 

diff --git a/redhat/genspec.sh b/redhat/genspec.sh
index blahblah..blahblah 100755
--- a/redhat/genspec.sh
+++ b/redhat/genspec.sh
@@ -23,9 +23,9 @@ else
 fi
 
 if [ -n "$BUILDID" ]; then
-   BUILDID_DEFINE=$(printf "%%define buildid %s" "$BUILDID")
+   SPECBUILDID=$(printf "%%define buildid %s" "$BUILDID")
 else
-   BUILDID_DEFINE="# define buildid .local"
+   SPECBUILDID="# define buildid .local"
 fi
 
 EXCLUDE_FILES=":(exclude,top).get_maintainer.conf \
@@ -59,7 +59,7 @@ test -f "$SOURCES/$SPECFILE" &&
sed -i -e "
/%%SPECCHANGELOG%%/r $SOURCES/$SPECCHANGELOG
/%%SPECCHANGELOG%%/d
-   s/%%BUILDID%%/$BUILDID_DEFINE/
+   s/%%SPECBUILDID%%/$SPECBUILDID/
s/%%SPECKVERSION%%/$SPECKVERSION/
s/%%SPECKPATCHLEVEL%%/$SPECKPATCHLEVEL/
s/%%PKGRELEASE%%/$PKGRELEASE/
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
@@ -117,7 +117,7 @@ Summary: The Linux kernel
 # for parallel xz processes, replace with 1 to go back to single process
 %endif
 
-%%BUILDID%%
+%%SPECBUILDID%%
 
 
 %if 0%{?fedora}

--
https://gitlab.com/cki-project/kernel-ark/-/merge_requests/1727
___
kernel mailing list -- kernel@lists.fedoraproject.org
To unsubscribe send an email to kernel-le...@lists.fedoraproject.org
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@lists.fedoraproject.org
Do not reply to spam on the list, report it: 
https://pagure.io/fedora-infrastructure


[OS-BUILD PATCH 3/16] redhat/Makefile: Rename KVERSION to SPECVERSION

2022-04-22 Thread Prarit Bhargava (via Email Bridge)
From: Prarit Bhargava 

redhat/Makefile: Rename KVERSION to SPECVERSION

KVERSION is passed into the spec file and is easy to confuse with the
kernel KVERSION.  Change the name to SPECVERSION so that readers
understand it is the %Version field of the specfile.

As a result RPMKSUBLEVEL can be dropped from genspec.sh.

Rename KVERSION to SPECVERSION and use it in the specfile.

Signed-off-by: Prarit Bhargava 

diff --git a/redhat/Makefile b/redhat/Makefile
index blahblah..blahblah 100644
--- a/redhat/Makefile
+++ b/redhat/Makefile
@@ -144,8 +144,8 @@ else
 MARKER:=v$(RPMKVERSION).$(RPMKPATCHLEVEL)
 UPSTREAM_TARBALL_NAME:=$(RPMKVERSION).$(RPMKPATCHLEVEL)
   else
-MARKER:=v$(KVERSION)
-UPSTREAM_TARBALL_NAME:=$(KVERSION)
+MARKER:=v$(SPECVERSION)
+UPSTREAM_TARBALL_NAME:=$(SPECVERSION)
   endif
   PREBUILD:=
 endif
@@ -204,13 +204,13 @@ else
   SNAPSHOT:=0
 endif
 
-KVERSION:=$(RPMKVERSION).$(RPMKPATCHLEVEL).$(RPMKSUBLEVEL)
+SPECVERSION:=$(RPMKVERSION).$(RPMKPATCHLEVEL).$(RPMKSUBLEVEL)
 DISTRO_BUILD:=$(PREBUILD)$(shell echo $(BUILD) | sed -e 
's|\(^[0-9]\{1,4\}\)\..*|\1|')
-KABI_TARBALL:=$(SOURCES)/kernel-abi-stablelists-$(KVERSION)-$(DISTRO_BUILD).tar.bz2
+KABI_TARBALL:=$(SOURCES)/kernel-abi-stablelists-$(SPECVERSION)-$(DISTRO_BUILD).tar.bz2
 KABIDW := $(REDHAT)/kabi-dwarf
-KABIDW_TARBALL:=$(SOURCES)/kernel-kabi-dw-$(KVERSION)-$(DISTRO_BUILD).tar.bz2
+KABIDW_TARBALL:=$(SOURCES)/kernel-kabi-dw-$(SPECVERSION)-$(DISTRO_BUILD).tar.bz2
 PKGRELEASE:=$(PREBUILD)$(BUILD)$(BUILDID)
-RPMVERSION:=$(KVERSION)-$(PKGRELEASE)
+RPMVERSION:=$(SPECVERSION)-$(PKGRELEASE)
 SPECRELEASE:=$(PREBUILD)$(BUILD)%{?buildid}%{?dist}
 SRPM:=$(SRPMS)/$(PACKAGE_NAME)-$(RPMVERSION)$(DIST).src.rpm
 
@@ -352,11 +352,11 @@ dist-kabi-dw-check: dist-kabi
 
 dist-configs-commit: dist-configs-prep
+@cd $(REDHAT)/configs; ./generate_all_configs.sh 1;\
-   ./process_configs.sh -z "$(KVERSION)" "$(FLAVOR)"
+   ./process_configs.sh -z "$(SPECVERSION)" "$(FLAVOR)"
 
 dist-configs: dist-configs-prep
+@cd $(REDHAT)/configs; ./generate_all_configs.sh 1;\
-   ./process_configs.sh $(PROCESS_CONFIGS_OPTS) "$(KVERSION)" ""
+   ./process_configs.sh $(PROCESS_CONFIGS_OPTS) "$(SPECVERSION)" ""
 
 dist-fedora-configs: FLAVOR = fedora
 dist-fedora-configs: dist-configs
@@ -425,12 +425,12 @@ dist-tarball: $(TARBALL)
 dist-kernelrelease:
# deprecated at 5.17.0
@echo "WARNING: This target will be deprecated in a future release."
-   @echo $(PACKAGE_NAME)-$(KVERSION)-$(DISTRO_BUILD)
+   @echo $(PACKAGE_NAME)-$(SPECVERSION)-$(DISTRO_BUILD)
 
 dist-kernelversion:
# deprecated at 5.17.0
@echo "WARNING: This target will be deprecated in a future release."
-   @echo $(KVERSION)-$(DISTRO_BUILD)
+   @echo $(SPECVERSION)-$(DISTRO_BUILD)
 
 dist-specfile: setup-source
# deprecated at 5.17.0
diff --git a/redhat/configs/generate_all_configs.sh 
b/redhat/configs/generate_all_configs.sh
index blahblah..blahblah 100755
--- a/redhat/configs/generate_all_configs.sh
+++ b/redhat/configs/generate_all_configs.sh
@@ -18,7 +18,7 @@ else
 fi
 
 for i in kernel-*-"$FLAVOR".config; do
-   NEW=kernel-"$KVERSION"-$(echo "$i" | cut -d - -f2- | sed s/-"$FLAVOR"//)
+   NEW=kernel-"$SPECVERSION"-$(echo "$i" | cut -d - -f2- | sed 
s/-"$FLAVOR"//)
#echo $NEW
mv "$i" "$NEW"
 done
diff --git a/redhat/docs/makefile-changes.rst b/redhat/docs/makefile-changes.rst
index blahblah..blahblah 100644
--- a/redhat/docs/makefile-changes.rst
+++ b/redhat/docs/makefile-changes.rst
@@ -73,4 +73,4 @@ or,
   dist-kernelversion:
 # deprecated in 5.17.0
 @echo "WARNING: This target will be removed in a later release."
-@echo $(KVERSION)-$(DISTRO_BUILD)
+@echo $(SPECVERSION)-$(DISTRO_BUILD)
diff --git a/redhat/genspec.sh b/redhat/genspec.sh
index blahblah..blahblah 100755
--- a/redhat/genspec.sh
+++ b/redhat/genspec.sh
@@ -62,7 +62,6 @@ test -f "$SOURCES/$SPECFILE" &&
s/%%BUILDID%%/$BUILDID_DEFINE/
s/%%RPMKVERSION%%/$RPMKVERSION/
s/%%RPMKPATCHLEVEL%%/$RPMKPATCHLEVEL/
-   s/%%RPMKSUBLEVEL%%/$RPMKSUBLEVEL/
s/%%PKGRELEASE%%/$PKGRELEASE/
s/%%SPECRELEASE%%/$SPECRELEASE/
s/%%DISTRO_BUILD%%/$DISTRO_BUILD/
@@ -71,6 +70,7 @@ test -f "$SOURCES/$SPECFILE" &&
s/%%INCLUDE_FEDORA_FILES%%/$INCLUDE_FEDORA_FILES/
s/%%INCLUDE_RHEL_FILES%%/$INCLUDE_RHEL_FILES/
s/%%PATCHLIST_CHANGELOG%%/$PATCHLIST_CHANGELOG/
+   s/%%SPECVERSION%%/$SPECVERSION/
s/%%TARFILE_RELEASE%%/$TARFILE_RELEASE/" "$SOURCES/$SPECFILE"
 
 # We depend on work splitting of BUILDOPTS
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
@@ -129,7 +129,7 @@ Summary: The Linux kernel
 # The kernel tarball/base version
 %define kversion %%RPMKVERSION%%.%%RPMKPATCHLEVEL%%
 
-%define rpmversion 

[OS-BUILD PATCH 13/16] redhat/genspec: Rename PATCHLIST_CHANGELOG to SPECPATCHLIST_CHANGELOG

2022-04-22 Thread Prarit Bhargava (via Email Bridge)
From: Prarit Bhargava 

redhat/genspec: Rename PATCHLIST_CHANGELOG to SPECPATCHLIST_CHANGELOG

Change PATCHLIST_CHANGELOG to SPECPATCHLIST_CHANGELOG so that readers
understand it is passed into the spec file.

Rename PATCHLIST_CHANGELOG to SPECPATCHLIST_CHANGELOG.

Signed-off-by: Prarit Bhargava 

diff --git a/redhat/genspec.sh b/redhat/genspec.sh
index blahblah..blahblah 100755
--- a/redhat/genspec.sh
+++ b/redhat/genspec.sh
@@ -40,7 +40,7 @@ EXCLUDE_FILES=":(exclude,top).get_maintainer.conf \
 
 # If PATCHLIST_URL is not set to "none", generate Patchlist.changelog file that
 # holds the shas and commits not included upstream and git commit url.
-PATCHLIST_CHANGELOG=0
+SPECPATCHLIST_CHANGELOG=0
 if [ "$PATCHLIST_URL" != "none" ]; then
# sed convert
#  
@@ -53,7 +53,7 @@ if [ "$PATCHLIST_URL" != "none" ]; then
git log --no-merges --pretty=oneline --no-decorate ${UPSTREAM}.. 
$EXCLUDE_FILES | \
sed "s!^\([^ ]*\)!$PATCHLIST_URL/\1\n &!; s!\$!\n!" \
> "$SOURCES"/Patchlist.changelog
-   PATCHLIST_CHANGELOG=1
+   SPECPATCHLIST_CHANGELOG=1
 fi
 
 test -f "$SOURCES/$SPECFILE" &&
@@ -70,7 +70,7 @@ test -f "$SOURCES/$SPECFILE" &&
s/%%SPECDEBUG_BUILDS_ENABLED%%/$SPECDEBUG_BUILDS_ENABLED/
s/%%INCLUDE_FEDORA_FILES%%/$INCLUDE_FEDORA_FILES/
s/%%INCLUDE_RHEL_FILES%%/$INCLUDE_RHEL_FILES/
-   s/%%PATCHLIST_CHANGELOG%%/$PATCHLIST_CHANGELOG/
+   s/%%SPECPATCHLIST_CHANGELOG%%/$SPECPATCHLIST_CHANGELOG/
s/%%SPECVERSION%%/$SPECVERSION/
s/%%TARFILE_RELEASE%%/$TARFILE_RELEASE/" "$SOURCES/$SPECFILE"
 
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
@@ -8,7 +8,7 @@
 # Include RHEL files
 %global include_rhel %%INCLUDE_RHEL_FILES%%
 # Provide Patchlist.changelog file
-%global patchlist_changelog %%PATCHLIST_CHANGELOG%%
+%global patchlist_changelog %%SPECPATCHLIST_CHANGELOG%%
 
 # Disable LTO in userspace packages.
 %global _lto_cflags %{nil}

--
https://gitlab.com/cki-project/kernel-ark/-/merge_requests/1727
___
kernel mailing list -- kernel@lists.fedoraproject.org
To unsubscribe send an email to kernel-le...@lists.fedoraproject.org
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@lists.fedoraproject.org
Do not reply to spam on the list, report it: 
https://pagure.io/fedora-infrastructure


[OS-BUILD PATCH 16/16] redhat/self-test: Add test to verify SPEC variables

2022-04-22 Thread Prarit Bhargava (via Email Bridge)
From: Prarit Bhargava 

redhat/self-test: Add test to verify SPEC variables

This test looks at the spec file variable replacement code in
redhat/genspec.sh and confirms that each variable begins with "SPEC".

Signed-off-by: Prarit Bhargava 

diff --git a/redhat/docs/makefile-changes.rst b/redhat/docs/makefile-changes.rst
index blahblah..blahblah 100644
--- a/redhat/docs/makefile-changes.rst
+++ b/redhat/docs/makefile-changes.rst
@@ -46,6 +46,12 @@ external scripts.  Variables in this file should be 
considered stable.
 Variables still may be deprecated and will follow the guidelines in
 "Deprecating variables and targets" section below.
 
+Variable Naming
+===
+
+Variables names prefixed with SPEC indicate that the variable is used
+in redhat/kernel.spec.template (see redhat/genspec.sh).
+
 Deprecating variables and targets
 =
 
diff --git a/redhat/genspec.sh b/redhat/genspec.sh
index blahblah..blahblah 100755
--- a/redhat/genspec.sh
+++ b/redhat/genspec.sh
@@ -56,6 +56,7 @@ if [ "$PATCHLIST_URL" != "none" ]; then
SPECPATCHLIST_CHANGELOG=1
 fi
 
+# self-test begin
 test -f "$SOURCES/$SPECFILE" &&
sed -i -e "
/%%SPECCHANGELOG%%/r $SOURCES/$SPECCHANGELOG
@@ -73,6 +74,7 @@ test -f "$SOURCES/$SPECFILE" &&
s/%%SPECPATCHLIST_CHANGELOG%%/$SPECPATCHLIST_CHANGELOG/
s/%%SPECVERSION%%/$SPECVERSION/
s/%%SPECTARFILE_RELEASE%%/$SPECTARFILE_RELEASE/" "$SOURCES/$SPECFILE"
+# self-test end
 
 # We depend on work splitting of BUILDOPTS
 # shellcheck disable=SC2086
diff --git a/redhat/self-test/1006-verify-SPEC-variables.bats 
b/redhat/self-test/1006-verify-SPEC-variables.bats
new file mode 100644
index blahblah..blahblah 100644
--- /dev/null
+++ b/redhat/self-test/1006-verify-SPEC-variables.bats
@@ -0,0 +1,24 @@
+#!/usr/bin/env bats
+
+@test "verify SPEC variables" {
+# This test looks at the spec file variable replacement code in
+# redhat/genspec.sh and confirms that each variable begins with "SPEC".
+
+# This looks at the code and replaces each / with a new-line character, removes
+# any whitespace and entry entries beginning with valid "%%SPEC" or $"SPEC".
+# "$SOURCES" lines are also okay as it is used to point to the changelog and
+# the specfile.
+awk '/# self-test begin/, /# self-test end/' $BATS_TEST_DIRNAME/../genspec.sh 
| grep -v "^#" | tr "/" "\n" | tr -d "\"" | sed -r '/^\s*$/d' | grep -v 
"%%SPEC" | grep -v "\$SPEC" | grep -v "\$SOURCES" | while read LINE
+do
+   case $(echo $LINE | xargs) in
+   s) ;;
+   d) ;;
+#"sed -i -e") ;;
+   *)
+   echo " "
+   echo "ERROR: Variables passed between genspec.sh and the spec 
file must begin with %%SPEC or \$SPEC."
+   exit 1
+   ;;
+   esac
+done
+}

--
https://gitlab.com/cki-project/kernel-ark/-/merge_requests/1727
___
kernel mailing list -- kernel@lists.fedoraproject.org
To unsubscribe send an email to kernel-le...@lists.fedoraproject.org
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@lists.fedoraproject.org
Do not reply to spam on the list, report it: 
https://pagure.io/fedora-infrastructure


[OS-BUILD PATCH 2/18] redhat/Makefile: Deprecate some simple targets

2022-04-22 Thread Prarit Bhargava (via Email Bridge)
From: Prarit Bhargava 

redhat/Makefile: Deprecate some simple targets

Deprecate some simple targets.

Signed-off-by: Prarit Bhargava 

diff --git a/redhat/Makefile b/redhat/Makefile
index blahblah..blahblah 100644
--- a/redhat/Makefile
+++ b/redhat/Makefile
@@ -418,15 +418,23 @@ $(KABIDW_TARBALL):
 
 
 dist-tarball: $(TARBALL)
+   # deprecated at 5.17.0
+   @echo "WARNING: This target will be deprecated in a future release."
@echo "redhat/$(TARFILE)"
 
 dist-kernelrelease:
+   # deprecated at 5.17.0
+   @echo "WARNING: This target will be deprecated in a future release."
@echo $(PACKAGE_NAME)-$(KVERSION)-$(DISTRO_BUILD)
 
 dist-kernelversion:
+   # deprecated at 5.17.0
+   @echo "WARNING: This target will be deprecated in a future release."
@echo $(KVERSION)-$(DISTRO_BUILD)
 
 dist-specfile: setup-source
+   # deprecated at 5.17.0
+   @echo "WARNING: This target will be deprecated in a future release."
@echo $(SOURCES)/$(SPECFILE)
 
 dist-git-version-check:

--
https://gitlab.com/cki-project/kernel-ark/-/merge_requests/1728
___
kernel mailing list -- kernel@lists.fedoraproject.org
To unsubscribe send an email to kernel-le...@lists.fedoraproject.org
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@lists.fedoraproject.org
Do not reply to spam on the list, report it: 
https://pagure.io/fedora-infrastructure


[OS-BUILD PATCH 2/16] redhat/Makefile: Deprecate some simple targets

2022-04-22 Thread Prarit Bhargava (via Email Bridge)
From: Prarit Bhargava 

redhat/Makefile: Deprecate some simple targets

Deprecate some simple targets.

Signed-off-by: Prarit Bhargava 

diff --git a/redhat/Makefile b/redhat/Makefile
index blahblah..blahblah 100644
--- a/redhat/Makefile
+++ b/redhat/Makefile
@@ -418,15 +418,23 @@ $(KABIDW_TARBALL):
 
 
 dist-tarball: $(TARBALL)
+   # deprecated at 5.17.0
+   @echo "WARNING: This target will be deprecated in a future release."
@echo "redhat/$(TARFILE)"
 
 dist-kernelrelease:
+   # deprecated at 5.17.0
+   @echo "WARNING: This target will be deprecated in a future release."
@echo $(PACKAGE_NAME)-$(KVERSION)-$(DISTRO_BUILD)
 
 dist-kernelversion:
+   # deprecated at 5.17.0
+   @echo "WARNING: This target will be deprecated in a future release."
@echo $(KVERSION)-$(DISTRO_BUILD)
 
 dist-specfile: setup-source
+   # deprecated at 5.17.0
+   @echo "WARNING: This target will be deprecated in a future release."
@echo $(SOURCES)/$(SPECFILE)
 
 dist-git-version-check:

--
https://gitlab.com/cki-project/kernel-ark/-/merge_requests/1727
___
kernel mailing list -- kernel@lists.fedoraproject.org
To unsubscribe send an email to kernel-le...@lists.fedoraproject.org
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@lists.fedoraproject.org
Do not reply to spam on the list, report it: 
https://pagure.io/fedora-infrastructure


[OS-BUILD PATCH 14/16] redhat/Makefile: Rename TARFILE_RELEASE to SPECTARFILE_RELEASE

2022-04-22 Thread Prarit Bhargava (via Email Bridge)
From: Prarit Bhargava 

redhat/Makefile: Rename TARFILE_RELEASE to SPECTARFILE_RELEASE

Change TARFILE_RELEASE to SPECTARFILE_RELEASE so that readers
understand it is passed into the spec file.

Rename TARFILE_RELEASE to SPECTARFILE_RELEASE.

Signed-off-by: Prarit Bhargava 

diff --git a/redhat/Makefile b/redhat/Makefile
index blahblah..blahblah 100644
--- a/redhat/Makefile
+++ b/redhat/Makefile
@@ -220,7 +220,7 @@ SRPM:=$(SRPMS)/$(PACKAGE_NAME)-$(RPMVERSION)$(DIST).src.rpm
 #
 ifeq ("$(DISTRO)", "fedora")
   SINGLE_TARBALL:=0
-  TARFILE_RELEASE:=$(UPSTREAM_TARBALL_NAME)
+  SPECTARFILE_RELEASE:=$(UPSTREAM_TARBALL_NAME)
   RHDISTGIT_BRANCH:=rawhide
   ifndef BUILD_SCRATCH_TARGET
 BUILD_SCRATCH_TARGET:=temp-ark-rhel-8-test
@@ -234,21 +234,21 @@ else ifeq ("$(DISTRO)", "centos")
   ifndef BUILD_SCRATCH_TARGET
 BUILD_SCRATCH_TARGET:=c$(RHEL_MAJOR)s-candidate
   endif
-  TARFILE_RELEASE:=$(RPMVERSION)
+  SPECTARFILE_RELEASE:=$(RPMVERSION)
 else
   SINGLE_TARBALL:=1
   RHDISTGIT_BRANCH:=rhel-$(RHEL_MAJOR).$(RHEL_MINOR).0
   ifndef BUILD_SCRATCH_TARGET
 BUILD_SCRATCH_TARGET:=rhel-$(RHEL_MAJOR).$(RHEL_MINOR).0-test-pesign
   endif
-  TARFILE_RELEASE:=$(RPMVERSION)
+  SPECTARFILE_RELEASE:=$(RPMVERSION)
 endif
 
 ifndef BUILD_TARGET
   BUILD_TARGET:=--scratch $(BUILD_SCRATCH_TARGET)
 endif
 
-TARFILE:=linux-$(TARFILE_RELEASE).tar.xz
+TARFILE:=linux-$(SPECTARFILE_RELEASE).tar.xz
 TARBALL:=$(REDHAT)/$(TARFILE)
 
 include Makefile.rhpkg
diff --git a/redhat/genspec.sh b/redhat/genspec.sh
index blahblah..blahblah 100755
--- a/redhat/genspec.sh
+++ b/redhat/genspec.sh
@@ -72,7 +72,7 @@ test -f "$SOURCES/$SPECFILE" &&
s/%%INCLUDE_RHEL_FILES%%/$INCLUDE_RHEL_FILES/
s/%%SPECPATCHLIST_CHANGELOG%%/$SPECPATCHLIST_CHANGELOG/
s/%%SPECVERSION%%/$SPECVERSION/
-   s/%%TARFILE_RELEASE%%/$TARFILE_RELEASE/" "$SOURCES/$SPECFILE"
+   s/%%SPECTARFILE_RELEASE%%/$SPECTARFILE_RELEASE/" "$SOURCES/$SPECFILE"
 
 # We depend on work splitting of BUILDOPTS
 # shellcheck disable=SC2086
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
@@ -692,7 +692,7 @@ BuildRequires: lld
 # exact git commit you can run
 #
 # xzcat -qq ${TARBALL} | git get-tar-commit-id
-Source0: linux-%%TARFILE_RELEASE%%.tar.xz
+Source0: linux-%%SPECTARFILE_RELEASE%%.tar.xz
 
 Source1: Makefile.rhelver
 
@@ -1384,8 +1384,8 @@ ApplyOptionalPatch()
   fi
 }
 
-%setup -q -n kernel-%%TARFILE_RELEASE%% -c
-mv linux-%%TARFILE_RELEASE%% linux-%{KVERREL}
+%setup -q -n kernel-%%SPECTARFILE_RELEASE%% -c
+mv linux-%%SPECTARFILE_RELEASE%% linux-%{KVERREL}
 
 cd linux-%{KVERREL}
 cp -a %{SOURCE1} .
diff --git a/redhat/scripts/create-tarball.sh b/redhat/scripts/create-tarball.sh
index blahblah..blahblah 100755
--- a/redhat/scripts/create-tarball.sh
+++ b/redhat/scripts/create-tarball.sh
@@ -27,4 +27,4 @@ trap 'rm -vf "$TARBALL"' INT
 # XZ_OPTIONS and XZ_THREADS DEPEND on word splitting, so don't disable it here:
 # shellcheck disable=SC2086
 cd ../ &&
-  git archive --prefix="linux-$TARFILE_RELEASE"/ --format=tar "$_GITID" | xz 
$XZ_OPTIONS $XZ_THREADS > "$TARBALL";
+  git archive --prefix="linux-$SPECTARFILE_RELEASE"/ --format=tar "$_GITID" | 
xz $XZ_OPTIONS $XZ_THREADS > "$TARBALL";
diff --git a/redhat/self-test/data/centos-2585cf9dfaad.el7 
b/redhat/self-test/data/centos-2585cf9dfaad.el7
index blahblah..blahblah 100644
--- a/redhat/self-test/data/centos-2585cf9dfaad.el7
+++ b/redhat/self-test/data/centos-2585cf9dfaad.el7
@@ -61,12 +61,12 @@ SPECKPATCHLEVEL=16
 SPECKSUBLEVEL=0 
 SPECKVERSION=5 
 SPECRELEASE=0.rc5.6%{?buildid}%{?dist} 
+SPECTARFILE_RELEASE=5.16.0-0.rc5.6.test 
 SPECVERSION=5.16.0 
 SRPM=../redhat/rpm/SRPMS/kernel-5.16.0-0.rc5.6.test.el7.src.rpm 
 SRPMS=../redhat/rpm/SRPMS 
 TARBALL=../redhat/linux-5.16.0-0.rc5.6.test.tar.xz 
 TARFILE=linux-5.16.0-0.rc5.6.test.tar.xz 
-TARFILE_RELEASE=5.16.0-0.rc5.6.test 
 TESTPATCH=../redhat/linux-kernel-test.patch 
 TOPDIR=.. 
 UPSTREAM_TARBALL_NAME=5.16-rc5 
diff --git a/redhat/self-test/data/centos-2585cf9dfaad.fc25 
b/redhat/self-test/data/centos-2585cf9dfaad.fc25
index blahblah..blahblah 100644
--- a/redhat/self-test/data/centos-2585cf9dfaad.fc25
+++ b/redhat/self-test/data/centos-2585cf9dfaad.fc25
@@ -61,12 +61,12 @@ SPECKPATCHLEVEL=16
 SPECKSUBLEVEL=0 
 SPECKVERSION=5 
 SPECRELEASE=0.rc5.6%{?buildid}%{?dist} 
+SPECTARFILE_RELEASE=5.16.0-0.rc5.6.test 
 SPECVERSION=5.16.0 
 SRPM=../redhat/rpm/SRPMS/kernel-5.16.0-0.rc5.6.test.fc25.src.rpm 
 SRPMS=../redhat/rpm/SRPMS 
 TARBALL=../redhat/linux-5.16.0-0.rc5.6.test.tar.xz 
 TARFILE=linux-5.16.0-0.rc5.6.test.tar.xz 
-TARFILE_RELEASE=5.16.0-0.rc5.6.test 
 TESTPATCH=../redhat/linux-kernel-test.patch 
 TOPDIR=.. 
 UPSTREAM_TARBALL_NAME=5.16-rc5 
diff --git a/redhat/self-test/data/centos-78e36f3b0dae.el7 
b/redhat/self-test/data/centos-78e36f3b0dae.el7
index blahblah..blahblah 100644
--- a/redhat/self-test/data/centos-78e36f3b0dae.el7

[OS-BUILD PATCH 1/16] redhat/Makefile: Use KVERSION

2022-04-22 Thread Prarit Bhargava (via Email Bridge)
From: Prarit Bhargava 

redhat/Makefile: Use KVERSION

Use KVERSION where appropriate in the Makefile.

Signed-off-by: Prarit Bhargava 

diff --git a/redhat/Makefile b/redhat/Makefile
index blahblah..blahblah 100644
--- a/redhat/Makefile
+++ b/redhat/Makefile
@@ -144,8 +144,8 @@ else
 MARKER:=v$(RPMKVERSION).$(RPMKPATCHLEVEL)
 UPSTREAM_TARBALL_NAME:=$(RPMKVERSION).$(RPMKPATCHLEVEL)
   else
-MARKER:=v$(RPMKVERSION).$(RPMKPATCHLEVEL).$(RPMKSUBLEVEL)
-UPSTREAM_TARBALL_NAME:=$(RPMKVERSION).$(RPMKPATCHLEVEL).$(RPMKSUBLEVEL)
+MARKER:=v$(KVERSION)
+UPSTREAM_TARBALL_NAME:=$(KVERSION)
   endif
   PREBUILD:=
 endif
@@ -210,7 +210,7 @@ 
KABI_TARBALL:=$(SOURCES)/kernel-abi-stablelists-$(KVERSION)-$(DISTRO_BUILD).tar.
 KABIDW := $(REDHAT)/kabi-dwarf
 KABIDW_TARBALL:=$(SOURCES)/kernel-kabi-dw-$(KVERSION)-$(DISTRO_BUILD).tar.bz2
 PKGRELEASE:=$(PREBUILD)$(BUILD)$(BUILDID)
-RPMVERSION:=$(RPMKVERSION).$(RPMKPATCHLEVEL).$(RPMKSUBLEVEL)-$(PKGRELEASE)
+RPMVERSION:=$(KVERSION)-$(PKGRELEASE)
 SPECRELEASE:=$(PREBUILD)$(BUILD)%{?buildid}%{?dist}
 SRPM:=$(SRPMS)/$(PACKAGE_NAME)-$(RPMVERSION)$(DIST).src.rpm
 

--
https://gitlab.com/cki-project/kernel-ark/-/merge_requests/1727
___
kernel mailing list -- kernel@lists.fedoraproject.org
To unsubscribe send an email to kernel-le...@lists.fedoraproject.org
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@lists.fedoraproject.org
Do not reply to spam on the list, report it: 
https://pagure.io/fedora-infrastructure


[OS-BUILD PATCH 15/16] redhat/Makefile: Add 'duplicate' SPEC entries for user set variables

2022-04-22 Thread Prarit Bhargava (via Email Bridge)
From: Prarit Bhargava 

redhat/Makefile: Add 'duplicate' SPEC entries for user set variables

INCLUDE_FEDORA_FILES, INCLUDE_RHEL_FILES, and RELEASED_KERNEL are
specified in Makefile.variables as they can be set in userspace.

Create duplicate entries for these variables that begin with SPEC.  This
will make debugging easier and indicate that the variables are passed into
the spec file.

Signed-off-by: Prarit Bhargava 

diff --git a/redhat/Makefile b/redhat/Makefile
index blahblah..blahblah 100644
--- a/redhat/Makefile
+++ b/redhat/Makefile
@@ -26,6 +26,12 @@ ifdef SINGLE_TARBALL
 endif
 
 include Makefile.variables
+# These entries are 'duplicates' of variables specified in Makefile.variables
+# that are used in the SPEC file.  Specifying these with a SPEC prefix 
indicates
+# that the value is passed through to the spec file.
+SPECRELEASED_KERNEL=$(RELEASED_KERNEL)
+SPECINCLUDE_FEDORA_FILES=$(INCLUDE_FEDORA_FILES)
+SPECINCLUDE_RHEL_FILES=$(INCLUDE_RHEL_FILES)
 
 LANG=C
 
diff --git a/redhat/genspec.sh b/redhat/genspec.sh
index blahblah..blahblah 100755
--- a/redhat/genspec.sh
+++ b/redhat/genspec.sh
@@ -66,10 +66,10 @@ test -f "$SOURCES/$SPECFILE" &&
s/%%SPECBUILD%%/$SPECBUILD/
s/%%SPECRELEASE%%/$SPECRELEASE/
s/%%SPECDISTROBUILD%%/$SPECDISTROBUILD/
-   s/%%RELEASED_KERNEL%%/$RELEASED_KERNEL/
+   s/%%SPECRELEASED_KERNEL%%/$SPECRELEASED_KERNEL/
s/%%SPECDEBUG_BUILDS_ENABLED%%/$SPECDEBUG_BUILDS_ENABLED/
-   s/%%INCLUDE_FEDORA_FILES%%/$INCLUDE_FEDORA_FILES/
-   s/%%INCLUDE_RHEL_FILES%%/$INCLUDE_RHEL_FILES/
+   s/%%SPECINCLUDE_FEDORA_FILES%%/$SPECINCLUDE_FEDORA_FILES/
+   s/%%SPECINCLUDE_RHEL_FILES%%/$SPECINCLUDE_RHEL_FILES/
s/%%SPECPATCHLIST_CHANGELOG%%/$SPECPATCHLIST_CHANGELOG/
s/%%SPECVERSION%%/$SPECVERSION/
s/%%SPECTARFILE_RELEASE%%/$SPECTARFILE_RELEASE/" "$SOURCES/$SPECFILE"
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
@@ -4,9 +4,9 @@
 # here before the %%install macro is pre-built.
 
 # Include Fedora files
-%global include_fedora %%INCLUDE_FEDORA_FILES%%
+%global include_fedora %%SPECINCLUDE_FEDORA_FILES%%
 # Include RHEL files
-%global include_rhel %%INCLUDE_RHEL_FILES%%
+%global include_rhel %%SPECINCLUDE_RHEL_FILES%%
 # Provide Patchlist.changelog file
 %global patchlist_changelog %%SPECPATCHLIST_CHANGELOG%%
 
@@ -77,7 +77,7 @@ Summary: The Linux kernel
 #  kernel release. (This includes prepatch or "rc" releases.)
 # Set released_kernel to 0 when the upstream source tarball contains an
 #  unreleased kernel development snapshot.
-%global released_kernel %%RELEASED_KERNEL%%
+%global released_kernel %%SPECRELEASED_KERNEL%%
 
 # Set debugbuildsenabled to 1 to build separate base and debug kernels
 #  (on supported architectures). The kernel-debug-* subpackages will
diff --git a/redhat/self-test/data/centos-2585cf9dfaad.el7 
b/redhat/self-test/data/centos-2585cf9dfaad.el7
index blahblah..blahblah 100644
--- a/redhat/self-test/data/centos-2585cf9dfaad.el7
+++ b/redhat/self-test/data/centos-2585cf9dfaad.el7
@@ -56,11 +56,14 @@ SPECBUILD=0.rc5.6.test
 SPECCHANGELOG=kernel.changelog-9.99 
 SPECDISTROBUILD=0.rc5.6 
 SPECFILE=kernel.spec 
+SPECINCLUDE_FEDORA_FILES=1 
+SPECINCLUDE_RHEL_FILES=1 
 SPECKEXTRAVERSION=-rc5 
 SPECKPATCHLEVEL=16 
 SPECKSUBLEVEL=0 
 SPECKVERSION=5 
 SPECRELEASE=0.rc5.6%{?buildid}%{?dist} 
+SPECRELEASED_KERNEL=0 
 SPECTARFILE_RELEASE=5.16.0-0.rc5.6.test 
 SPECVERSION=5.16.0 
 SRPM=../redhat/rpm/SRPMS/kernel-5.16.0-0.rc5.6.test.el7.src.rpm 
diff --git a/redhat/self-test/data/centos-2585cf9dfaad.fc25 
b/redhat/self-test/data/centos-2585cf9dfaad.fc25
index blahblah..blahblah 100644
--- a/redhat/self-test/data/centos-2585cf9dfaad.fc25
+++ b/redhat/self-test/data/centos-2585cf9dfaad.fc25
@@ -56,11 +56,14 @@ SPECBUILD=0.rc5.6.test
 SPECCHANGELOG=kernel.changelog-9.99 
 SPECDISTROBUILD=0.rc5.6 
 SPECFILE=kernel.spec 
+SPECINCLUDE_FEDORA_FILES=1 
+SPECINCLUDE_RHEL_FILES=1 
 SPECKEXTRAVERSION=-rc5 
 SPECKPATCHLEVEL=16 
 SPECKSUBLEVEL=0 
 SPECKVERSION=5 
 SPECRELEASE=0.rc5.6%{?buildid}%{?dist} 
+SPECRELEASED_KERNEL=0 
 SPECTARFILE_RELEASE=5.16.0-0.rc5.6.test 
 SPECVERSION=5.16.0 
 SRPM=../redhat/rpm/SRPMS/kernel-5.16.0-0.rc5.6.test.fc25.src.rpm 
diff --git a/redhat/self-test/data/centos-78e36f3b0dae.el7 
b/redhat/self-test/data/centos-78e36f3b0dae.el7
index blahblah..blahblah 100644
--- a/redhat/self-test/data/centos-78e36f3b0dae.el7
+++ b/redhat/self-test/data/centos-78e36f3b0dae.el7
@@ -56,11 +56,14 @@ SPECBUILD=0.rc0.78e36f3b0dae586.6.test
 SPECCHANGELOG=kernel.changelog-9.99 
 SPECDISTROBUILD=0.rc0.78e36f3b0dae586.6 
 SPECFILE=kernel.spec 
+SPECINCLUDE_FEDORA_FILES=1 
+SPECINCLUDE_RHEL_FILES=1 
 SPECKEXTRAVERSION= 
 SPECKPATCHLEVEL=17 
 SPECKSUBLEVEL=0 
 SPECKVERSION=5 
 SPECRELEASE=0.rc0.78e36f3b0dae586.6%{?buildid}%{?dist} 
+SPECRELEASED_KERNEL=0 
 

[OS-BUILD PATCHv8 9/11] redhat/scripts/create-tarball.sh: Use Makefile variables

2022-04-21 Thread Prarit Bhargava (via Email Bridge)
From: Prarit Bhargava 

redhat/scripts/create-tarball.sh: Use Makefile variables

Use Makefile variables in redhat/scripts/create-tarball.sh.

Signed-off-by: Prarit Bhargava 

diff --git a/redhat/Makefile b/redhat/Makefile
index blahblah..blahblah 100644
--- a/redhat/Makefile
+++ b/redhat/Makefile
@@ -397,11 +397,7 @@ dist-stub-key:
 # force tarball to be regenerated if HEAD changes
 .PHONY:$(TARBALL)
 $(TARBALL):
-   @if [ $(SINGLE_TARBALL) -eq 1 ]; then \
-   scripts/create-tarball.sh $(GITID) linux-$(RPMVERSION); \
-   else \
-   scripts/create-tarball.sh $(MARKER) linux-$(TARFILE_RELEASE); \
-   fi
+   @scripts/create-tarball.sh
 
 .PHONY: $(KABI_TARBALL)
 $(KABI_TARBALL):
diff --git a/redhat/scripts/create-tarball.sh b/redhat/scripts/create-tarball.sh
index blahblah..blahblah 100755
--- a/redhat/scripts/create-tarball.sh
+++ b/redhat/scripts/create-tarball.sh
@@ -1,7 +1,6 @@
 #!/bin/sh
 
-GITID=$1
-DIR=$2
+[ "$SINGLE_TARBALL" -eq 1 ] && _GITID="$GITID" || _GITID="$MARKER"
 
 # shellcheck disable=SC1083
 XZ_THREADS=$(rpm --eval %{_smp_mflags} | sed -e 's!^-j!--threads !')
@@ -16,8 +15,7 @@ fi
 
 if [ -f "$TARBALL" ]; then
TARID=$(xzcat -qq "$TARBALL" | git get-tar-commit-id 2>/dev/null)
-   GITID_NORMALIZE=$(git log --max-count=1 --pretty=format:%H "$GITID")
-   if [ "${GITID_NORMALIZE}" = "${TARID}" ]; then
+   if [ "$_GITID" == "$TARID" ]; then
echo "$(basename "$TARBALL") unchanged..."
exit 0
fi
@@ -29,4 +27,4 @@ trap 'rm -vf "$TARBALL"' INT
 # XZ_OPTIONS and XZ_THREADS DEPEND on word splitting, so don't disable it here:
 # shellcheck disable=SC2086
 cd ../ &&
-  git archive --prefix="$DIR"/ --format=tar "$GITID" | xz $XZ_OPTIONS 
$XZ_THREADS > "$TARBALL";
+  git archive --prefix="linux-$TARFILE_RELEASE"/ --format=tar "$_GITID" | xz 
$XZ_OPTIONS $XZ_THREADS > "$TARBALL";

--
https://gitlab.com/cki-project/kernel-ark/-/merge_requests/1647
___
kernel mailing list -- kernel@lists.fedoraproject.org
To unsubscribe send an email to kernel-le...@lists.fedoraproject.org
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@lists.fedoraproject.org
Do not reply to spam on the list, report it: 
https://pagure.io/fedora-infrastructure


[OS-BUILD PATCHv8 2/11] redhat/kernel.spec.template: Use RPM_BUILD_NCPUS

2022-04-21 Thread Prarit Bhargava (via Email Bridge)
From: Prarit Bhargava 

redhat/kernel.spec.template: Use RPM_BUILD_NCPUS

RPM_BUILD_NCPUS allows users to modify the max number of cpus used by the
RPM build.

Use the RPM_BUILD_NCPUS variable in the spec file.

Signed-off-by: Prarit Bhargava 

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
@@ -115,7 +115,6 @@ Summary: The Linux kernel
 %if %{zipmodules}
 %global zipsed -e 's/\.ko$/\.ko.xz/'
 # for parallel xz processes, replace with 1 to go back to single process
-%global zcpu `nproc --all`
 %endif
 
 %%BUILDID%%
@@ -2351,7 +2350,7 @@ find Documentation -type d | xargs chmod u+w
 fi \
   fi \
   if [ "%{zipmodules}" -eq "1" ]; then \
-find $RPM_BUILD_ROOT/lib/modules/ -type f -name '*.ko' | xargs -P%{zcpu} 
xz; \
+find $RPM_BUILD_ROOT/lib/modules/ -type f -name '*.ko' | xargs 
-P${RPM_BUILD_NCPUS} xz; \
   fi \
 %{nil}
 
diff --git a/redhat/self-test/data/centos-2585cf9dfaad.el7.spec 
b/redhat/self-test/data/centos-2585cf9dfaad.el7.spec
index blahblah..blahblah 100755
--- a/redhat/self-test/data/centos-2585cf9dfaad.el7.spec
+++ b/redhat/self-test/data/centos-2585cf9dfaad.el7.spec
@@ -115,7 +115,6 @@ Summary: The Linux kernel
 %if %{zipmodules}
 %global zipsed -e 's/\.ko$/\.ko.xz/'
 # for parallel xz processes, replace with 1 to go back to single process
-%global zcpu `nproc --all`
 %endif
 
 %define buildid .test
@@ -2349,7 +2348,7 @@ find Documentation -type d | xargs chmod u+w
 fi \
   fi \
   if [ "%{zipmodules}" -eq "1" ]; then \
-find $RPM_BUILD_ROOT/lib/modules/ -type f -name '*.ko' | xargs -P%{zcpu} 
xz; \
+find $RPM_BUILD_ROOT/lib/modules/ -type f -name '*.ko' | xargs 
-P${RPM_BUILD_NCPUS} xz; \
   fi \
 %{nil}
 
diff --git a/redhat/self-test/data/centos-2585cf9dfaad.fc25.spec 
b/redhat/self-test/data/centos-2585cf9dfaad.fc25.spec
index blahblah..blahblah 100755
--- a/redhat/self-test/data/centos-2585cf9dfaad.fc25.spec
+++ b/redhat/self-test/data/centos-2585cf9dfaad.fc25.spec
@@ -115,7 +115,6 @@ Summary: The Linux kernel
 %if %{zipmodules}
 %global zipsed -e 's/\.ko$/\.ko.xz/'
 # for parallel xz processes, replace with 1 to go back to single process
-%global zcpu `nproc --all`
 %endif
 
 %define buildid .test
@@ -2349,7 +2348,7 @@ find Documentation -type d | xargs chmod u+w
 fi \
   fi \
   if [ "%{zipmodules}" -eq "1" ]; then \
-find $RPM_BUILD_ROOT/lib/modules/ -type f -name '*.ko' | xargs -P%{zcpu} 
xz; \
+find $RPM_BUILD_ROOT/lib/modules/ -type f -name '*.ko' | xargs 
-P${RPM_BUILD_NCPUS} xz; \
   fi \
 %{nil}
 
diff --git a/redhat/self-test/data/centos-78e36f3b0dae.el7.spec 
b/redhat/self-test/data/centos-78e36f3b0dae.el7.spec
index blahblah..blahblah 100755
--- a/redhat/self-test/data/centos-78e36f3b0dae.el7.spec
+++ b/redhat/self-test/data/centos-78e36f3b0dae.el7.spec
@@ -115,7 +115,6 @@ Summary: The Linux kernel
 %if %{zipmodules}
 %global zipsed -e 's/\.ko$/\.ko.xz/'
 # for parallel xz processes, replace with 1 to go back to single process
-%global zcpu `nproc --all`
 %endif
 
 %define buildid .test
@@ -2349,7 +2348,7 @@ find Documentation -type d | xargs chmod u+w
 fi \
   fi \
   if [ "%{zipmodules}" -eq "1" ]; then \
-find $RPM_BUILD_ROOT/lib/modules/ -type f -name '*.ko' | xargs -P%{zcpu} 
xz; \
+find $RPM_BUILD_ROOT/lib/modules/ -type f -name '*.ko' | xargs 
-P${RPM_BUILD_NCPUS} xz; \
   fi \
 %{nil}
 
diff --git a/redhat/self-test/data/centos-78e36f3b0dae.fc25.spec 
b/redhat/self-test/data/centos-78e36f3b0dae.fc25.spec
index blahblah..blahblah 100755
--- a/redhat/self-test/data/centos-78e36f3b0dae.fc25.spec
+++ b/redhat/self-test/data/centos-78e36f3b0dae.fc25.spec
@@ -115,7 +115,6 @@ Summary: The Linux kernel
 %if %{zipmodules}
 %global zipsed -e 's/\.ko$/\.ko.xz/'
 # for parallel xz processes, replace with 1 to go back to single process
-%global zcpu `nproc --all`
 %endif
 
 %define buildid .test
@@ -2349,7 +2348,7 @@ find Documentation -type d | xargs chmod u+w
 fi \
   fi \
   if [ "%{zipmodules}" -eq "1" ]; then \
-find $RPM_BUILD_ROOT/lib/modules/ -type f -name '*.ko' | xargs -P%{zcpu} 
xz; \
+find $RPM_BUILD_ROOT/lib/modules/ -type f -name '*.ko' | xargs 
-P${RPM_BUILD_NCPUS} xz; \
   fi \
 %{nil}
 
diff --git a/redhat/self-test/data/centos-df0cc57e057f.el7.spec 
b/redhat/self-test/data/centos-df0cc57e057f.el7.spec
index blahblah..blahblah 100755
--- a/redhat/self-test/data/centos-df0cc57e057f.el7.spec
+++ b/redhat/self-test/data/centos-df0cc57e057f.el7.spec
@@ -115,7 +115,6 @@ Summary: The Linux kernel
 %if %{zipmodules}
 %global zipsed -e 's/\.ko$/\.ko.xz/'
 # for parallel xz processes, replace with 1 to go back to single process
-%global zcpu `nproc --all`
 %endif
 
 %define buildid .test
@@ -2349,7 +2348,7 @@ find Documentation -type d | xargs chmod u+w
 fi \
   fi \
   if [ "%{zipmodules}" -eq "1" ]; then \
-find $RPM_BUILD_ROOT/lib/modules/ -type f -name '*.ko' | xargs -P%{zcpu} 

[OS-BUILD PATCHv8 4/11] redhat/configs/build_configs.sh: Use Makefile variables

2022-04-21 Thread Prarit Bhargava (via Email Bridge)
From: Prarit Bhargava 

redhat/configs/build_configs.sh: Use Makefile variables

Use Makefile variables in build_configs.sh.

Signed-off-by: Prarit Bhargava 

diff --git a/redhat/Makefile b/redhat/Makefile
index blahblah..blahblah 100644
--- a/redhat/Makefile
+++ b/redhat/Makefile
@@ -363,8 +363,8 @@ dist-configs-check: dist-configs-prep
+cd $(REDHAT)/configs; ./process_configs.sh 
$(PROCESS_CONFIGS_CHECK_OPTS) "" ""
 
 dist-configs-prep: dist-clean-configs dist-buildreq-check
-   +cd $(REDHAT)/configs; ./build_configs.sh "partial" "$(ARCH_MACH)" 
"snip" "$(RHJOBS)"
-   +cd $(REDHAT)/configs; ./build_configs.sh "$(PACKAGE_NAME)" 
"$(ARCH_MACH)" "$(FLAVOR)" "$(RHJOBS)"
+   +cd $(REDHAT)/configs; ./build_configs.sh "partial" "snip"
+   +cd $(REDHAT)/configs; ./build_configs.sh "$(PACKAGE_NAME)" "$(FLAVOR)"
 
 dist-configs-arch: ARCH_MACH = $(MACH)
 dist-configs-arch: dist-configs
diff --git a/redhat/configs/build_configs.sh b/redhat/configs/build_configs.sh
index blahblah..blahblah 100755
--- a/redhat/configs/build_configs.sh
+++ b/redhat/configs/build_configs.sh
@@ -5,19 +5,15 @@
 # files for building RHEL kernels, based on the contents of a control file
 
 PACKAGE_NAME="${1:-kernel}" # defines the package name used
-SUBARCH="${2:-}" # defines a specific arch
-SCRIPT=$(readlink -f "$0")
-OUTPUT_DIR="$PWD"
-SCRIPT_DIR=$(dirname "$SCRIPT")
-
-if [ -z "$3" ]; then
+if [ -z "$2" ]; then
cat flavors > .flavors
 else
-   echo "$3" > .flavors
+   echo "$2" > .flavors
 fi
 
-# shellcheck disable=SC2015
-RHJOBS="$(test -n "$4" && echo "$4" || nproc --all)"
+SCRIPT=$(readlink -f "$0")
+OUTPUT_DIR="$PWD"
+SCRIPT_DIR=$(dirname "$SCRIPT")
 
 LANG=en_US.UTF-8
 
@@ -146,9 +142,9 @@ function build_flavor()
arch=$(echo "$line" | cut -f1 -d"=")
configs=$(echo "$line" | cut -f2 -d"=")
 
-   if [ -n "$SUBARCH" ]; then
+   if [ -n "$ARCH_MACH" ]; then
case $arch in
-   $SUBARCH*)
+   $ARCH_MACH*)
;;
*)
continue

--
https://gitlab.com/cki-project/kernel-ark/-/merge_requests/1647
___
kernel mailing list -- kernel@lists.fedoraproject.org
To unsubscribe send an email to kernel-le...@lists.fedoraproject.org
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@lists.fedoraproject.org
Do not reply to spam on the list, report it: 
https://pagure.io/fedora-infrastructure


[OS-BUILD PATCHv8 1/11] redhat/configs/generate_all_configs.sh: Use Makefile variables

2022-04-21 Thread Prarit Bhargava (via Email Bridge)
From: Prarit Bhargava 

redhat/configs/generate_all_configs.sh: Use Makefile variables

Use Makefile variables in generate_all_configs.sh.

Signed-off-by: Prarit Bhargava 

diff --git a/redhat/Makefile b/redhat/Makefile
index blahblah..blahblah 100644
--- a/redhat/Makefile
+++ b/redhat/Makefile
@@ -344,11 +344,11 @@ dist-kabi-dw-check: dist-kabi
@rm -rf $(KABIDW)/base/$(CURARCH).tmp
 
 dist-configs-commit: dist-configs-prep
-   +@cd $(REDHAT)/configs; VERSION=$(KVERSION) ./generate_all_configs.sh 
"$(FLAVOR)" 1; \
+   +@cd $(REDHAT)/configs; ./generate_all_configs.sh 1;\
./process_configs.sh -z "$(PACKAGE_NAME)" "$(KVERSION)" "" "$(FLAVOR)" 
"$(RHJOBS)"
 
 dist-configs: dist-configs-prep
-   +@cd $(REDHAT)/configs; VERSION=$(KVERSION) ./generate_all_configs.sh 
"$(FLAVOR)" 1; \
+   +@cd $(REDHAT)/configs; ./generate_all_configs.sh 1;\
./process_configs.sh $(PROCESS_CONFIGS_OPTS) "$(PACKAGE_NAME)" 
"$(KVERSION)" "" "" "$(RHJOBS)"
 
 dist-fedora-configs: FLAVOR = fedora
diff --git a/redhat/configs/generate_all_configs.sh 
b/redhat/configs/generate_all_configs.sh
index blahblah..blahblah 100755
--- a/redhat/configs/generate_all_configs.sh
+++ b/redhat/configs/generate_all_configs.sh
@@ -1,30 +1,24 @@
 #!/bin/sh
 
 # Adjusts the configuration options to build the variants correctly
-#
-# arg1: configuration to go in the primary variant
-# arg2: are we only generating debug configs
 
-
-PRIMARY=$1
-DEBUGBUILDSENABLED=$2
-
-if [ -z "$2" ]; then
+DEBUGBUILDSENABLED=$1
+if [ -z "$DEBUGBUILDSENABLED" ]; then
exit 1
 fi
 
-if [ -z "$PRIMARY" ]; then
-   PRIMARY=rhel
+if [ -z "$FLAVOR" ]; then
+   FLAVOR=rhel
 fi
 
-if [ "$PRIMARY" = "fedora" ]; then
+if [ "$FLAVOR" = "fedora" ]; then
SECONDARY=rhel
 else
SECONDARY=fedora
 fi
 
-for i in kernel-*-"$PRIMARY".config; do
-   NEW=kernel-"$VERSION"-$(echo "$i" | cut -d - -f2- | sed s/-"$PRIMARY"//)
+for i in kernel-*-"$FLAVOR".config; do
+   NEW=kernel-"$KVERSION"-$(echo "$i" | cut -d - -f2- | sed s/-"$FLAVOR"//)
#echo $NEW
mv "$i" "$NEW"
 done
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
@@ -1442,7 +1442,7 @@ cp %{SOURCE80} .
 cp %{SOURCE3000} .
 # kernel-local
 cp %{SOURCE3001} .
-VERSION=%{version} ./generate_all_configs.sh %{primary_target} 
%{debugbuildsenabled}
+FLAVOR=%{primary_target} KVERSION=%{version} ./generate_all_configs.sh 
%{debugbuildsenabled}
 
 # Merge in any user-provided local config option changes
 %ifnarch %nobuildarches
diff --git a/redhat/self-test/data/centos-2585cf9dfaad.el7.spec 
b/redhat/self-test/data/centos-2585cf9dfaad.el7.spec
index blahblah..blahblah 100755
--- a/redhat/self-test/data/centos-2585cf9dfaad.el7.spec
+++ b/redhat/self-test/data/centos-2585cf9dfaad.el7.spec
@@ -1451,7 +1451,7 @@ cp %{SOURCE80} .
 cp %{SOURCE3000} .
 # kernel-local
 cp %{SOURCE3001} .
-VERSION=%{version} ./generate_all_configs.sh %{primary_target} 
%{debugbuildsenabled}
+FLAVOR=%{primary_target} KVERSION=%{version} ./generate_all_configs.sh 
%{debugbuildsenabled}
 
 # Merge in any user-provided local config option changes
 %ifnarch %nobuildarches
diff --git a/redhat/self-test/data/centos-2585cf9dfaad.fc25.spec 
b/redhat/self-test/data/centos-2585cf9dfaad.fc25.spec
index blahblah..blahblah 100755
--- a/redhat/self-test/data/centos-2585cf9dfaad.fc25.spec
+++ b/redhat/self-test/data/centos-2585cf9dfaad.fc25.spec
@@ -1451,7 +1451,7 @@ cp %{SOURCE80} .
 cp %{SOURCE3000} .
 # kernel-local
 cp %{SOURCE3001} .
-VERSION=%{version} ./generate_all_configs.sh %{primary_target} 
%{debugbuildsenabled}
+FLAVOR=%{primary_target} KVERSION=%{version} ./generate_all_configs.sh 
%{debugbuildsenabled}
 
 # Merge in any user-provided local config option changes
 %ifnarch %nobuildarches
diff --git a/redhat/self-test/data/centos-78e36f3b0dae.el7.spec 
b/redhat/self-test/data/centos-78e36f3b0dae.el7.spec
index blahblah..blahblah 100755
--- a/redhat/self-test/data/centos-78e36f3b0dae.el7.spec
+++ b/redhat/self-test/data/centos-78e36f3b0dae.el7.spec
@@ -1451,7 +1451,7 @@ cp %{SOURCE80} .
 cp %{SOURCE3000} .
 # kernel-local
 cp %{SOURCE3001} .
-VERSION=%{version} ./generate_all_configs.sh %{primary_target} 
%{debugbuildsenabled}
+FLAVOR=%{primary_target} KVERSION=%{version} ./generate_all_configs.sh 
%{debugbuildsenabled}
 
 # Merge in any user-provided local config option changes
 %ifnarch %nobuildarches
diff --git a/redhat/self-test/data/centos-78e36f3b0dae.fc25.spec 
b/redhat/self-test/data/centos-78e36f3b0dae.fc25.spec
index blahblah..blahblah 100755
--- a/redhat/self-test/data/centos-78e36f3b0dae.fc25.spec
+++ b/redhat/self-test/data/centos-78e36f3b0dae.fc25.spec
@@ -1451,7 +1451,7 @@ cp %{SOURCE80} .
 cp %{SOURCE3000} .
 # kernel-local
 cp %{SOURCE3001} .
-VERSION=%{version} ./generate_all_configs.sh %{primary_target} 
%{debugbuildsenabled}

[OS-BUILD PATCHv8 10/11] redhat/Makefile.rhpkg: Remove quotes for RHDISTGIT

2022-04-21 Thread Prarit Bhargava (via Email Bridge)
From: Prarit Bhargava 

redhat/Makefile.rhpkg: Remove quotes for RHDISTGIT

Remove the quotes around RHDISTGIT.  This causes problems with the bash
scripts in the dist-git-test target.

Signed-off-by: Justin M. Forbes 
Signed-off-by: Prarit Bhargava 

diff --git a/redhat/Makefile.rhpkg b/redhat/Makefile.rhpkg
index blahblah..blahblah 100644
--- a/redhat/Makefile.rhpkg
+++ b/redhat/Makefile.rhpkg
@@ -32,7 +32,7 @@ ifeq ("$(RHDISTGIT_CACHE)", "")
 endif
 
 ifeq ("$(DISTRO)", "fedora")
-   
RHDISTGIT:="ssh://$(RHDISTGIT_USER)@pkgs.fedoraproject.org/rpms/$(PACKAGE_NAME)"
+   
RHDISTGIT:=ssh://$(RHDISTGIT_USER)@pkgs.fedoraproject.org/rpms/$(PACKAGE_NAME)
 else ifeq ("$(DISTRO)", "centos")
# CentOS uses a fork + merge request based workflow with dist-git to
# handle changes, so you need to provide the gitlab username and we by
@@ -41,5 +41,5 @@ else ifeq ("$(DISTRO)", "centos")
GL_FORK_PATH?=$(PACKAGE_NAME).git
RHDISTGIT:=g...@gitlab.com:$(GL_DISTGIT_USER)/$(GL_FORK_PATH)
 else
-   
RHDISTGIT:="ssh://$(RHDISTGIT_USER)@pkgs.devel.redhat.com/rpms/$(PACKAGE_NAME)"
+   
RHDISTGIT:=ssh://$(RHDISTGIT_USER)@pkgs.devel.redhat.com/rpms/$(PACKAGE_NAME)
 endif

--
https://gitlab.com/cki-project/kernel-ark/-/merge_requests/1647
___
kernel mailing list -- kernel@lists.fedoraproject.org
To unsubscribe send an email to kernel-le...@lists.fedoraproject.org
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@lists.fedoraproject.org
Do not reply to spam on the list, report it: 
https://pagure.io/fedora-infrastructure


[OS-BUILD PATCHv8 8/11] redhat/Makefile: Deprecate SINGLE_TARBALL

2022-04-21 Thread Prarit Bhargava (via Email Bridge)
From: Prarit Bhargava 

redhat/Makefile: Deprecate SINGLE_TARBALL

We don't know if there are any users of the SINGLE_TARBALL variable.  Mark
it for deprection.  This commit can be reverted if anyone complains.

Signed-off-by: Prarit Bhargava 

diff --git a/redhat/Makefile b/redhat/Makefile
index blahblah..blahblah 100644
--- a/redhat/Makefile
+++ b/redhat/Makefile
@@ -18,6 +18,13 @@ ifdef TEST_FLAGS
   $(warning WARNING: TEST_FLAGS will be deprecated in a later release, use 
BUILD_FLAGS instead.)
 endif
 
+ifdef SINGLE_TARBALL
+  # The commit that introduced this code can be reverted if there are users of
+  # this variable.
+  # deprecated in 5.18.0
+  $(warning WARNING: SINGLE_TARBALL will be deprecated in a later release.)
+endif
+
 include Makefile.variables
 
 LANG=C

--
https://gitlab.com/cki-project/kernel-ark/-/merge_requests/1647
___
kernel mailing list -- kernel@lists.fedoraproject.org
To unsubscribe send an email to kernel-le...@lists.fedoraproject.org
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@lists.fedoraproject.org
Do not reply to spam on the list, report it: 
https://pagure.io/fedora-infrastructure


[OS-BUILD PATCHv8 5/11] redhat/scripts/rh-dist-git.sh: Use Makefile variables

2022-04-21 Thread Prarit Bhargava (via Email Bridge)
From: Prarit Bhargava 

redhat/scripts/rh-dist-git.sh: Use Makefile variables

Use Makefile variables in rh-dist-git.sh.

Signed-off-by: Prarit Bhargava 

diff --git a/redhat/Makefile b/redhat/Makefile
index blahblah..blahblah 100644
--- a/redhat/Makefile
+++ b/redhat/Makefile
@@ -637,7 +637,7 @@ endif
exit 1; \
fi; \
fi
-   $(REDHAT)/scripts/rh-dist-git.sh "$(RHDISTGIT_BRANCH)" 
"$(RHDISTGIT_CACHE)" "$(RHDISTGIT_TMP)" "$(RHDISTGIT)" "$(TARBALL)" 
"$(KABI_TARBALL)" "$(KABIDW_TARBALL)" "$(__ZSTREAM)" "$(PACKAGE_NAME)" 
"$(RHEL_MAJOR)" "$(RHPKG_BIN)" 
"$(SRPMS)/$(PACKAGE_NAME)-$(KVERSION)-$(PKGRELEASE)$(DIST).src.rpm"
+   $(REDHAT)/scripts/rh-dist-git.sh
 
 dist-rtg: dist-release
@$(MAKE) dist-release-tag
diff --git a/redhat/scripts/rh-dist-git.sh b/redhat/scripts/rh-dist-git.sh
index blahblah..blahblah 100755
--- a/redhat/scripts/rh-dist-git.sh
+++ b/redhat/scripts/rh-dist-git.sh
@@ -1,32 +1,8 @@
 #!/bin/bash
 
 # clones and updates a dist-git repo
-# $1: branch to be used
-# $2: local pristine clone of dist-git
-# $3: alternate tmp directory (if you have faster storage)
-# $4: alternate dist-git server
-# $5: kernel source tarball
-# $6: kabi stablelists tarball
-# $7: dwarf-bases kabi tarball
-# $8: zstream build
-# $9: package name
-# shellcheck disable=SC2164
-
-rhdistgit_branch=$1;
-rhdistgit_cache=$2;
-rhdistgit_tmp=$3;
-rhdistgit_server=$4;
-rhdistgit_tarball=$5;
-rhdistgit_kabi_tarball=$6;
-rhdistgit_kabidw_tarball=$7;
-rhdistgit_zstream_flag=$8;
-package_name=$9;
-rhel_major=${10};
-rhpkg_bin=${11};
-srpm_name=${12};
 
-redhat=$(dirname "$0")/..;
-topdir="$redhat"/..;
+# shellcheck disable=SC2164
 
 function die
 {
@@ -37,41 +13,41 @@ function die
 function upload()
 {
[ -n "$RH_DIST_GIT_TEST" ] && return
-   $rhpkg_bin upload "$@" >/dev/null || die "uploading $*";
+   $RHPKG_BIN upload "$@" >/dev/null || die "uploading $*";
 }
 
-if [ -z "$rhdistgit_branch" ]; then
+if [ -z "$RHDISTGIT_BRANCH" ]; then
echo "$0  [local clone] [alternate tmp] [alternate dist-git 
server]" >&2;
exit 1;
 fi
 
 echo "Cloning the repository"
 # clone the dist-git, considering cache
-tmpdir=$("$redhat"/scripts/clone_tree.sh "$rhdistgit_server" 
"$rhdistgit_cache" "$rhdistgit_tmp" "$package_name" "$rhel_major" "$rhpkg_bin");
+tmpdir=$("$REDHAT"/scripts/clone_tree.sh "$RHDISTGIT" "$RHDISTGIT_CACHE" 
"$RHDISTGIT_TMP" "$PACKAGE_NAME" "$RHEL_MAJOR" "$RHPKG_BIN");
 
 echo "Switching the branch"
 # change in the correct branch
-cd "$tmpdir/$package_name";
-$rhpkg_bin switch-branch "$rhdistgit_branch" || die "switching to branch 
$rhdistgit_branch";
+cd "$tmpdir/$PACKAGE_NAME";
+$RHPKG_BIN switch-branch "$RHDISTGIT_BRANCH" || die "switching to branch 
$RHDISTGIT_BRANCH";
 
 echo "Copying updated files"
 # copy the required files (redhat/git/files)
-"$redhat"/scripts/expand_srpm.sh "$topdir" "$tmpdir" "$package_name" 
"$srpm_name";
+"$REDHAT"/scripts/expand_srpm.sh "$TOPDIR" "$tmpdir" "$PACKAGE_NAME" "$SRPM";
 
 echo "Uploading new tarballs"
 # upload tarballs
-sed -i "/linux-.*.tar.xz/d" "$tmpdir/$package_name"/{sources,.gitignore};
-upload_list="$rhdistgit_tarball"
+sed -i "/linux-.*.tar.xz/d" "$tmpdir/$PACKAGE_NAME"/{sources,.gitignore};
+upload_list="$TARBALL"
 
 # Only upload kernel-abi-stablelists tarball if its release counter changed.
-if [ "$rhdistgit_zstream_flag" == "no" ]; then
-   if ! grep -q "$rhdistgit_kabi_tarball" "$tmpdir/$package_name"/sources; 
then
-   sed -i "/kernel-abi-stablelists.*.tar.bz2/d" 
"$tmpdir/$package_name"/{sources,.gitignore};
-   upload_list="$upload_list $rhdistgit_kabi_tarball"
+if [ "$__ZSTREAM" == "no" ]; then
+   if ! grep -q "$KABI_TARBALL" "$tmpdir/$PACKAGE_NAME"/sources; then
+   sed -i "/kernel-abi-stablelists.*.tar.bz2/d" 
"$tmpdir/$PACKAGE_NAME"/{sources,.gitignore};
+   upload_list="$upload_list $KABI_TARBALL"
fi
-   if ! grep -q "$rhdistgit_kabidw_tarball" 
"$tmpdir/$package_name"/sources; then
-   sed -i "/kernel-kabi-dw-.*.tar.bz2/d" 
"$tmpdir/$package_name"/{sources,.gitignore};
-   upload_list="$upload_list $rhdistgit_kabidw_tarball"
+   if ! grep -q "$KABIDW_TARBALL" "$tmpdir/$PACKAGE_NAME"/sources; then
+   sed -i "/kernel-kabi-dw-.*.tar.bz2/d" 
"$tmpdir/$PACKAGE_NAME"/{sources,.gitignore};
+   upload_list="$upload_list $KABIDW_TARBALL"
fi
 fi
 
@@ -82,10 +58,10 @@ upload $upload_list
 echo "Creating diff for review ($tmpdir/diff) and changelog"
 # diff the result (redhat/cvs/dontdiff). note: diff reuturns 1 if
 # differences were found
-diff -X "$redhat"/git/dontdiff -upr "$tmpdir/$package_name" 
"$redhat"/rpm/SOURCES/ > "$tmpdir"/diff;
+diff -X "$REDHAT"/git/dontdiff -upr "$tmpdir/$PACKAGE_NAME" 
"$REDHAT"/rpm/SOURCES/ > "$tmpdir"/diff;
 # creating the changelog file
-"$redhat"/scripts/create_distgit_changelog.sh 
"$redhat/rpm/SOURCES/$package_name".spec \
-   

[OS-BUILD PATCHv8 3/11] redhat/configs/process_configs.sh: Use Makefile variables

2022-04-21 Thread Prarit Bhargava (via Email Bridge)
From: Prarit Bhargava 

redhat/configs/process_configs.sh: Use Makefile variables

Cleanup up parameters and use Makefile variables in process_config.sh.

Signed-off-by: Prarit Bhargava 

diff --git a/redhat/Makefile b/redhat/Makefile
index blahblah..blahblah 100644
--- a/redhat/Makefile
+++ b/redhat/Makefile
@@ -345,11 +345,11 @@ dist-kabi-dw-check: dist-kabi
 
 dist-configs-commit: dist-configs-prep
+@cd $(REDHAT)/configs; ./generate_all_configs.sh 1;\
-   ./process_configs.sh -z "$(PACKAGE_NAME)" "$(KVERSION)" "" "$(FLAVOR)" 
"$(RHJOBS)"
+   ./process_configs.sh -z "$(KVERSION)" "$(FLAVOR)"
 
 dist-configs: dist-configs-prep
+@cd $(REDHAT)/configs; ./generate_all_configs.sh 1;\
-   ./process_configs.sh $(PROCESS_CONFIGS_OPTS) "$(PACKAGE_NAME)" 
"$(KVERSION)" "" "" "$(RHJOBS)"
+   ./process_configs.sh $(PROCESS_CONFIGS_OPTS) "$(KVERSION)" ""
 
 dist-fedora-configs: FLAVOR = fedora
 dist-fedora-configs: dist-configs
@@ -360,7 +360,7 @@ dist-rhel-configs: dist-configs
 rh-configs: dist-rhel-configs
 
 dist-configs-check: dist-configs-prep
-   +cd $(REDHAT)/configs; ./process_configs.sh 
$(PROCESS_CONFIGS_CHECK_OPTS) $(PACKAGE_NAME) "" "" "" "$(RHJOBS)"
+   +cd $(REDHAT)/configs; ./process_configs.sh 
$(PROCESS_CONFIGS_CHECK_OPTS) "" ""
 
 dist-configs-prep: dist-clean-configs dist-buildreq-check
+cd $(REDHAT)/configs; ./build_configs.sh "partial" "$(ARCH_MACH)" 
"snip" "$(RHJOBS)"
diff --git a/redhat/configs/process_configs.sh 
b/redhat/configs/process_configs.sh
index blahblah..blahblah 100755
--- a/redhat/configs/process_configs.sh
+++ b/redhat/configs/process_configs.sh
@@ -191,7 +191,7 @@ function commit_new_configs()
# assume we are in $source_tree/configs, need to get to top level
pushd "$(switch_to_toplevel)" &>/dev/null
 
-   for cfg in "$SCRIPT_DIR/${PACKAGE_NAME}${KVERREL}${SUBARCH}"*.config
+   for cfg in "$SCRIPT_DIR/${PACKAGE_NAME}${KVERREL}"*.config
do
arch=$(head -1 "$cfg" | cut -b 3-)
cfgtmp="${cfg}.tmp"
@@ -303,7 +303,7 @@ function process_configs()
[ -f .mismatches ] && rm -f .mismatches
 
count=0
-   for cfg in "$SCRIPT_DIR/${PACKAGE_NAME}${KVERREL}${SUBARCH}"*.config
+   for cfg in "$SCRIPT_DIR/${PACKAGE_NAME}${KVERREL}"*.config
do
if [ "$count" -eq 0 ]; then
# do the first one by itself so that tools are built
@@ -385,12 +385,9 @@ do
shift
 done
 
-PACKAGE_NAME="${1:-kernel}" # defines the package name used
-KVERREL="$(test -n "$2" && echo "-$2" || echo "")"
-SUBARCH="$(test -n "$3" && echo "-$3" || echo "")"
-FLAVOR="$(test -n "$4" && echo "-$4" || echo "-ark")"
+KVERREL="$(test -n "$1" && echo "-$1" || echo "")"
+FLAVOR="$(test -n "$2" && echo "-$2" || echo "-ark")"
 # shellcheck disable=SC2015
-RHJOBS="$(test -n "$5" && echo "$5" || nproc --all)"
 SCRIPT=$(readlink -f "$0")
 SCRIPT_DIR=$(dirname "$SCRIPT")
 
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
@@ -1492,7 +1492,7 @@ for opt in %{clang_make_opts}; do
   OPTS="$OPTS -m $opt"
 done
 %endif
-./process_configs.sh $OPTS kernel %{rpmversion}
+RHJOBS=$RPM_BUILD_NCPUS PACKAGE_NAME=kernel ./process_configs.sh $OPTS 
${rpmversion}
 
 cp %{SOURCE82} .
 RPM_SOURCE_DIR=$RPM_SOURCE_DIR ./update_scripts.sh %{primary_target}
diff --git a/redhat/self-test/data/centos-2585cf9dfaad.el7.spec 
b/redhat/self-test/data/centos-2585cf9dfaad.el7.spec
index blahblah..blahblah 100755
--- a/redhat/self-test/data/centos-2585cf9dfaad.el7.spec
+++ b/redhat/self-test/data/centos-2585cf9dfaad.el7.spec
@@ -1501,7 +1501,7 @@ for opt in %{clang_make_opts}; do
   OPTS="$OPTS -m $opt"
 done
 %endif
-./process_configs.sh $OPTS kernel %{rpmversion}
+RHJOBS=$RPM_BUILD_NCPUS PACKAGE_NAME=kernel ./process_configs.sh $OPTS 
${rpmversion}
 
 cp %{SOURCE82} .
 RPM_SOURCE_DIR=$RPM_SOURCE_DIR ./update_scripts.sh %{primary_target}
diff --git a/redhat/self-test/data/centos-2585cf9dfaad.fc25.spec 
b/redhat/self-test/data/centos-2585cf9dfaad.fc25.spec
index blahblah..blahblah 100755
--- a/redhat/self-test/data/centos-2585cf9dfaad.fc25.spec
+++ b/redhat/self-test/data/centos-2585cf9dfaad.fc25.spec
@@ -1501,7 +1501,7 @@ for opt in %{clang_make_opts}; do
   OPTS="$OPTS -m $opt"
 done
 %endif
-./process_configs.sh $OPTS kernel %{rpmversion}
+RHJOBS=$RPM_BUILD_NCPUS PACKAGE_NAME=kernel ./process_configs.sh $OPTS 
${rpmversion}
 
 cp %{SOURCE82} .
 RPM_SOURCE_DIR=$RPM_SOURCE_DIR ./update_scripts.sh %{primary_target}
diff --git a/redhat/self-test/data/centos-78e36f3b0dae.el7.spec 
b/redhat/self-test/data/centos-78e36f3b0dae.el7.spec
index blahblah..blahblah 100755
--- a/redhat/self-test/data/centos-78e36f3b0dae.el7.spec
+++ b/redhat/self-test/data/centos-78e36f3b0dae.el7.spec
@@ -1501,7 +1501,7 @@ for opt in %{clang_make_opts}; do
   OPTS="$OPTS -m $opt"
 done
 %endif

[OS-BUILD PATCHv8 7/11] redhat/Makefile: Move SINGLE_TARBALL to Makefile.variables

2022-04-21 Thread Prarit Bhargava (via Email Bridge)
From: Prarit Bhargava 

redhat/Makefile: Move SINGLE_TARBALL to Makefile.variables

Move the SINGLE_TARBALL variable to Makefile.variables, and clean up
comments.

Signed-off-by: Prarit Bhargava 

diff --git a/redhat/Makefile b/redhat/Makefile
index blahblah..blahblah 100644
--- a/redhat/Makefile
+++ b/redhat/Makefile
@@ -206,8 +206,6 @@ SRPM:=$(SRPMS)/$(PACKAGE_NAME)-$(RPMVERSION)$(DIST).src.rpm
 # specific values should be set.
 #
 ifeq ("$(DISTRO)", "fedora")
-  # A non-unified tarball means that the tarball is only upstream sources
-  # and the patches get applied as a diff in the spec file
   SINGLE_TARBALL:=0
   TARFILE_RELEASE:=$(UPSTREAM_TARBALL_NAME)
   RHDISTGIT_BRANCH:=rawhide
@@ -215,8 +213,6 @@ ifeq ("$(DISTRO)", "fedora")
 BUILD_SCRATCH_TARGET:=temp-ark-rhel-8-test
   endif
 else ifeq ("$(DISTRO)", "centos")
-  # A unified tarball means that the tarball in the srpm contains both the
-  # upstream sources and RHEL specific patches.
   SINGLE_TARBALL:=1
   RHDISTGIT_BRANCH:=c$(RHEL_MAJOR)s
   ifndef BUILD_PROFILE
@@ -227,8 +223,6 @@ else ifeq ("$(DISTRO)", "centos")
   endif
   TARFILE_RELEASE:=$(RPMVERSION)
 else
-  # A unified tarball means that the tarball in the srpm contains both the
-  # upstream sources and RHEL specific patches.
   SINGLE_TARBALL:=1
   RHDISTGIT_BRANCH:=rhel-$(RHEL_MAJOR).$(RHEL_MINOR).0
   ifndef BUILD_SCRATCH_TARGET
diff --git a/redhat/Makefile.variables b/redhat/Makefile.variables
index blahblah..blahblah 100644
--- a/redhat/Makefile.variables
+++ b/redhat/Makefile.variables
@@ -127,3 +127,8 @@ RHSELFTESTDATA ?=
 # This variable is used by the redhat/self-tests.  It should not be
 # considered stable and my be changed or removed without warning.
 RHDISTDATADIR ?=
+
+# This variable is used in redhat/genspec.sh, and determines if all commits are
+# rolled into a single tarball, or if the commits are individually broken out
+# into separate patches and then included in the tarball.
+SINGLE_TARBALL ?=
diff --git a/redhat/genspec.sh b/redhat/genspec.sh
index blahblah..blahblah 100755
--- a/redhat/genspec.sh
+++ b/redhat/genspec.sh
@@ -163,12 +163,16 @@ mv -f "$clogf.full" "$SOURCES/$CHANGELOG"
 echo "MARKER is $MARKER"
 
 if [ "$SINGLE_TARBALL" = 0 ]; then
+   # The tarball in the SRPM contains only the upstream sources.
+
# May need to preserve word splitting in EXCLUDE_FILES
# shellcheck disable=SC2086
git diff -p --no-renames --stat "$MARKER"..  $EXCLUDE_FILES \
> ${SOURCES}/patch-${RPMKVERSION}.${RPMKPATCHLEVEL}-redhat.patch
 else
-   # Need an empty file for dist-git compatibility
+   # The tarball in the SRPM contains both upstream sources and OS-specifc
+   # commits.  Even though this is the case, an empty file for dist-git
+   # compatibility is necessary.
touch "${SOURCES}/patch-${RPMKVERSION}.${RPMKPATCHLEVEL}"-redhat.patch
 fi
 

--
https://gitlab.com/cki-project/kernel-ark/-/merge_requests/1647
___
kernel mailing list -- kernel@lists.fedoraproject.org
To unsubscribe send an email to kernel-le...@lists.fedoraproject.org
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@lists.fedoraproject.org
Do not reply to spam on the list, report it: 
https://pagure.io/fedora-infrastructure


[OS-BUILD PATCHv8 6/11] redhat/Makefile: Use RPMVERSION

2022-04-21 Thread Prarit Bhargava (via Email Bridge)
From: Prarit Bhargava 

redhat/Makefile: Use RPMVERSION

Use RPMVERSION where appropriate in the Makefile.

Signed-off-by: Prarit Bhargava 

diff --git a/redhat/Makefile b/redhat/Makefile
index blahblah..blahblah 100644
--- a/redhat/Makefile
+++ b/redhat/Makefile
@@ -199,7 +199,7 @@ 
KABIDW_TARBALL:=$(SOURCES)/kernel-kabi-dw-$(KVERSION)-$(DISTRO_BUILD).tar.bz2
 PKGRELEASE:=$(PREBUILD)$(BUILD)$(BUILDID)
 RPMVERSION:=$(RPMKVERSION).$(RPMKPATCHLEVEL).$(RPMKSUBLEVEL)-$(PKGRELEASE)
 SPECRELEASE:=$(PREBUILD)$(BUILD)%{?buildid}%{?dist}
-SRPM:=$(SRPMS)/$(PACKAGE_NAME)-$(KVERSION)-$(PKGRELEASE)$(DIST).src.rpm
+SRPM:=$(SRPMS)/$(PACKAGE_NAME)-$(RPMVERSION)$(DIST).src.rpm
 
 #
 # This conditional statement is where fedora, centos, and other (aka RHEL)
@@ -225,7 +225,7 @@ else ifeq ("$(DISTRO)", "centos")
   ifndef BUILD_SCRATCH_TARGET
 BUILD_SCRATCH_TARGET:=c$(RHEL_MAJOR)s-candidate
   endif
-  TARFILE_RELEASE:=$(KVERSION)-$(PKGRELEASE)
+  TARFILE_RELEASE:=$(RPMVERSION)
 else
   # A unified tarball means that the tarball in the srpm contains both the
   # upstream sources and RHEL specific patches.
@@ -234,7 +234,7 @@ else
   ifndef BUILD_SCRATCH_TARGET
 BUILD_SCRATCH_TARGET:=rhel-$(RHEL_MAJOR).$(RHEL_MINOR).0-test-pesign
   endif
-  TARFILE_RELEASE:=$(KVERSION)-$(PKGRELEASE)
+  TARFILE_RELEASE:=$(RPMVERSION)
 endif
 
 ifndef BUILD_TARGET
@@ -397,7 +397,7 @@ dist-stub-key:
 .PHONY:$(TARBALL)
 $(TARBALL):
@if [ $(SINGLE_TARBALL) -eq 1 ]; then \
-   scripts/create-tarball.sh $(GITID) 
linux-$(KVERSION)-$(PKGRELEASE); \
+   scripts/create-tarball.sh $(GITID) linux-$(RPMVERSION); \
else \
scripts/create-tarball.sh $(MARKER) linux-$(TARFILE_RELEASE); \
fi
@@ -556,7 +556,7 @@ dist-release-finish: setup-source
@cp $(SOURCES)/$(CHANGELOG) $(REDHAT)/$(CHANGELOG)
@$(GIT) add $(REDHAT)/$(CHANGELOG)
@$(GIT) add $(REDHAT)/marker
-   @$(GIT) commit -s ../Makefile.rhelver $(REDHAT)/marker 
$(REDHAT)/$(CHANGELOG) $(PACKAGE_NAME).spec.template -m "[redhat] 
$(PACKAGE_NAME)-$(KVERSION)-$(PKGRELEASE)"
+   @$(GIT) commit -s ../Makefile.rhelver $(REDHAT)/marker 
$(REDHAT)/$(CHANGELOG) $(PACKAGE_NAME).spec.template -m "[redhat] 
$(PACKAGE_NAME)-$(RPMVERSION)"
 dist-release-changed: setup-source
@cp $(SOURCES)/$(CHANGELOG) $(REDHAT)/$(CHANGELOG)
@echo $(MARKER) > $(REDHAT)/marker
@@ -572,7 +572,7 @@ dist-release-changed: setup-source
 dist-release: dist-clean-sources
@$(MAKE) dist-release-changed
 dist-release-tag:
-   @$(GIT) tag -a -m "$(PACKAGE_NAME)-$(RPMVERSION)" 
$(PACKAGE_NAME)-$(KVERSION)-$(PKGRELEASE)
+   @$(GIT) tag -a -m "$(PACKAGE_NAME)-$(RPMVERSION)" 
$(PACKAGE_NAME)-$(RPMVERSION)
 
 git-tree-check:
@if test -n "$(DIST_PUSH)" && test -z "$(shell $(GIT) remote get-url 
gitlab 2>/dev/null)"; then \
@@ -614,7 +614,7 @@ dist-vr-check:
fi
 
 dist-brew dist-koji: dist-%: dist-vr-check dist-srpm
-   $* $(BUILD_PROFILE) build $(BUILD_FLAGS) $(BUILD_TARGET) 
$(SRPMS)/$(PACKAGE_NAME)-$(KVERSION)-$(PKGRELEASE)$(DIST).src.rpm $(OUTPUT_FILE)
+   $* $(BUILD_PROFILE) build $(BUILD_FLAGS) $(BUILD_TARGET) 
$(SRPMS)/$(PACKAGE_NAME)-$(RPMVERSION)$(DIST).src.rpm $(OUTPUT_FILE)
 
 distg-brew distg-koji: distg-%: dist-vr-check
$* $(BUILD_PROFILE) build $(BUILD_FLAGS) $(BUILD_TARGET) 
"$(RHGITURL)?redhat/koji#$(RHGITCOMMIT)"

--
https://gitlab.com/cki-project/kernel-ark/-/merge_requests/1647
___
kernel mailing list -- kernel@lists.fedoraproject.org
To unsubscribe send an email to kernel-le...@lists.fedoraproject.org
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@lists.fedoraproject.org
Do not reply to spam on the list, report it: 
https://pagure.io/fedora-infrastructure


[OS-BUILD PATCHv8 0/11] redhat: Use Makefile variables in scripts

2022-04-21 Thread Prarit Bhargava (via Email Bridge)
From: Prarit Bhargava on gitlab.com
Merge Request: https://gitlab.com/cki-project/kernel-ark/-/merge_requests/1647

Use Makefile variables in scripts that are called from the Makefile.

Signed-off-by: Prarit Bhargava 

---
 redhat/configs/build_configs.sh |  18 ++---
 redhat/configs/generate_all_configs.sh  |  20 ++
 redhat/configs/process_configs.sh   |  11 +--
 redhat/scripts/create-tarball.sh|   8 +-
 redhat/scripts/rh-dist-git.sh   |  62 ++--
 redhat/self-test/data/centos-2585cf9dfaad.el7   |   4 +-
 redhat/self-test/data/centos-2585cf9dfaad.el7.spec  |  47 ---
 redhat/self-test/data/centos-2585cf9dfaad.fc25  |   4 +-
 redhat/self-test/data/centos-2585cf9dfaad.fc25.spec |  47 ---
 redhat/self-test/data/centos-78e36f3b0dae.el7   |   4 +-
 redhat/self-test/data/centos-78e36f3b0dae.el7.spec  |  47 ---
 redhat/self-test/data/centos-78e36f3b0dae.fc25  |   4 +-
 redhat/self-test/data/centos-78e36f3b0dae.fc25.spec |  47 ---
 redhat/self-test/data/centos-df0cc57e057f.el7   |   4 +-
 redhat/self-test/data/centos-df0cc57e057f.el7.spec  |  47 ---
 redhat/self-test/data/centos-df0cc57e057f.fc25  |   4 +-
 redhat/self-test/data/centos-df0cc57e057f.fc25.spec |  47 ---
 redhat/self-test/data/centos-fce15c45d3fb.el7   |   4 +-
 redhat/self-test/data/centos-fce15c45d3fb.el7.spec  |  47 ---
 redhat/self-test/data/centos-fce15c45d3fb.fc25  |   4 +-
 redhat/self-test/data/centos-fce15c45d3fb.fc25.spec |  47 ---
 redhat/self-test/data/create-data.sh|   4 +-
 redhat/self-test/data/fedora-2585cf9dfaad.el7   |   6 +-
 redhat/self-test/data/fedora-2585cf9dfaad.el7.spec  |  47 ---
 redhat/self-test/data/fedora-2585cf9dfaad.fc25  |   6 +-
 redhat/self-test/data/fedora-2585cf9dfaad.fc25.spec |  47 ---
 redhat/self-test/data/fedora-78e36f3b0dae.el7   |   6 +-
 redhat/self-test/data/fedora-78e36f3b0dae.el7.spec  |  47 ---
 redhat/self-test/data/fedora-78e36f3b0dae.fc25  |   6 +-
 redhat/self-test/data/fedora-78e36f3b0dae.fc25.spec |  47 ---
 redhat/self-test/data/fedora-df0cc57e057f.el7   |   6 +-
 redhat/self-test/data/fedora-df0cc57e057f.el7.spec  |  47 ---
 redhat/self-test/data/fedora-df0cc57e057f.fc25  |   6 +-
 redhat/self-test/data/fedora-df0cc57e057f.fc25.spec |  47 ---
 redhat/self-test/data/fedora-fce15c45d3fb.el7   |   6 +-
 redhat/self-test/data/fedora-fce15c45d3fb.el7.spec  |  47 ---
 redhat/self-test/data/fedora-fce15c45d3fb.fc25  |   6 +-
 redhat/self-test/data/fedora-fce15c45d3fb.fc25.spec |  47 ---
 redhat/self-test/data/rhel-2585cf9dfaad.el7 |   6 +-
 redhat/self-test/data/rhel-2585cf9dfaad.el7.spec|  47 ---
 redhat/self-test/data/rhel-2585cf9dfaad.fc25|   6 +-
 redhat/self-test/data/rhel-2585cf9dfaad.fc25.spec   |  47 ---
 redhat/self-test/data/rhel-78e36f3b0dae.el7 |   6 +-
 redhat/self-test/data/rhel-78e36f3b0dae.el7.spec|  47 ---
 redhat/self-test/data/rhel-78e36f3b0dae.fc25|   6 +-
 redhat/self-test/data/rhel-78e36f3b0dae.fc25.spec   |  47 ---
 redhat/self-test/data/rhel-df0cc57e057f.el7 |   6 +-
 redhat/self-test/data/rhel-df0cc57e057f.el7.spec|  47 ---
 redhat/self-test/data/rhel-df0cc57e057f.fc25|   6 +-
 redhat/self-test/data/rhel-df0cc57e057f.fc25.spec   |  47 ---
 redhat/self-test/data/rhel-fce15c45d3fb.el7 |   6 +-
 redhat/self-test/data/rhel-fce15c45d3fb.el7.spec|  47 ---
 redhat/self-test/data/rhel-fce15c45d3fb.fc25|   6 +-
 redhat/self-test/data/rhel-fce15c45d3fb.fc25.spec   |  47 ---
 redhat/Makefile |  53 +
 redhat/Makefile.rhpkg   |   4 +-
 redhat/Makefile.variables   |   5 +
 redhat/genspec.sh   |   6 +-
 redhat/kernel.spec.template |   7 +-
 59 files changed, 774 insertions(+), 680 deletions(-)
___
kernel mailing list -- kernel@lists.fedoraproject.org
To unsubscribe send an email to kernel-le...@lists.fedoraproject.org
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@lists.fedoraproject.org
Do not reply to spam on the list, report it: 
https://pagure.io/fedora-infrastructure


[OS-BUILD PATCHv8 11/11] redhat/self-test: Clean up data set

2022-04-21 Thread Prarit Bhargava (via Email Bridge)
From: Prarit Bhargava 

redhat/self-test: Clean up data set

After running 'make dist-self-test-data' it was noticed that there have
been changes made to the kernel.spec file since the self-test
data was introduced and a few more variables need to be changed for
testing purposes.

Additional fix: Remove RHEL_RELEASE as this changes build-to-build.

Clean up the self-test data set.

Signed-off-by: Prarit Bhargava 

diff --git a/redhat/Makefile b/redhat/Makefile
index blahblah..blahblah 100644
--- a/redhat/Makefile
+++ b/redhat/Makefile
@@ -28,11 +28,17 @@ endif
 include Makefile.variables
 
 LANG=C
+
 ifndef RHSELFTESTDATA
   TOPDIR:=$(shell $(GIT) rev-parse --show-toplevel)
 else
+  # change TOPDIR to be relative
   TOPDIR:=..
+  # RHEL_RELEASE may be updated which will cause a difference with the BUILD 
variable
+  RHEL_RELEASE:=6
+  BUILD:=$(RHEL_RELEASE)
 endif
+
 REDHAT:=$(TOPDIR)/redhat
 include $(TOPDIR)/Makefile.rhelver
 
diff --git a/redhat/self-test/data/centos-2585cf9dfaad.el7 
b/redhat/self-test/data/centos-2585cf9dfaad.el7
index blahblah..blahblah 100644
--- a/redhat/self-test/data/centos-2585cf9dfaad.el7
+++ b/redhat/self-test/data/centos-2585cf9dfaad.el7
@@ -2,6 +2,7 @@
 .SHELLSTATUS=0 
 ARCHCONFIG=X86_64 
 ARCH_LIST=aarch64 ppc64le s390x x86_64 
+BUILD=6 
 BUILD_FLAGS= 
 BUILD_PROFILE=-p stream 
 BUMP_RELEASE=yes 
@@ -46,7 +47,6 @@ RHDISTGIT_TMP=/tmp
 RHDISTGIT_USER="shadowman" 
 RHEL_MAJOR=9 
 RHEL_MINOR=99 
-RHEL_RELEASE=6 
 RHPKG_BIN=centpkg 
 RHSELFTESTDATA=1 
 RPM=../redhat/rpm 
@@ -92,9 +92,9 @@ BUILD_SCRATCH_TARGET=temp-ark-rhel-8-test
 BUILD_TARGET=--scratch temp-ark-rhel-8-test
 BUILD_PROFILE=
 BUILD_FLAGS=
-BUILD=6
 PREBUILD_GIT_ONLY=1
 RHGITCOMMIT=HEAD
 RHJOBS=1
 NO_CONFIGCHECKS=
 RHSELFTESTDATA=
+SINGLE_TARBALL=0
diff --git a/redhat/self-test/data/centos-2585cf9dfaad.el7.spec 
b/redhat/self-test/data/centos-2585cf9dfaad.el7.spec
index blahblah..blahblah 100755
--- a/redhat/self-test/data/centos-2585cf9dfaad.el7.spec
+++ b/redhat/self-test/data/centos-2585cf9dfaad.el7.spec
@@ -412,11 +412,6 @@ Summary: The Linux kernel
 %define with_zfcpdump 0
 %endif
 
-# skip BTF in kernel modules for s390x
-%ifnarch s390x
-%define with_kmod_btf --keep-section '.BTF'
-%endif
-
 %if 0%{?fedora}
 # This is not for Fedora
 %define with_zfcpdump 0
@@ -777,7 +772,6 @@ Source33: kernel-x86_64-debug-rhel.config
 
 Source34: filter-x86_64.sh.rhel
 Source35: filter-armv7hl.sh.rhel
-Source36: filter-i686.sh.rhel
 Source37: filter-aarch64.sh.rhel
 Source38: filter-ppc64le.sh.rhel
 Source39: filter-s390x.sh.rhel
@@ -796,8 +790,6 @@ Source54: kernel-armv7hl-fedora.config
 Source55: kernel-armv7hl-debug-fedora.config
 Source56: kernel-armv7hl-lpae-fedora.config
 Source57: kernel-armv7hl-lpae-debug-fedora.config
-Source58: kernel-i686-fedora.config
-Source59: kernel-i686-debug-fedora.config
 Source60: kernel-ppc64le-fedora.config
 Source61: kernel-ppc64le-debug-fedora.config
 Source62: kernel-s390x-fedora.config
@@ -807,7 +799,6 @@ Source65: kernel-x86_64-debug-fedora.config
 
 Source67: filter-x86_64.sh.fedora
 Source68: filter-armv7hl.sh.fedora
-Source69: filter-i686.sh.fedora
 Source70: filter-aarch64.sh.fedora
 Source71: filter-ppc64le.sh.fedora
 Source72: filter-s390x.sh.fedora
@@ -1035,7 +1026,7 @@ This package provides debug information for package 
kernel-tools.
 # symlinks because of the trailing nonmatching alternation and
 # the leading .*, because of find-debuginfo.sh's buggy handling
 # of matching the pattern against the symlinks file.
-%{expand:%%global _find_debuginfo_opts %{?_find_debuginfo_opts} -p 
'.*%%{_bindir}/centrino-decode(\.debug)?|.*%%{_bindir}/powernow-k8-decode(\.debug)?|.*%%{_bindir}/cpupower(\.debug)?|.*%%{_libdir}/libcpupower.*|.*%%{_bindir}/turbostat(\.debug)?|.*%%{_bindir}/x86_energy_perf_policy(\.debug)?|.*%%{_bindir}/tmon(\.debug)?|.*%%{_bindir}/lsgpio(\.debug)?|.*%%{_bindir}/gpio-hammer(\.debug)?|.*%%{_bindir}/gpio-event-mon(\.debug)?|.*%%{_bindir}/gpio-watch(\.debug)?|.*%%{_bindir}/iio_event_monitor(\.debug)?|.*%%{_bindir}/iio_generic_buffer(\.debug)?|.*%%{_bindir}/lsiio(\.debug)?|.*%%{_bindir}/intel-speed-select(\.debug)?|.*%%{_bindir}/page_owner_sort(\.debug)?|.*%%{_bindir}/slabinfo(\.debug)?|XXX'
 -o kernel-tools-debuginfo.list}
+%{expand:%%global _find_debuginfo_opts %{?_find_debuginfo_opts} -p 
'.*%%{_bindir}/centrino-decode(\.debug)?|.*%%{_bindir}/powernow-k8-decode(\.debug)?|.*%%{_bindir}/cpupower(\.debug)?|.*%%{_libdir}/libcpupower.*|.*%%{_bindir}/turbostat(\.debug)?|.*%%{_bindir}/x86_energy_perf_policy(\.debug)?|.*%%{_bindir}/tmon(\.debug)?|.*%%{_bindir}/lsgpio(\.debug)?|.*%%{_bindir}/gpio-hammer(\.debug)?|.*%%{_bindir}/gpio-event-mon(\.debug)?|.*%%{_bindir}/gpio-watch(\.debug)?|.*%%{_bindir}/iio_event_monitor(\.debug)?|.*%%{_bindir}/iio_generic_buffer(\.debug)?|.*%%{_bindir}/lsiio(\.debug)?|.*%%{_bindir}/intel-speed-select(\.debug)?|.*%%{_bindir}/page_owner_sort(\.debug)?|.*%%{_bindir}/slabinfo(\.debug)?|.*%%{_sbindir}/intel_sdsi(\.debug)?|XXX'
 -o 

Re: [OS-BUILD PATCHv7 0/11] redhat: Use Makefile variables in scripts

2022-04-20 Thread Prarit Bhargava (via Email Bridge)
From: Prarit Bhargava on gitlab.com
https://gitlab.com/cki-project/kernel-ark/-/merge_requests/1647#note_918402722

What command are you running?  Let me try it from my side and debug.
___
kernel mailing list -- kernel@lists.fedoraproject.org
To unsubscribe send an email to kernel-le...@lists.fedoraproject.org
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@lists.fedoraproject.org
Do not reply to spam on the list, report it: 
https://pagure.io/fedora-infrastructure


Re: [OS-BUILD PATCHv7 0/11] redhat: Use Makefile variables in scripts

2022-04-18 Thread Prarit Bhargava (via Email Bridge)
From: Prarit Bhargava on gitlab.com
https://gitlab.com/cki-project/kernel-ark/-/merge_requests/1647#note_915606379

Thanks fixed.
___
kernel mailing list -- kernel@lists.fedoraproject.org
To unsubscribe send an email to kernel-le...@lists.fedoraproject.org
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@lists.fedoraproject.org
Do not reply to spam on the list, report it: 
https://pagure.io/fedora-infrastructure


[OS-BUILD PATCHv7 11/11] redhat/Makefile: Deprecate SINGLE_TARBALL

2022-04-18 Thread Prarit Bhargava (via Email Bridge)
From: Prarit Bhargava 

redhat/Makefile: Deprecate SINGLE_TARBALL

jforbes points out that the removal of the SINGLE_TARBALL may affect some
SIGs.  Since the users of the variable are unknown and maybe zero, mark it
as deprecated.  This commit can be reverted if anyone requests it be kept
in place.

Deprecate the SINGLE_TARBALL variable.

Signed-off-by: Prarit Bhargava 

diff --git a/redhat/Makefile b/redhat/Makefile
index blahblah..blahblah 100644
--- a/redhat/Makefile
+++ b/redhat/Makefile
@@ -18,6 +18,13 @@ ifdef TEST_FLAGS
   $(warning WARNING: TEST_FLAGS will be deprecated in a later release, use 
BUILD_FLAGS instead.)
 endif
 
+ifdef SINGLE_TARBALL
+  # The commit that introduced this code can be reverted if there are users of
+  # this variable.
+  # deprecated in 5.18.0
+  $(warning WARNING: SINGLE_TARBALL will be deprecated in a later release.)
+endif
+
 include Makefile.variables
 
 LANG=C
diff --git a/redhat/Makefile.variables b/redhat/Makefile.variables
index blahblah..blahblah 100644
--- a/redhat/Makefile.variables
+++ b/redhat/Makefile.variables
@@ -127,3 +127,8 @@ RHSELFTESTDATA ?=
 # This variable is used by the redhat/self-tests.  It should not be
 # considered stable and my be changed or removed without warning.
 RHDISTDATADIR ?=
+
+# This variable is used in redhat/genspec.sh.  It determines if all commits 
are rolled into
+# a single tarball, or if the commits are individually broken out into 
separate patches
+# and then included in the tarball.
+SINGLE_TARBALL ?=
diff --git a/redhat/genspec.sh b/redhat/genspec.sh
index blahblah..blahblah 100755
--- a/redhat/genspec.sh
+++ b/redhat/genspec.sh
@@ -162,7 +162,7 @@ mv -f "$clogf.full" "$SOURCES/$CHANGELOG"
 
 echo "MARKER is $MARKER"
 
-if [ "$DISTRO" == "fedora" ]; then
+if [ "$DISTRO" == "fedora" ] || [ -n "$SINGLE_TARBALL" ]; then
# The tarball in the SRPM contains only the upstream sources.
 
# May need to preserve word splitting in EXCLUDE_FILES

--
https://gitlab.com/cki-project/kernel-ark/-/merge_requests/1647
___
kernel mailing list -- kernel@lists.fedoraproject.org
To unsubscribe send an email to kernel-le...@lists.fedoraproject.org
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@lists.fedoraproject.org
Do not reply to spam on the list, report it: 
https://pagure.io/fedora-infrastructure


[OS-BUILD PATCHv7 10/11] redhat/Makefile.rhpkg: Remove quotes for RHDISTGIT

2022-04-18 Thread Prarit Bhargava (via Email Bridge)
From: Prarit Bhargava 

redhat/Makefile.rhpkg: Remove quotes for RHDISTGIT

Remove the quotes around RHDISTGIT.  This causes problems with the bash
scripts in the dist-git-test target.

Signed-off-by: Justin M. Forbes 
Signed-off-by: Prarit Bhargava 

diff --git a/redhat/Makefile.rhpkg b/redhat/Makefile.rhpkg
index blahblah..blahblah 100644
--- a/redhat/Makefile.rhpkg
+++ b/redhat/Makefile.rhpkg
@@ -32,7 +32,7 @@ ifeq ("$(RHDISTGIT_CACHE)", "")
 endif
 
 ifeq ("$(DISTRO)", "fedora")
-   
RHDISTGIT:="ssh://$(RHDISTGIT_USER)@pkgs.fedoraproject.org/rpms/$(PACKAGE_NAME)"
+   
RHDISTGIT:=ssh://$(RHDISTGIT_USER)@pkgs.fedoraproject.org/rpms/$(PACKAGE_NAME)
 else ifeq ("$(DISTRO)", "centos")
# CentOS uses a fork + merge request based workflow with dist-git to
# handle changes, so you need to provide the gitlab username and we by
@@ -41,5 +41,5 @@ else ifeq ("$(DISTRO)", "centos")
GL_FORK_PATH?=$(PACKAGE_NAME).git
RHDISTGIT:=g...@gitlab.com:$(GL_DISTGIT_USER)/$(GL_FORK_PATH)
 else
-   
RHDISTGIT:="ssh://$(RHDISTGIT_USER)@pkgs.devel.redhat.com/rpms/$(PACKAGE_NAME)"
+   
RHDISTGIT:=ssh://$(RHDISTGIT_USER)@pkgs.devel.redhat.com/rpms/$(PACKAGE_NAME)
 endif

--
https://gitlab.com/cki-project/kernel-ark/-/merge_requests/1647
___
kernel mailing list -- kernel@lists.fedoraproject.org
To unsubscribe send an email to kernel-le...@lists.fedoraproject.org
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@lists.fedoraproject.org
Do not reply to spam on the list, report it: 
https://pagure.io/fedora-infrastructure


[OS-BUILD PATCHv7 8/11] redhat/scripts/create-tarball.sh: Use Makefile variables

2022-04-18 Thread Prarit Bhargava (via Email Bridge)
From: Prarit Bhargava 

redhat/scripts/create-tarball.sh: Use Makefile variables

Use Makefile variables in redhat/scripts/create-tarball.sh.

Signed-off-by: Prarit Bhargava 

diff --git a/redhat/Makefile b/redhat/Makefile
index blahblah..blahblah 100644
--- a/redhat/Makefile
+++ b/redhat/Makefile
@@ -387,7 +387,7 @@ dist-stub-key:
 # force tarball to be regenerated if HEAD changes
 .PHONY:$(TARBALL)
 $(TARBALL):
-   scripts/create-tarball.sh $(GITID) linux-$(TARFILE_RELEASE)
+   scripts/create-tarball.sh
 
 .PHONY: $(KABI_TARBALL)
 $(KABI_TARBALL):
diff --git a/redhat/scripts/create-tarball.sh b/redhat/scripts/create-tarball.sh
index blahblah..blahblah 100755
--- a/redhat/scripts/create-tarball.sh
+++ b/redhat/scripts/create-tarball.sh
@@ -1,7 +1,6 @@
 #!/bin/sh
 
-GITID=$1
-DIR=$2
+DIR=linux-$TARFILE_RELEASE
 
 # shellcheck disable=SC1083
 XZ_THREADS=$(rpm --eval %{_smp_mflags} | sed -e 's!^-j!--threads !')

--
https://gitlab.com/cki-project/kernel-ark/-/merge_requests/1647
___
kernel mailing list -- kernel@lists.fedoraproject.org
To unsubscribe send an email to kernel-le...@lists.fedoraproject.org
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@lists.fedoraproject.org
Do not reply to spam on the list, report it: 
https://pagure.io/fedora-infrastructure


[OS-BUILD PATCHv7 9/11] redhat/self-test: Clean up data set

2022-04-18 Thread Prarit Bhargava (via Email Bridge)
From: Prarit Bhargava 

redhat/self-test: Clean up data set

After running 'make dist-self-test-data' it was noticed that there have
been changes made to the kernel.spec file since the self-test
data was introduced and a few more variables need to be changed for
testing purposes.

Clean up the self-test data set.

Signed-off-by: Prarit Bhargava 

diff --git a/redhat/Makefile b/redhat/Makefile
index blahblah..blahblah 100644
--- a/redhat/Makefile
+++ b/redhat/Makefile
@@ -21,11 +21,17 @@ endif
 include Makefile.variables
 
 LANG=C
+
 ifndef RHSELFTESTDATA
   TOPDIR:=$(shell $(GIT) rev-parse --show-toplevel)
 else
+  # change TOPDIR to be relative
   TOPDIR:=..
+  # RHEL_RELEASE may be updated which will cause a difference with the BUILD 
variable
+  RHEL_RELEASE:=6
+  BUILD:=$(RHEL_RELEASE)
 endif
+
 REDHAT:=$(TOPDIR)/redhat
 include $(TOPDIR)/Makefile.rhelver
 
diff --git a/redhat/self-test/data/centos-2585cf9dfaad.el7 
b/redhat/self-test/data/centos-2585cf9dfaad.el7
index blahblah..blahblah 100644
--- a/redhat/self-test/data/centos-2585cf9dfaad.el7
+++ b/redhat/self-test/data/centos-2585cf9dfaad.el7
@@ -2,6 +2,7 @@
 .SHELLSTATUS=0 
 ARCHCONFIG=X86_64 
 ARCH_LIST=aarch64 ppc64le s390x x86_64 
+BUILD=6 
 BUILD_FLAGS= 
 BUILD_PROFILE=-p stream 
 BUMP_RELEASE=yes 
@@ -46,7 +47,7 @@ RHDISTGIT_TMP=/tmp
 RHDISTGIT_USER="shadowman" 
 RHEL_MAJOR=9 
 RHEL_MINOR=99 
-RHEL_RELEASE=6 
+RHEL_RELEASE=14 
 RHPKG_BIN=centpkg 
 RHSELFTESTDATA=1 
 RPM=../redhat/rpm 
@@ -91,7 +92,6 @@ BUILD_SCRATCH_TARGET=temp-ark-rhel-8-test
 BUILD_TARGET=--scratch temp-ark-rhel-8-test
 BUILD_PROFILE=
 BUILD_FLAGS=
-BUILD=6
 PREBUILD_GIT_ONLY=1
 RHGITCOMMIT=HEAD
 RHJOBS=1
diff --git a/redhat/self-test/data/centos-2585cf9dfaad.el7.spec 
b/redhat/self-test/data/centos-2585cf9dfaad.el7.spec
index blahblah..blahblah 100755
--- a/redhat/self-test/data/centos-2585cf9dfaad.el7.spec
+++ b/redhat/self-test/data/centos-2585cf9dfaad.el7.spec
@@ -777,7 +777,6 @@ Source33: kernel-x86_64-debug-rhel.config
 
 Source34: filter-x86_64.sh.rhel
 Source35: filter-armv7hl.sh.rhel
-Source36: filter-i686.sh.rhel
 Source37: filter-aarch64.sh.rhel
 Source38: filter-ppc64le.sh.rhel
 Source39: filter-s390x.sh.rhel
@@ -796,8 +795,6 @@ Source54: kernel-armv7hl-fedora.config
 Source55: kernel-armv7hl-debug-fedora.config
 Source56: kernel-armv7hl-lpae-fedora.config
 Source57: kernel-armv7hl-lpae-debug-fedora.config
-Source58: kernel-i686-fedora.config
-Source59: kernel-i686-debug-fedora.config
 Source60: kernel-ppc64le-fedora.config
 Source61: kernel-ppc64le-debug-fedora.config
 Source62: kernel-s390x-fedora.config
@@ -807,7 +804,6 @@ Source65: kernel-x86_64-debug-fedora.config
 
 Source67: filter-x86_64.sh.fedora
 Source68: filter-armv7hl.sh.fedora
-Source69: filter-i686.sh.fedora
 Source70: filter-aarch64.sh.fedora
 Source71: filter-ppc64le.sh.fedora
 Source72: filter-s390x.sh.fedora
@@ -1581,7 +1577,7 @@ InitBuildVars() {
 cp configs/$Config .config
 
 %if %{signkernel}%{signmodules}
-cp $RPM_SOURCE_DIR/x509.genkey certs/.
+cp configs/x509.genkey certs/.
 %endif
 
 Arch=`head -1 .config | cut -b 3-`
@@ -2036,7 +2032,7 @@ BuildKernel() {
 remove_depmod_files
 
 # Identify modules in the kernel-modules-extras package
-%{SOURCE20} $RPM_BUILD_ROOT lib/modules/$KernelVer 
$RPM_SOURCE_DIR/mod-extra.list
+%{SOURCE20} $RPM_BUILD_ROOT lib/modules/$KernelVer $(realpath 
configs/mod-extra.list)
 # Identify modules in the kernel-modules-extras package
 %{SOURCE20} $RPM_BUILD_ROOT lib/modules/$KernelVer %{SOURCE84} internal
 
@@ -2047,6 +2043,7 @@ BuildKernel() {
 # Copy the System.map file for depmod to use, and create a backup of the
 # full module tree so we can restore it after we're done filtering
 cp System.map $RPM_BUILD_ROOT/.
+cp configs/filter-*.sh $RPM_BUILD_ROOT/.
 pushd $RPM_BUILD_ROOT
 mkdir restore
 cp -r lib/modules/$KernelVer/* restore/.
@@ -2061,7 +2058,6 @@ BuildKernel() {
# modules lists.  This actually removes anything going into -modules
# from the dir.
find lib/modules/$KernelVer/kernel -name *.ko | sort -n > modules.list
-   cp $RPM_SOURCE_DIR/filter-*.sh .
./filter-modules.sh modules.list %{_target_cpu}
rm filter-*.sh
 
diff --git a/redhat/self-test/data/centos-2585cf9dfaad.fc25 
b/redhat/self-test/data/centos-2585cf9dfaad.fc25
index blahblah..blahblah 100644
--- a/redhat/self-test/data/centos-2585cf9dfaad.fc25
+++ b/redhat/self-test/data/centos-2585cf9dfaad.fc25
@@ -2,6 +2,7 @@
 .SHELLSTATUS=0 
 ARCHCONFIG=X86_64 
 ARCH_LIST=aarch64 ppc64le s390x x86_64 
+BUILD=6 
 BUILD_FLAGS= 
 BUILD_PROFILE=-p stream 
 BUMP_RELEASE=yes 
@@ -46,7 +47,7 @@ RHDISTGIT_TMP=/tmp
 RHDISTGIT_USER="shadowman" 
 RHEL_MAJOR=9 
 RHEL_MINOR=99 
-RHEL_RELEASE=6 
+RHEL_RELEASE=14 
 RHPKG_BIN=centpkg 
 RHSELFTESTDATA=1 
 RPM=../redhat/rpm 
@@ -91,7 +92,6 @@ BUILD_SCRATCH_TARGET=temp-ark-rhel-8-test
 BUILD_TARGET=--scratch temp-ark-rhel-8-test
 BUILD_PROFILE=
 

[OS-BUILD PATCHv7 7/11] redhat/Makefile: Cleanup TARBALL target

2022-04-18 Thread Prarit Bhargava (via Email Bridge)
From: Prarit Bhargava 

redhat/Makefile: Cleanup TARBALL target

The TARBALL target can be cleaned up by using GITID everywhere.  This
results in no changes, so the SINGLE_TARBALL variable can be dropped.

Additional fix: Use GITID directly in create-tarball.sh.  GITID is already
GITID_NORMALIZE so it is safe to replace.

Signed-off-by: Prarit Bhargava 

diff --git a/redhat/Makefile b/redhat/Makefile
index blahblah..blahblah 100644
--- a/redhat/Makefile
+++ b/redhat/Makefile
@@ -206,18 +206,12 @@ 
SRPM:=$(SRPMS)/$(PACKAGE_NAME)-$(RPMVERSION)$(DIST).src.rpm
 # specific values should be set.
 #
 ifeq ("$(DISTRO)", "fedora")
-  # A non-unified tarball means that the tarball is only upstream sources
-  # and the patches get applied as a diff in the spec file
-  SINGLE_TARBALL:=0
   TARFILE_RELEASE:=$(UPSTREAM_TARBALL_NAME)
   RHDISTGIT_BRANCH:=rawhide
   ifndef BUILD_SCRATCH_TARGET
 BUILD_SCRATCH_TARGET:=temp-ark-rhel-8-test
   endif
 else ifeq ("$(DISTRO)", "centos")
-  # A unified tarball means that the tarball in the srpm contains both the
-  # upstream sources and RHEL specific patches.
-  SINGLE_TARBALL:=1
   RHDISTGIT_BRANCH:=c$(RHEL_MAJOR)s
   ifndef BUILD_PROFILE
 BUILD_PROFILE:= -p stream
@@ -227,9 +221,6 @@ else ifeq ("$(DISTRO)", "centos")
   endif
   TARFILE_RELEASE:=$(RPMVERSION)
 else
-  # A unified tarball means that the tarball in the srpm contains both the
-  # upstream sources and RHEL specific patches.
-  SINGLE_TARBALL:=1
   RHDISTGIT_BRANCH:=rhel-$(RHEL_MAJOR).$(RHEL_MINOR).0
   ifndef BUILD_SCRATCH_TARGET
 BUILD_SCRATCH_TARGET:=rhel-$(RHEL_MAJOR).$(RHEL_MINOR).0-test-pesign
@@ -396,11 +387,7 @@ dist-stub-key:
 # force tarball to be regenerated if HEAD changes
 .PHONY:$(TARBALL)
 $(TARBALL):
-   @if [ $(SINGLE_TARBALL) -eq 1 ]; then \
-   scripts/create-tarball.sh $(GITID) linux-$(RPMVERSION); \
-   else \
-   scripts/create-tarball.sh $(MARKER) linux-$(TARFILE_RELEASE); \
-   fi
+   scripts/create-tarball.sh $(GITID) linux-$(TARFILE_RELEASE)
 
 .PHONY: $(KABI_TARBALL)
 $(KABI_TARBALL):
diff --git a/redhat/genspec.sh b/redhat/genspec.sh
index blahblah..blahblah 100755
--- a/redhat/genspec.sh
+++ b/redhat/genspec.sh
@@ -162,13 +162,17 @@ mv -f "$clogf.full" "$SOURCES/$CHANGELOG"
 
 echo "MARKER is $MARKER"
 
-if [ "$SINGLE_TARBALL" = 0 ]; then
+if [ "$DISTRO" == "fedora" ]; then
+   # The tarball in the SRPM contains only the upstream sources.
+
# May need to preserve word splitting in EXCLUDE_FILES
# shellcheck disable=SC2086
git diff -p --no-renames --stat "$MARKER"..  $EXCLUDE_FILES \
> ${SOURCES}/patch-${RPMKVERSION}.${RPMKPATCHLEVEL}-redhat.patch
 else
-   # Need an empty file for dist-git compatibility
+   # The tarball in the SRPM contains both upstream sources and OS-specifc
+   # commits.  Even though this is the case, an empty file for dist-git
+   # compatibility is necessary.
touch "${SOURCES}/patch-${RPMKVERSION}.${RPMKPATCHLEVEL}"-redhat.patch
 fi
 
diff --git a/redhat/scripts/create-tarball.sh b/redhat/scripts/create-tarball.sh
index blahblah..blahblah 100755
--- a/redhat/scripts/create-tarball.sh
+++ b/redhat/scripts/create-tarball.sh
@@ -16,8 +16,7 @@ fi
 
 if [ -f "$TARBALL" ]; then
TARID=$(xzcat -qq "$TARBALL" | git get-tar-commit-id 2>/dev/null)
-   GITID_NORMALIZE=$(git log --max-count=1 --pretty=format:%H "$GITID")
-   if [ "${GITID_NORMALIZE}" = "${TARID}" ]; then
+   if [ "${GITID}" = "${TARID}" ]; then
echo "$(basename "$TARBALL") unchanged..."
exit 0
fi
diff --git a/redhat/self-test/data/centos-2585cf9dfaad.el7 
b/redhat/self-test/data/centos-2585cf9dfaad.el7
index blahblah..blahblah 100644
--- a/redhat/self-test/data/centos-2585cf9dfaad.el7
+++ b/redhat/self-test/data/centos-2585cf9dfaad.el7
@@ -57,7 +57,6 @@ RPMKSUBLEVEL=0
 RPMKVERSION=5 
 RPMVERSION=5.16.0-0.rc5.6.test 
 SHELL=/bin/sh 
-SINGLE_TARBALL=1 
 SNAPSHOT=0 
 SOURCES=../redhat/rpm/SOURCES 
 SPECFILE=kernel.spec 
diff --git a/redhat/self-test/data/centos-2585cf9dfaad.fc25 
b/redhat/self-test/data/centos-2585cf9dfaad.fc25
index blahblah..blahblah 100644
--- a/redhat/self-test/data/centos-2585cf9dfaad.fc25
+++ b/redhat/self-test/data/centos-2585cf9dfaad.fc25
@@ -57,7 +57,6 @@ RPMKSUBLEVEL=0
 RPMKVERSION=5 
 RPMVERSION=5.16.0-0.rc5.6.test 
 SHELL=/bin/sh 
-SINGLE_TARBALL=1 
 SNAPSHOT=0 
 SOURCES=../redhat/rpm/SOURCES 
 SPECFILE=kernel.spec 
diff --git a/redhat/self-test/data/centos-78e36f3b0dae.el7 
b/redhat/self-test/data/centos-78e36f3b0dae.el7
index blahblah..blahblah 100644
--- a/redhat/self-test/data/centos-78e36f3b0dae.el7
+++ b/redhat/self-test/data/centos-78e36f3b0dae.el7
@@ -57,7 +57,6 @@ RPMKSUBLEVEL=0
 RPMKVERSION=5 
 RPMVERSION=5.17.0-0.rc0.78e36f3b0dae586.6.test 
 SHELL=/bin/sh 
-SINGLE_TARBALL=1 
 SNAPSHOT=1 
 SOURCES=../redhat/rpm/SOURCES 
 SPECFILE=kernel.spec 
diff --git 

[OS-BUILD PATCHv7 5/11] redhat/scripts/rh-dist-git.sh: Use Makefile variables

2022-04-18 Thread Prarit Bhargava (via Email Bridge)
From: Prarit Bhargava 

redhat/scripts/rh-dist-git.sh: Use Makefile variables

Use Makefile variables in rh-dist-git.sh.

Signed-off-by: Prarit Bhargava 

diff --git a/redhat/Makefile b/redhat/Makefile
index blahblah..blahblah 100644
--- a/redhat/Makefile
+++ b/redhat/Makefile
@@ -637,7 +637,7 @@ endif
exit 1; \
fi; \
fi
-   $(REDHAT)/scripts/rh-dist-git.sh "$(RHDISTGIT_BRANCH)" 
"$(RHDISTGIT_CACHE)" "$(RHDISTGIT_TMP)" "$(RHDISTGIT)" "$(TARBALL)" 
"$(KABI_TARBALL)" "$(KABIDW_TARBALL)" "$(__ZSTREAM)" "$(PACKAGE_NAME)" 
"$(RHEL_MAJOR)" "$(RHPKG_BIN)" 
"$(SRPMS)/$(PACKAGE_NAME)-$(KVERSION)-$(PKGRELEASE)$(DIST).src.rpm"
+   $(REDHAT)/scripts/rh-dist-git.sh
 
 dist-rtg: dist-release
@$(MAKE) dist-release-tag
diff --git a/redhat/scripts/rh-dist-git.sh b/redhat/scripts/rh-dist-git.sh
index blahblah..blahblah 100755
--- a/redhat/scripts/rh-dist-git.sh
+++ b/redhat/scripts/rh-dist-git.sh
@@ -1,32 +1,8 @@
 #!/bin/bash
 
 # clones and updates a dist-git repo
-# $1: branch to be used
-# $2: local pristine clone of dist-git
-# $3: alternate tmp directory (if you have faster storage)
-# $4: alternate dist-git server
-# $5: kernel source tarball
-# $6: kabi stablelists tarball
-# $7: dwarf-bases kabi tarball
-# $8: zstream build
-# $9: package name
-# shellcheck disable=SC2164
-
-rhdistgit_branch=$1;
-rhdistgit_cache=$2;
-rhdistgit_tmp=$3;
-rhdistgit_server=$4;
-rhdistgit_tarball=$5;
-rhdistgit_kabi_tarball=$6;
-rhdistgit_kabidw_tarball=$7;
-rhdistgit_zstream_flag=$8;
-package_name=$9;
-rhel_major=${10};
-rhpkg_bin=${11};
-srpm_name=${12};
 
-redhat=$(dirname "$0")/..;
-topdir="$redhat"/..;
+# shellcheck disable=SC2164
 
 function die
 {
@@ -37,41 +13,41 @@ function die
 function upload()
 {
[ -n "$RH_DIST_GIT_TEST" ] && return
-   $rhpkg_bin upload "$@" >/dev/null || die "uploading $*";
+   $RHPKG_BIN upload "$@" >/dev/null || die "uploading $*";
 }
 
-if [ -z "$rhdistgit_branch" ]; then
+if [ -z "$RHDISTGIT_BRANCH" ]; then
echo "$0  [local clone] [alternate tmp] [alternate dist-git 
server]" >&2;
exit 1;
 fi
 
 echo "Cloning the repository"
 # clone the dist-git, considering cache
-tmpdir=$("$redhat"/scripts/clone_tree.sh "$rhdistgit_server" 
"$rhdistgit_cache" "$rhdistgit_tmp" "$package_name" "$rhel_major" "$rhpkg_bin");
+tmpdir=$("$REDHAT"/scripts/clone_tree.sh "$RHDISTGIT" "$RHDISTGIT_CACHE" 
"$RHDISTGIT_TMP" "$PACKAGE_NAME" "$RHEL_MAJOR" "$RHPKG_BIN");
 
 echo "Switching the branch"
 # change in the correct branch
-cd "$tmpdir/$package_name";
-$rhpkg_bin switch-branch "$rhdistgit_branch" || die "switching to branch 
$rhdistgit_branch";
+cd "$tmpdir/$PACKAGE_NAME";
+$RHPKG_BIN switch-branch "$RHDISTGIT_BRANCH" || die "switching to branch 
$RHDISTGIT_BRANCH";
 
 echo "Copying updated files"
 # copy the required files (redhat/git/files)
-"$redhat"/scripts/expand_srpm.sh "$topdir" "$tmpdir" "$package_name" 
"$srpm_name";
+"$REDHAT"/scripts/expand_srpm.sh "$TOPDIR" "$tmpdir" "$PACKAGE_NAME" "$SRPM";
 
 echo "Uploading new tarballs"
 # upload tarballs
-sed -i "/linux-.*.tar.xz/d" "$tmpdir/$package_name"/{sources,.gitignore};
-upload_list="$rhdistgit_tarball"
+sed -i "/linux-.*.tar.xz/d" "$tmpdir/$PACKAGE_NAME"/{sources,.gitignore};
+upload_list="$TARBALL"
 
 # Only upload kernel-abi-stablelists tarball if its release counter changed.
-if [ "$rhdistgit_zstream_flag" == "no" ]; then
-   if ! grep -q "$rhdistgit_kabi_tarball" "$tmpdir/$package_name"/sources; 
then
-   sed -i "/kernel-abi-stablelists.*.tar.bz2/d" 
"$tmpdir/$package_name"/{sources,.gitignore};
-   upload_list="$upload_list $rhdistgit_kabi_tarball"
+if [ "$__ZSTREAM" == "no" ]; then
+   if ! grep -q "$KABI_TARBALL" "$tmpdir/$PACKAGE_NAME"/sources; then
+   sed -i "/kernel-abi-stablelists.*.tar.bz2/d" 
"$tmpdir/$PACKAGE_NAME"/{sources,.gitignore};
+   upload_list="$upload_list $KABI_TARBALL"
fi
-   if ! grep -q "$rhdistgit_kabidw_tarball" 
"$tmpdir/$package_name"/sources; then
-   sed -i "/kernel-kabi-dw-.*.tar.bz2/d" 
"$tmpdir/$package_name"/{sources,.gitignore};
-   upload_list="$upload_list $rhdistgit_kabidw_tarball"
+   if ! grep -q "$KABIDW_TARBALL" "$tmpdir/$PACKAGE_NAME"/sources; then
+   sed -i "/kernel-kabi-dw-.*.tar.bz2/d" 
"$tmpdir/$PACKAGE_NAME"/{sources,.gitignore};
+   upload_list="$upload_list $KABIDW_TARBALL"
fi
 fi
 
@@ -82,10 +58,10 @@ upload $upload_list
 echo "Creating diff for review ($tmpdir/diff) and changelog"
 # diff the result (redhat/cvs/dontdiff). note: diff reuturns 1 if
 # differences were found
-diff -X "$redhat"/git/dontdiff -upr "$tmpdir/$package_name" 
"$redhat"/rpm/SOURCES/ > "$tmpdir"/diff;
+diff -X "$REDHAT"/git/dontdiff -upr "$tmpdir/$PACKAGE_NAME" 
"$REDHAT"/rpm/SOURCES/ > "$tmpdir"/diff;
 # creating the changelog file
-"$redhat"/scripts/create_distgit_changelog.sh 
"$redhat/rpm/SOURCES/$package_name".spec \
-   

[OS-BUILD PATCHv7 4/11] redhat/configs/build_configs.sh: Use Makefile variables

2022-04-18 Thread Prarit Bhargava (via Email Bridge)
From: Prarit Bhargava 

redhat/configs/build_configs.sh: Use Makefile variables

Use Makefile variables in build_configs.sh.

Signed-off-by: Prarit Bhargava 

diff --git a/redhat/Makefile b/redhat/Makefile
index blahblah..blahblah 100644
--- a/redhat/Makefile
+++ b/redhat/Makefile
@@ -363,8 +363,8 @@ dist-configs-check: dist-configs-prep
+cd $(REDHAT)/configs; ./process_configs.sh 
$(PROCESS_CONFIGS_CHECK_OPTS) "" ""
 
 dist-configs-prep: dist-clean-configs dist-buildreq-check
-   +cd $(REDHAT)/configs; ./build_configs.sh "partial" "$(ARCH_MACH)" 
"snip" "$(RHJOBS)"
-   +cd $(REDHAT)/configs; ./build_configs.sh "$(PACKAGE_NAME)" 
"$(ARCH_MACH)" "$(FLAVOR)" "$(RHJOBS)"
+   +cd $(REDHAT)/configs; ./build_configs.sh "partial" "snip"
+   +cd $(REDHAT)/configs; ./build_configs.sh "$(PACKAGE_NAME)" "$(FLAVOR)"
 
 dist-configs-arch: ARCH_MACH = $(MACH)
 dist-configs-arch: dist-configs
diff --git a/redhat/configs/build_configs.sh b/redhat/configs/build_configs.sh
index blahblah..blahblah 100755
--- a/redhat/configs/build_configs.sh
+++ b/redhat/configs/build_configs.sh
@@ -5,19 +5,15 @@
 # files for building RHEL kernels, based on the contents of a control file
 
 PACKAGE_NAME="${1:-kernel}" # defines the package name used
-SUBARCH="${2:-}" # defines a specific arch
-SCRIPT=$(readlink -f "$0")
-OUTPUT_DIR="$PWD"
-SCRIPT_DIR=$(dirname "$SCRIPT")
-
-if [ -z "$3" ]; then
+if [ -z "$2" ]; then
cat flavors > .flavors
 else
-   echo "$3" > .flavors
+   echo "$2" > .flavors
 fi
 
-# shellcheck disable=SC2015
-RHJOBS="$(test -n "$4" && echo "$4" || nproc --all)"
+SCRIPT=$(readlink -f "$0")
+OUTPUT_DIR="$PWD"
+SCRIPT_DIR=$(dirname "$SCRIPT")
 
 LANG=en_US.UTF-8
 
@@ -146,9 +142,9 @@ function build_flavor()
arch=$(echo "$line" | cut -f1 -d"=")
configs=$(echo "$line" | cut -f2 -d"=")
 
-   if [ -n "$SUBARCH" ]; then
+   if [ -n "$ARCH_MACH" ]; then
case $arch in
-   $SUBARCH*)
+   $ARCH_MACH*)
;;
*)
continue

--
https://gitlab.com/cki-project/kernel-ark/-/merge_requests/1647
___
kernel mailing list -- kernel@lists.fedoraproject.org
To unsubscribe send an email to kernel-le...@lists.fedoraproject.org
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@lists.fedoraproject.org
Do not reply to spam on the list, report it: 
https://pagure.io/fedora-infrastructure


[OS-BUILD PATCHv7 6/11] redhat/Makefile: Use RPMVERSION

2022-04-18 Thread Prarit Bhargava (via Email Bridge)
From: Prarit Bhargava 

redhat/Makefile: Use RPMVERSION

Use RPMVERSION where appropriate in the Makefile.

Signed-off-by: Prarit Bhargava 

diff --git a/redhat/Makefile b/redhat/Makefile
index blahblah..blahblah 100644
--- a/redhat/Makefile
+++ b/redhat/Makefile
@@ -199,7 +199,7 @@ 
KABIDW_TARBALL:=$(SOURCES)/kernel-kabi-dw-$(KVERSION)-$(DISTRO_BUILD).tar.bz2
 PKGRELEASE:=$(PREBUILD)$(BUILD)$(BUILDID)
 RPMVERSION:=$(RPMKVERSION).$(RPMKPATCHLEVEL).$(RPMKSUBLEVEL)-$(PKGRELEASE)
 SPECRELEASE:=$(PREBUILD)$(BUILD)%{?buildid}%{?dist}
-SRPM:=$(SRPMS)/$(PACKAGE_NAME)-$(KVERSION)-$(PKGRELEASE)$(DIST).src.rpm
+SRPM:=$(SRPMS)/$(PACKAGE_NAME)-$(RPMVERSION)$(DIST).src.rpm
 
 #
 # This conditional statement is where fedora, centos, and other (aka RHEL)
@@ -225,7 +225,7 @@ else ifeq ("$(DISTRO)", "centos")
   ifndef BUILD_SCRATCH_TARGET
 BUILD_SCRATCH_TARGET:=c$(RHEL_MAJOR)s-candidate
   endif
-  TARFILE_RELEASE:=$(KVERSION)-$(PKGRELEASE)
+  TARFILE_RELEASE:=$(RPMVERSION)
 else
   # A unified tarball means that the tarball in the srpm contains both the
   # upstream sources and RHEL specific patches.
@@ -234,7 +234,7 @@ else
   ifndef BUILD_SCRATCH_TARGET
 BUILD_SCRATCH_TARGET:=rhel-$(RHEL_MAJOR).$(RHEL_MINOR).0-test-pesign
   endif
-  TARFILE_RELEASE:=$(KVERSION)-$(PKGRELEASE)
+  TARFILE_RELEASE:=$(RPMVERSION)
 endif
 
 ifndef BUILD_TARGET
@@ -397,7 +397,7 @@ dist-stub-key:
 .PHONY:$(TARBALL)
 $(TARBALL):
@if [ $(SINGLE_TARBALL) -eq 1 ]; then \
-   scripts/create-tarball.sh $(GITID) 
linux-$(KVERSION)-$(PKGRELEASE); \
+   scripts/create-tarball.sh $(GITID) linux-$(RPMVERSION); \
else \
scripts/create-tarball.sh $(MARKER) linux-$(TARFILE_RELEASE); \
fi
@@ -556,7 +556,7 @@ dist-release-finish: setup-source
@cp $(SOURCES)/$(CHANGELOG) $(REDHAT)/$(CHANGELOG)
@$(GIT) add $(REDHAT)/$(CHANGELOG)
@$(GIT) add $(REDHAT)/marker
-   @$(GIT) commit -s ../Makefile.rhelver $(REDHAT)/marker 
$(REDHAT)/$(CHANGELOG) $(PACKAGE_NAME).spec.template -m "[redhat] 
$(PACKAGE_NAME)-$(KVERSION)-$(PKGRELEASE)"
+   @$(GIT) commit -s ../Makefile.rhelver $(REDHAT)/marker 
$(REDHAT)/$(CHANGELOG) $(PACKAGE_NAME).spec.template -m "[redhat] 
$(PACKAGE_NAME)-$(RPMVERSION)"
 dist-release-changed: setup-source
@cp $(SOURCES)/$(CHANGELOG) $(REDHAT)/$(CHANGELOG)
@echo $(MARKER) > $(REDHAT)/marker
@@ -572,7 +572,7 @@ dist-release-changed: setup-source
 dist-release: dist-clean-sources
@$(MAKE) dist-release-changed
 dist-release-tag:
-   @$(GIT) tag -a -m "$(PACKAGE_NAME)-$(RPMVERSION)" 
$(PACKAGE_NAME)-$(KVERSION)-$(PKGRELEASE)
+   @$(GIT) tag -a -m "$(PACKAGE_NAME)-$(RPMVERSION)" 
$(PACKAGE_NAME)-$(RPMVERSION)
 
 git-tree-check:
@if test -n "$(DIST_PUSH)" && test -z "$(shell $(GIT) remote get-url 
gitlab 2>/dev/null)"; then \
@@ -614,7 +614,7 @@ dist-vr-check:
fi
 
 dist-brew dist-koji: dist-%: dist-vr-check dist-srpm
-   $* $(BUILD_PROFILE) build $(BUILD_FLAGS) $(BUILD_TARGET) 
$(SRPMS)/$(PACKAGE_NAME)-$(KVERSION)-$(PKGRELEASE)$(DIST).src.rpm $(OUTPUT_FILE)
+   $* $(BUILD_PROFILE) build $(BUILD_FLAGS) $(BUILD_TARGET) 
$(SRPMS)/$(PACKAGE_NAME)-$(RPMVERSION)$(DIST).src.rpm $(OUTPUT_FILE)
 
 distg-brew distg-koji: distg-%: dist-vr-check
$* $(BUILD_PROFILE) build $(BUILD_FLAGS) $(BUILD_TARGET) 
"$(RHGITURL)?redhat/koji#$(RHGITCOMMIT)"

--
https://gitlab.com/cki-project/kernel-ark/-/merge_requests/1647
___
kernel mailing list -- kernel@lists.fedoraproject.org
To unsubscribe send an email to kernel-le...@lists.fedoraproject.org
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@lists.fedoraproject.org
Do not reply to spam on the list, report it: 
https://pagure.io/fedora-infrastructure


[OS-BUILD PATCHv7 2/11] redhat/kernel.spec.template: Use RPM_BUILD_NCPUS

2022-04-18 Thread Prarit Bhargava (via Email Bridge)
From: Prarit Bhargava 

redhat/kernel.spec.template: Use RPM_BUILD_NCPUS

RPM_BUILD_NCPUS allows users to modify the max number of cpus used by the
RPM build.

Use the RPM_BUILD_NCPUS variable in the spec file.

Signed-off-by: Prarit Bhargava 

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
@@ -115,7 +115,6 @@ Summary: The Linux kernel
 %if %{zipmodules}
 %global zipsed -e 's/\.ko$/\.ko.xz/'
 # for parallel xz processes, replace with 1 to go back to single process
-%global zcpu `nproc --all`
 %endif
 
 %%BUILDID%%
@@ -2345,7 +2344,7 @@ find Documentation -type d | xargs chmod u+w
 fi \
   fi \
   if [ "%{zipmodules}" -eq "1" ]; then \
-find $RPM_BUILD_ROOT/lib/modules/ -type f -name '*.ko' | xargs -P%{zcpu} 
xz; \
+find $RPM_BUILD_ROOT/lib/modules/ -type f -name '*.ko' | xargs 
-P${RPM_BUILD_NCPUS} xz; \
   fi \
 %{nil}
 
diff --git a/redhat/self-test/data/centos-2585cf9dfaad.el7.spec 
b/redhat/self-test/data/centos-2585cf9dfaad.el7.spec
index blahblah..blahblah 100755
--- a/redhat/self-test/data/centos-2585cf9dfaad.el7.spec
+++ b/redhat/self-test/data/centos-2585cf9dfaad.el7.spec
@@ -115,7 +115,6 @@ Summary: The Linux kernel
 %if %{zipmodules}
 %global zipsed -e 's/\.ko$/\.ko.xz/'
 # for parallel xz processes, replace with 1 to go back to single process
-%global zcpu `nproc --all`
 %endif
 
 %define buildid .test
@@ -2349,7 +2348,7 @@ find Documentation -type d | xargs chmod u+w
 fi \
   fi \
   if [ "%{zipmodules}" -eq "1" ]; then \
-find $RPM_BUILD_ROOT/lib/modules/ -type f -name '*.ko' | xargs -P%{zcpu} 
xz; \
+find $RPM_BUILD_ROOT/lib/modules/ -type f -name '*.ko' | xargs 
-P${RPM_BUILD_NCPUS} xz; \
   fi \
 %{nil}
 
diff --git a/redhat/self-test/data/centos-2585cf9dfaad.fc25.spec 
b/redhat/self-test/data/centos-2585cf9dfaad.fc25.spec
index blahblah..blahblah 100755
--- a/redhat/self-test/data/centos-2585cf9dfaad.fc25.spec
+++ b/redhat/self-test/data/centos-2585cf9dfaad.fc25.spec
@@ -115,7 +115,6 @@ Summary: The Linux kernel
 %if %{zipmodules}
 %global zipsed -e 's/\.ko$/\.ko.xz/'
 # for parallel xz processes, replace with 1 to go back to single process
-%global zcpu `nproc --all`
 %endif
 
 %define buildid .test
@@ -2349,7 +2348,7 @@ find Documentation -type d | xargs chmod u+w
 fi \
   fi \
   if [ "%{zipmodules}" -eq "1" ]; then \
-find $RPM_BUILD_ROOT/lib/modules/ -type f -name '*.ko' | xargs -P%{zcpu} 
xz; \
+find $RPM_BUILD_ROOT/lib/modules/ -type f -name '*.ko' | xargs 
-P${RPM_BUILD_NCPUS} xz; \
   fi \
 %{nil}
 
diff --git a/redhat/self-test/data/centos-78e36f3b0dae.el7.spec 
b/redhat/self-test/data/centos-78e36f3b0dae.el7.spec
index blahblah..blahblah 100755
--- a/redhat/self-test/data/centos-78e36f3b0dae.el7.spec
+++ b/redhat/self-test/data/centos-78e36f3b0dae.el7.spec
@@ -115,7 +115,6 @@ Summary: The Linux kernel
 %if %{zipmodules}
 %global zipsed -e 's/\.ko$/\.ko.xz/'
 # for parallel xz processes, replace with 1 to go back to single process
-%global zcpu `nproc --all`
 %endif
 
 %define buildid .test
@@ -2349,7 +2348,7 @@ find Documentation -type d | xargs chmod u+w
 fi \
   fi \
   if [ "%{zipmodules}" -eq "1" ]; then \
-find $RPM_BUILD_ROOT/lib/modules/ -type f -name '*.ko' | xargs -P%{zcpu} 
xz; \
+find $RPM_BUILD_ROOT/lib/modules/ -type f -name '*.ko' | xargs 
-P${RPM_BUILD_NCPUS} xz; \
   fi \
 %{nil}
 
diff --git a/redhat/self-test/data/centos-78e36f3b0dae.fc25.spec 
b/redhat/self-test/data/centos-78e36f3b0dae.fc25.spec
index blahblah..blahblah 100755
--- a/redhat/self-test/data/centos-78e36f3b0dae.fc25.spec
+++ b/redhat/self-test/data/centos-78e36f3b0dae.fc25.spec
@@ -115,7 +115,6 @@ Summary: The Linux kernel
 %if %{zipmodules}
 %global zipsed -e 's/\.ko$/\.ko.xz/'
 # for parallel xz processes, replace with 1 to go back to single process
-%global zcpu `nproc --all`
 %endif
 
 %define buildid .test
@@ -2349,7 +2348,7 @@ find Documentation -type d | xargs chmod u+w
 fi \
   fi \
   if [ "%{zipmodules}" -eq "1" ]; then \
-find $RPM_BUILD_ROOT/lib/modules/ -type f -name '*.ko' | xargs -P%{zcpu} 
xz; \
+find $RPM_BUILD_ROOT/lib/modules/ -type f -name '*.ko' | xargs 
-P${RPM_BUILD_NCPUS} xz; \
   fi \
 %{nil}
 
diff --git a/redhat/self-test/data/centos-df0cc57e057f.el7.spec 
b/redhat/self-test/data/centos-df0cc57e057f.el7.spec
index blahblah..blahblah 100755
--- a/redhat/self-test/data/centos-df0cc57e057f.el7.spec
+++ b/redhat/self-test/data/centos-df0cc57e057f.el7.spec
@@ -115,7 +115,6 @@ Summary: The Linux kernel
 %if %{zipmodules}
 %global zipsed -e 's/\.ko$/\.ko.xz/'
 # for parallel xz processes, replace with 1 to go back to single process
-%global zcpu `nproc --all`
 %endif
 
 %define buildid .test
@@ -2349,7 +2348,7 @@ find Documentation -type d | xargs chmod u+w
 fi \
   fi \
   if [ "%{zipmodules}" -eq "1" ]; then \
-find $RPM_BUILD_ROOT/lib/modules/ -type f -name '*.ko' | xargs -P%{zcpu} 

[OS-BUILD PATCHv7 3/11] redhat/configs/process_configs.sh: Use Makefile variables

2022-04-18 Thread Prarit Bhargava (via Email Bridge)
From: Prarit Bhargava 

redhat/configs/process_configs.sh: Use Makefile variables

Cleanup up parameters and use Makefile variables in process_config.sh.

Signed-off-by: Prarit Bhargava 

diff --git a/redhat/Makefile b/redhat/Makefile
index blahblah..blahblah 100644
--- a/redhat/Makefile
+++ b/redhat/Makefile
@@ -345,11 +345,11 @@ dist-kabi-dw-check: dist-kabi
 
 dist-configs-commit: dist-configs-prep
+@cd $(REDHAT)/configs; ./generate_all_configs.sh 1;\
-   ./process_configs.sh -z "$(PACKAGE_NAME)" "$(KVERSION)" "" "$(FLAVOR)" 
"$(RHJOBS)"
+   ./process_configs.sh -z "$(KVERSION)" "$(FLAVOR)"
 
 dist-configs: dist-configs-prep
+@cd $(REDHAT)/configs; ./generate_all_configs.sh 1;\
-   ./process_configs.sh $(PROCESS_CONFIGS_OPTS) "$(PACKAGE_NAME)" 
"$(KVERSION)" "" "" "$(RHJOBS)"
+   ./process_configs.sh $(PROCESS_CONFIGS_OPTS) "$(KVERSION)" ""
 
 dist-fedora-configs: FLAVOR = fedora
 dist-fedora-configs: dist-configs
@@ -360,7 +360,7 @@ dist-rhel-configs: dist-configs
 rh-configs: dist-rhel-configs
 
 dist-configs-check: dist-configs-prep
-   +cd $(REDHAT)/configs; ./process_configs.sh 
$(PROCESS_CONFIGS_CHECK_OPTS) $(PACKAGE_NAME) "" "" "" "$(RHJOBS)"
+   +cd $(REDHAT)/configs; ./process_configs.sh 
$(PROCESS_CONFIGS_CHECK_OPTS) "" ""
 
 dist-configs-prep: dist-clean-configs dist-buildreq-check
+cd $(REDHAT)/configs; ./build_configs.sh "partial" "$(ARCH_MACH)" 
"snip" "$(RHJOBS)"
diff --git a/redhat/configs/process_configs.sh 
b/redhat/configs/process_configs.sh
index blahblah..blahblah 100755
--- a/redhat/configs/process_configs.sh
+++ b/redhat/configs/process_configs.sh
@@ -191,7 +191,7 @@ function commit_new_configs()
# assume we are in $source_tree/configs, need to get to top level
pushd "$(switch_to_toplevel)" &>/dev/null
 
-   for cfg in "$SCRIPT_DIR/${PACKAGE_NAME}${KVERREL}${SUBARCH}"*.config
+   for cfg in "$SCRIPT_DIR/${PACKAGE_NAME}${KVERREL}"*.config
do
arch=$(head -1 "$cfg" | cut -b 3-)
cfgtmp="${cfg}.tmp"
@@ -303,7 +303,7 @@ function process_configs()
[ -f .mismatches ] && rm -f .mismatches
 
count=0
-   for cfg in "$SCRIPT_DIR/${PACKAGE_NAME}${KVERREL}${SUBARCH}"*.config
+   for cfg in "$SCRIPT_DIR/${PACKAGE_NAME}${KVERREL}"*.config
do
if [ "$count" -eq 0 ]; then
# do the first one by itself so that tools are built
@@ -385,12 +385,9 @@ do
shift
 done
 
-PACKAGE_NAME="${1:-kernel}" # defines the package name used
-KVERREL="$(test -n "$2" && echo "-$2" || echo "")"
-SUBARCH="$(test -n "$3" && echo "-$3" || echo "")"
-FLAVOR="$(test -n "$4" && echo "-$4" || echo "-ark")"
+KVERREL="$(test -n "$1" && echo "-$1" || echo "")"
+FLAVOR="$(test -n "$2" && echo "-$2" || echo "-ark")"
 # shellcheck disable=SC2015
-RHJOBS="$(test -n "$5" && echo "$5" || nproc --all)"
 SCRIPT=$(readlink -f "$0")
 SCRIPT_DIR=$(dirname "$SCRIPT")
 
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
@@ -1497,7 +1497,7 @@ for opt in %{clang_make_opts}; do
   OPTS="$OPTS -m $opt"
 done
 %endif
-./process_configs.sh $OPTS kernel %{rpmversion}
+RHJOBS=$RPM_BUILD_NCPUS PACKAGE_NAME=kernel ./process_configs.sh $OPTS 
${rpmversion}
 
 cp %{SOURCE82} .
 RPM_SOURCE_DIR=$RPM_SOURCE_DIR ./update_scripts.sh %{primary_target}
diff --git a/redhat/self-test/data/centos-2585cf9dfaad.el7.spec 
b/redhat/self-test/data/centos-2585cf9dfaad.el7.spec
index blahblah..blahblah 100755
--- a/redhat/self-test/data/centos-2585cf9dfaad.el7.spec
+++ b/redhat/self-test/data/centos-2585cf9dfaad.el7.spec
@@ -1501,7 +1501,7 @@ for opt in %{clang_make_opts}; do
   OPTS="$OPTS -m $opt"
 done
 %endif
-./process_configs.sh $OPTS kernel %{rpmversion}
+RHJOBS=$RPM_BUILD_NCPUS PACKAGE_NAME=kernel ./process_configs.sh $OPTS 
${rpmversion}
 
 cp %{SOURCE82} .
 RPM_SOURCE_DIR=$RPM_SOURCE_DIR ./update_scripts.sh %{primary_target}
diff --git a/redhat/self-test/data/centos-2585cf9dfaad.fc25.spec 
b/redhat/self-test/data/centos-2585cf9dfaad.fc25.spec
index blahblah..blahblah 100755
--- a/redhat/self-test/data/centos-2585cf9dfaad.fc25.spec
+++ b/redhat/self-test/data/centos-2585cf9dfaad.fc25.spec
@@ -1501,7 +1501,7 @@ for opt in %{clang_make_opts}; do
   OPTS="$OPTS -m $opt"
 done
 %endif
-./process_configs.sh $OPTS kernel %{rpmversion}
+RHJOBS=$RPM_BUILD_NCPUS PACKAGE_NAME=kernel ./process_configs.sh $OPTS 
${rpmversion}
 
 cp %{SOURCE82} .
 RPM_SOURCE_DIR=$RPM_SOURCE_DIR ./update_scripts.sh %{primary_target}
diff --git a/redhat/self-test/data/centos-78e36f3b0dae.el7.spec 
b/redhat/self-test/data/centos-78e36f3b0dae.el7.spec
index blahblah..blahblah 100755
--- a/redhat/self-test/data/centos-78e36f3b0dae.el7.spec
+++ b/redhat/self-test/data/centos-78e36f3b0dae.el7.spec
@@ -1501,7 +1501,7 @@ for opt in %{clang_make_opts}; do
   OPTS="$OPTS -m $opt"
 done
 %endif

[OS-BUILD PATCHv7 1/11] redhat/configs/generate_all_configs.sh: Use Makefile variables

2022-04-18 Thread Prarit Bhargava (via Email Bridge)
From: Prarit Bhargava 

redhat/configs/generate_all_configs.sh: Use Makefile variables

Use Makefile variables in generate_all_configs.sh.

Signed-off-by: Prarit Bhargava 

diff --git a/redhat/Makefile b/redhat/Makefile
index blahblah..blahblah 100644
--- a/redhat/Makefile
+++ b/redhat/Makefile
@@ -344,11 +344,11 @@ dist-kabi-dw-check: dist-kabi
@rm -rf $(KABIDW)/base/$(CURARCH).tmp
 
 dist-configs-commit: dist-configs-prep
-   +@cd $(REDHAT)/configs; VERSION=$(KVERSION) ./generate_all_configs.sh 
"$(FLAVOR)" 1; \
+   +@cd $(REDHAT)/configs; ./generate_all_configs.sh 1;\
./process_configs.sh -z "$(PACKAGE_NAME)" "$(KVERSION)" "" "$(FLAVOR)" 
"$(RHJOBS)"
 
 dist-configs: dist-configs-prep
-   +@cd $(REDHAT)/configs; VERSION=$(KVERSION) ./generate_all_configs.sh 
"$(FLAVOR)" 1; \
+   +@cd $(REDHAT)/configs; ./generate_all_configs.sh 1;\
./process_configs.sh $(PROCESS_CONFIGS_OPTS) "$(PACKAGE_NAME)" 
"$(KVERSION)" "" "" "$(RHJOBS)"
 
 dist-fedora-configs: FLAVOR = fedora
diff --git a/redhat/configs/generate_all_configs.sh 
b/redhat/configs/generate_all_configs.sh
index blahblah..blahblah 100755
--- a/redhat/configs/generate_all_configs.sh
+++ b/redhat/configs/generate_all_configs.sh
@@ -1,30 +1,24 @@
 #!/bin/sh
 
 # Adjusts the configuration options to build the variants correctly
-#
-# arg1: configuration to go in the primary variant
-# arg2: are we only generating debug configs
 
-
-PRIMARY=$1
-DEBUGBUILDSENABLED=$2
-
-if [ -z "$2" ]; then
+DEBUGBUILDSENABLED=$1
+if [ -z "$DEBUGBUILDSENABLED" ]; then
exit 1
 fi
 
-if [ -z "$PRIMARY" ]; then
-   PRIMARY=rhel
+if [ -z "$FLAVOR" ]; then
+   FLAVOR=rhel
 fi
 
-if [ "$PRIMARY" = "fedora" ]; then
+if [ "$FLAVOR" = "fedora" ]; then
SECONDARY=rhel
 else
SECONDARY=fedora
 fi
 
-for i in kernel-*-"$PRIMARY".config; do
-   NEW=kernel-"$VERSION"-$(echo "$i" | cut -d - -f2- | sed s/-"$PRIMARY"//)
+for i in kernel-*-"$FLAVOR".config; do
+   NEW=kernel-"$KVERSION"-$(echo "$i" | cut -d - -f2- | sed s/-"$FLAVOR"//)
#echo $NEW
mv "$i" "$NEW"
 done
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
@@ -1447,7 +1447,7 @@ cp %{SOURCE80} .
 cp %{SOURCE3000} .
 # kernel-local
 cp %{SOURCE3001} .
-VERSION=%{version} ./generate_all_configs.sh %{primary_target} 
%{debugbuildsenabled}
+FLAVOR=%{primary_target} KVERSION=%{version} ./generate_all_configs.sh 
%{debugbuildsenabled}
 
 # Merge in any user-provided local config option changes
 %ifnarch %nobuildarches
diff --git a/redhat/self-test/data/centos-2585cf9dfaad.el7.spec 
b/redhat/self-test/data/centos-2585cf9dfaad.el7.spec
index blahblah..blahblah 100755
--- a/redhat/self-test/data/centos-2585cf9dfaad.el7.spec
+++ b/redhat/self-test/data/centos-2585cf9dfaad.el7.spec
@@ -1451,7 +1451,7 @@ cp %{SOURCE80} .
 cp %{SOURCE3000} .
 # kernel-local
 cp %{SOURCE3001} .
-VERSION=%{version} ./generate_all_configs.sh %{primary_target} 
%{debugbuildsenabled}
+FLAVOR=%{primary_target} KVERSION=%{version} ./generate_all_configs.sh 
%{debugbuildsenabled}
 
 # Merge in any user-provided local config option changes
 %ifnarch %nobuildarches
diff --git a/redhat/self-test/data/centos-2585cf9dfaad.fc25.spec 
b/redhat/self-test/data/centos-2585cf9dfaad.fc25.spec
index blahblah..blahblah 100755
--- a/redhat/self-test/data/centos-2585cf9dfaad.fc25.spec
+++ b/redhat/self-test/data/centos-2585cf9dfaad.fc25.spec
@@ -1451,7 +1451,7 @@ cp %{SOURCE80} .
 cp %{SOURCE3000} .
 # kernel-local
 cp %{SOURCE3001} .
-VERSION=%{version} ./generate_all_configs.sh %{primary_target} 
%{debugbuildsenabled}
+FLAVOR=%{primary_target} KVERSION=%{version} ./generate_all_configs.sh 
%{debugbuildsenabled}
 
 # Merge in any user-provided local config option changes
 %ifnarch %nobuildarches
diff --git a/redhat/self-test/data/centos-78e36f3b0dae.el7.spec 
b/redhat/self-test/data/centos-78e36f3b0dae.el7.spec
index blahblah..blahblah 100755
--- a/redhat/self-test/data/centos-78e36f3b0dae.el7.spec
+++ b/redhat/self-test/data/centos-78e36f3b0dae.el7.spec
@@ -1451,7 +1451,7 @@ cp %{SOURCE80} .
 cp %{SOURCE3000} .
 # kernel-local
 cp %{SOURCE3001} .
-VERSION=%{version} ./generate_all_configs.sh %{primary_target} 
%{debugbuildsenabled}
+FLAVOR=%{primary_target} KVERSION=%{version} ./generate_all_configs.sh 
%{debugbuildsenabled}
 
 # Merge in any user-provided local config option changes
 %ifnarch %nobuildarches
diff --git a/redhat/self-test/data/centos-78e36f3b0dae.fc25.spec 
b/redhat/self-test/data/centos-78e36f3b0dae.fc25.spec
index blahblah..blahblah 100755
--- a/redhat/self-test/data/centos-78e36f3b0dae.fc25.spec
+++ b/redhat/self-test/data/centos-78e36f3b0dae.fc25.spec
@@ -1451,7 +1451,7 @@ cp %{SOURCE80} .
 cp %{SOURCE3000} .
 # kernel-local
 cp %{SOURCE3001} .
-VERSION=%{version} ./generate_all_configs.sh %{primary_target} 
%{debugbuildsenabled}

[OS-BUILD PATCHv7 0/11] redhat: Use Makefile variables in scripts

2022-04-18 Thread Prarit Bhargava (via Email Bridge)
From: Prarit Bhargava on gitlab.com
Merge Request: https://gitlab.com/cki-project/kernel-ark/-/merge_requests/1647

Use Makefile variables in scripts that are called from the Makefile.

Signed-off-by: Prarit Bhargava 

---
 redhat/configs/build_configs.sh |  18 ++---
 redhat/configs/generate_all_configs.sh  |  20 ++
 redhat/configs/process_configs.sh   |  11 +--
 redhat/scripts/create-tarball.sh|   6 +-
 redhat/scripts/rh-dist-git.sh   |  62 ++--
 redhat/self-test/data/centos-2585cf9dfaad.el7   |   5 +-
 redhat/self-test/data/centos-2585cf9dfaad.el7.spec  |  17 ++---
 redhat/self-test/data/centos-2585cf9dfaad.fc25  |   5 +-
 redhat/self-test/data/centos-2585cf9dfaad.fc25.spec |  17 ++---
 redhat/self-test/data/centos-78e36f3b0dae.el7   |   5 +-
 redhat/self-test/data/centos-78e36f3b0dae.el7.spec  |  17 ++---
 redhat/self-test/data/centos-78e36f3b0dae.fc25  |   5 +-
 redhat/self-test/data/centos-78e36f3b0dae.fc25.spec |  17 ++---
 redhat/self-test/data/centos-df0cc57e057f.el7   |   5 +-
 redhat/self-test/data/centos-df0cc57e057f.el7.spec  |  17 ++---
 redhat/self-test/data/centos-df0cc57e057f.fc25  |   5 +-
 redhat/self-test/data/centos-df0cc57e057f.fc25.spec |  17 ++---
 redhat/self-test/data/centos-fce15c45d3fb.el7   |   5 +-
 redhat/self-test/data/centos-fce15c45d3fb.el7.spec  |  17 ++---
 redhat/self-test/data/centos-fce15c45d3fb.fc25  |   5 +-
 redhat/self-test/data/centos-fce15c45d3fb.fc25.spec |  17 ++---
 redhat/self-test/data/create-data.sh|   4 +-
 redhat/self-test/data/fedora-2585cf9dfaad.el7   |   5 +-
 redhat/self-test/data/fedora-2585cf9dfaad.el7.spec  |  17 ++---
 redhat/self-test/data/fedora-2585cf9dfaad.fc25  |   5 +-
 redhat/self-test/data/fedora-2585cf9dfaad.fc25.spec |  17 ++---
 redhat/self-test/data/fedora-78e36f3b0dae.el7   |   5 +-
 redhat/self-test/data/fedora-78e36f3b0dae.el7.spec  |  17 ++---
 redhat/self-test/data/fedora-78e36f3b0dae.fc25  |   5 +-
 redhat/self-test/data/fedora-78e36f3b0dae.fc25.spec |  17 ++---
 redhat/self-test/data/fedora-df0cc57e057f.el7   |   5 +-
 redhat/self-test/data/fedora-df0cc57e057f.el7.spec  |  17 ++---
 redhat/self-test/data/fedora-df0cc57e057f.fc25  |   5 +-
 redhat/self-test/data/fedora-df0cc57e057f.fc25.spec |  17 ++---
 redhat/self-test/data/fedora-fce15c45d3fb.el7   |   5 +-
 redhat/self-test/data/fedora-fce15c45d3fb.el7.spec  |  17 ++---
 redhat/self-test/data/fedora-fce15c45d3fb.fc25  |   5 +-
 redhat/self-test/data/fedora-fce15c45d3fb.fc25.spec |  17 ++---
 redhat/self-test/data/rhel-2585cf9dfaad.el7 |   5 +-
 redhat/self-test/data/rhel-2585cf9dfaad.el7.spec|  17 ++---
 redhat/self-test/data/rhel-2585cf9dfaad.fc25|   5 +-
 redhat/self-test/data/rhel-2585cf9dfaad.fc25.spec   |  17 ++---
 redhat/self-test/data/rhel-78e36f3b0dae.el7 |   5 +-
 redhat/self-test/data/rhel-78e36f3b0dae.el7.spec|  17 ++---
 redhat/self-test/data/rhel-78e36f3b0dae.fc25|   5 +-
 redhat/self-test/data/rhel-78e36f3b0dae.fc25.spec   |  17 ++---
 redhat/self-test/data/rhel-df0cc57e057f.el7 |   5 +-
 redhat/self-test/data/rhel-df0cc57e057f.el7.spec|  17 ++---
 redhat/self-test/data/rhel-df0cc57e057f.fc25|   5 +-
 redhat/self-test/data/rhel-df0cc57e057f.fc25.spec   |  17 ++---
 redhat/self-test/data/rhel-fce15c45d3fb.el7 |   5 +-
 redhat/self-test/data/rhel-fce15c45d3fb.el7.spec|  17 ++---
 redhat/self-test/data/rhel-fce15c45d3fb.fc25|   5 +-
 redhat/self-test/data/rhel-fce15c45d3fb.fc25.spec   |  17 ++---
 redhat/Makefile |  56 +-
 redhat/Makefile.rhpkg   |   4 +-
 redhat/Makefile.variables   |   5 +
 redhat/genspec.sh   |   8 ++-
 redhat/kernel.spec.template |   7 +-
 59 files changed, 278 insertions(+), 451 deletions(-)
___
kernel mailing list -- kernel@lists.fedoraproject.org
To unsubscribe send an email to kernel-le...@lists.fedoraproject.org
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@lists.fedoraproject.org
Do not reply to spam on the list, report it: 
https://pagure.io/fedora-infrastructure


Re: [OS-BUILD PATCHv6 0/11] redhat: Use Makefile variables in scripts

2022-04-15 Thread Prarit Bhargava (via Email Bridge)
From: Prarit Bhargava on gitlab.com
https://gitlab.com/cki-project/kernel-ark/-/merge_requests/1647#note_913946847

Oops.  I did miss this comment.  This is fixed in the latest version.
___
kernel mailing list -- kernel@lists.fedoraproject.org
To unsubscribe send an email to kernel-le...@lists.fedoraproject.org
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@lists.fedoraproject.org
Do not reply to spam on the list, report it: 
https://pagure.io/fedora-infrastructure


[OS-BUILD PATCHv6 9/11] redhat/self-test: Clean up data set

2022-04-15 Thread Prarit Bhargava (via Email Bridge)
From: Prarit Bhargava 

redhat/self-test: Clean up data set

After running 'make dist-self-test-data' it was noticed that there have
been changes made to the kernel.spec file since the self-test
data was introduced and a few more variables need to be changed for
testing purposes.

Clean up the self-test data set.

Signed-off-by: Prarit Bhargava 

diff --git a/redhat/Makefile b/redhat/Makefile
index blahblah..blahblah 100644
--- a/redhat/Makefile
+++ b/redhat/Makefile
@@ -21,11 +21,17 @@ endif
 include Makefile.variables
 
 LANG=C
+
 ifndef RHSELFTESTDATA
   TOPDIR:=$(shell $(GIT) rev-parse --show-toplevel)
 else
+  # change TOPDIR to be relative
   TOPDIR:=..
+  # RHEL_RELEASE may be updated which will cause a difference with the BUILD 
variable
+  RHEL_RELEASE:=6
+  BUILD:=$(RHEL_RELEASE)
 endif
+
 REDHAT:=$(TOPDIR)/redhat
 include $(TOPDIR)/Makefile.rhelver
 
diff --git a/redhat/self-test/data/centos-2585cf9dfaad.el7 
b/redhat/self-test/data/centos-2585cf9dfaad.el7
index blahblah..blahblah 100644
--- a/redhat/self-test/data/centos-2585cf9dfaad.el7
+++ b/redhat/self-test/data/centos-2585cf9dfaad.el7
@@ -2,6 +2,7 @@
 .SHELLSTATUS=0 
 ARCHCONFIG=X86_64 
 ARCH_LIST=aarch64 ppc64le s390x x86_64 
+BUILD=6 
 BUILD_FLAGS= 
 BUILD_PROFILE=-p stream 
 BUMP_RELEASE=yes 
@@ -46,7 +47,7 @@ RHDISTGIT_TMP=/tmp
 RHDISTGIT_USER="shadowman" 
 RHEL_MAJOR=9 
 RHEL_MINOR=99 
-RHEL_RELEASE=6 
+RHEL_RELEASE=14 
 RHPKG_BIN=centpkg 
 RHSELFTESTDATA=1 
 RPM=../redhat/rpm 
@@ -91,7 +92,6 @@ BUILD_SCRATCH_TARGET=temp-ark-rhel-8-test
 BUILD_TARGET=--scratch temp-ark-rhel-8-test
 BUILD_PROFILE=
 BUILD_FLAGS=
-BUILD=6
 PREBUILD_GIT_ONLY=1
 RHGITCOMMIT=HEAD
 RHJOBS=1
diff --git a/redhat/self-test/data/centos-2585cf9dfaad.el7.spec 
b/redhat/self-test/data/centos-2585cf9dfaad.el7.spec
index blahblah..blahblah 100755
--- a/redhat/self-test/data/centos-2585cf9dfaad.el7.spec
+++ b/redhat/self-test/data/centos-2585cf9dfaad.el7.spec
@@ -777,7 +777,6 @@ Source33: kernel-x86_64-debug-rhel.config
 
 Source34: filter-x86_64.sh.rhel
 Source35: filter-armv7hl.sh.rhel
-Source36: filter-i686.sh.rhel
 Source37: filter-aarch64.sh.rhel
 Source38: filter-ppc64le.sh.rhel
 Source39: filter-s390x.sh.rhel
@@ -796,8 +795,6 @@ Source54: kernel-armv7hl-fedora.config
 Source55: kernel-armv7hl-debug-fedora.config
 Source56: kernel-armv7hl-lpae-fedora.config
 Source57: kernel-armv7hl-lpae-debug-fedora.config
-Source58: kernel-i686-fedora.config
-Source59: kernel-i686-debug-fedora.config
 Source60: kernel-ppc64le-fedora.config
 Source61: kernel-ppc64le-debug-fedora.config
 Source62: kernel-s390x-fedora.config
@@ -807,7 +804,6 @@ Source65: kernel-x86_64-debug-fedora.config
 
 Source67: filter-x86_64.sh.fedora
 Source68: filter-armv7hl.sh.fedora
-Source69: filter-i686.sh.fedora
 Source70: filter-aarch64.sh.fedora
 Source71: filter-ppc64le.sh.fedora
 Source72: filter-s390x.sh.fedora
@@ -1581,7 +1577,7 @@ InitBuildVars() {
 cp configs/$Config .config
 
 %if %{signkernel}%{signmodules}
-cp $RPM_SOURCE_DIR/x509.genkey certs/.
+cp configs/x509.genkey certs/.
 %endif
 
 Arch=`head -1 .config | cut -b 3-`
@@ -2036,7 +2032,7 @@ BuildKernel() {
 remove_depmod_files
 
 # Identify modules in the kernel-modules-extras package
-%{SOURCE20} $RPM_BUILD_ROOT lib/modules/$KernelVer 
$RPM_SOURCE_DIR/mod-extra.list
+%{SOURCE20} $RPM_BUILD_ROOT lib/modules/$KernelVer $(realpath 
configs/mod-extra.list)
 # Identify modules in the kernel-modules-extras package
 %{SOURCE20} $RPM_BUILD_ROOT lib/modules/$KernelVer %{SOURCE84} internal
 
@@ -2047,6 +2043,7 @@ BuildKernel() {
 # Copy the System.map file for depmod to use, and create a backup of the
 # full module tree so we can restore it after we're done filtering
 cp System.map $RPM_BUILD_ROOT/.
+cp configs/filter-*.sh $RPM_BUILD_ROOT/.
 pushd $RPM_BUILD_ROOT
 mkdir restore
 cp -r lib/modules/$KernelVer/* restore/.
@@ -2061,7 +2058,6 @@ BuildKernel() {
# modules lists.  This actually removes anything going into -modules
# from the dir.
find lib/modules/$KernelVer/kernel -name *.ko | sort -n > modules.list
-   cp $RPM_SOURCE_DIR/filter-*.sh .
./filter-modules.sh modules.list %{_target_cpu}
rm filter-*.sh
 
diff --git a/redhat/self-test/data/centos-2585cf9dfaad.fc25 
b/redhat/self-test/data/centos-2585cf9dfaad.fc25
index blahblah..blahblah 100644
--- a/redhat/self-test/data/centos-2585cf9dfaad.fc25
+++ b/redhat/self-test/data/centos-2585cf9dfaad.fc25
@@ -2,6 +2,7 @@
 .SHELLSTATUS=0 
 ARCHCONFIG=X86_64 
 ARCH_LIST=aarch64 ppc64le s390x x86_64 
+BUILD=6 
 BUILD_FLAGS= 
 BUILD_PROFILE=-p stream 
 BUMP_RELEASE=yes 
@@ -46,7 +47,7 @@ RHDISTGIT_TMP=/tmp
 RHDISTGIT_USER="shadowman" 
 RHEL_MAJOR=9 
 RHEL_MINOR=99 
-RHEL_RELEASE=6 
+RHEL_RELEASE=14 
 RHPKG_BIN=centpkg 
 RHSELFTESTDATA=1 
 RPM=../redhat/rpm 
@@ -91,7 +92,6 @@ BUILD_SCRATCH_TARGET=temp-ark-rhel-8-test
 BUILD_TARGET=--scratch temp-ark-rhel-8-test
 BUILD_PROFILE=
 

[OS-BUILD PATCHv6 7/11] redhat/Makefile: Cleanup TARBALL target

2022-04-15 Thread Prarit Bhargava (via Email Bridge)
From: Prarit Bhargava 

redhat/Makefile: Cleanup TARBALL target

The TARBALL target can be cleaned up by using GITID everywhere.  This
results in no changes, so the SINGLE_TARBALL variable can be dropped.

Additional fix: Use GITID directly in create-tarball.sh.  GITID is already
GITID_NORMALIZE so it is safe to replace.

Signed-off-by: Prarit Bhargava 

diff --git a/redhat/Makefile b/redhat/Makefile
index blahblah..blahblah 100644
--- a/redhat/Makefile
+++ b/redhat/Makefile
@@ -206,18 +206,12 @@ 
SRPM:=$(SRPMS)/$(PACKAGE_NAME)-$(RPMVERSION)$(DIST).src.rpm
 # specific values should be set.
 #
 ifeq ("$(DISTRO)", "fedora")
-  # A non-unified tarball means that the tarball is only upstream sources
-  # and the patches get applied as a diff in the spec file
-  SINGLE_TARBALL:=0
   TARFILE_RELEASE:=$(UPSTREAM_TARBALL_NAME)
   RHDISTGIT_BRANCH:=rawhide
   ifndef BUILD_SCRATCH_TARGET
 BUILD_SCRATCH_TARGET:=temp-ark-rhel-8-test
   endif
 else ifeq ("$(DISTRO)", "centos")
-  # A unified tarball means that the tarball in the srpm contains both the
-  # upstream sources and RHEL specific patches.
-  SINGLE_TARBALL:=1
   RHDISTGIT_BRANCH:=c$(RHEL_MAJOR)s
   ifndef BUILD_PROFILE
 BUILD_PROFILE:= -p stream
@@ -227,9 +221,6 @@ else ifeq ("$(DISTRO)", "centos")
   endif
   TARFILE_RELEASE:=$(RPMVERSION)
 else
-  # A unified tarball means that the tarball in the srpm contains both the
-  # upstream sources and RHEL specific patches.
-  SINGLE_TARBALL:=1
   RHDISTGIT_BRANCH:=rhel-$(RHEL_MAJOR).$(RHEL_MINOR).0
   ifndef BUILD_SCRATCH_TARGET
 BUILD_SCRATCH_TARGET:=rhel-$(RHEL_MAJOR).$(RHEL_MINOR).0-test-pesign
@@ -396,11 +387,7 @@ dist-stub-key:
 # force tarball to be regenerated if HEAD changes
 .PHONY:$(TARBALL)
 $(TARBALL):
-   @if [ $(SINGLE_TARBALL) -eq 1 ]; then \
-   scripts/create-tarball.sh $(GITID) linux-$(RPMVERSION); \
-   else \
-   scripts/create-tarball.sh $(MARKER) linux-$(TARFILE_RELEASE); \
-   fi
+   scripts/create-tarball.sh $(GITID) linux-$(TARFILE_RELEASE)
 
 .PHONY: $(KABI_TARBALL)
 $(KABI_TARBALL):
diff --git a/redhat/genspec.sh b/redhat/genspec.sh
index blahblah..blahblah 100755
--- a/redhat/genspec.sh
+++ b/redhat/genspec.sh
@@ -162,13 +162,17 @@ mv -f "$clogf.full" "$SOURCES/$CHANGELOG"
 
 echo "MARKER is $MARKER"
 
-if [ "$SINGLE_TARBALL" = 0 ]; then
+if [ "$DISTRO" == "fedora" ]; then
+   # The tarball in the SRPM contains only the upstream sources.
+
# May need to preserve word splitting in EXCLUDE_FILES
# shellcheck disable=SC2086
git diff -p --no-renames --stat "$MARKER"..  $EXCLUDE_FILES \
> ${SOURCES}/patch-${RPMKVERSION}.${RPMKPATCHLEVEL}-redhat.patch
 else
-   # Need an empty file for dist-git compatibility
+   # The tarball in the SRPM contains both upstream sources and OS-specifc
+   # commits.  Even though this is the case, an empty file for dist-git
+   # compatibility is necessary.
touch "${SOURCES}/patch-${RPMKVERSION}.${RPMKPATCHLEVEL}"-redhat.patch
 fi
 
diff --git a/redhat/scripts/create-tarball.sh b/redhat/scripts/create-tarball.sh
index blahblah..blahblah 100755
--- a/redhat/scripts/create-tarball.sh
+++ b/redhat/scripts/create-tarball.sh
@@ -16,8 +16,7 @@ fi
 
 if [ -f "$TARBALL" ]; then
TARID=$(xzcat -qq "$TARBALL" | git get-tar-commit-id 2>/dev/null)
-   GITID_NORMALIZE=$(git log --max-count=1 --pretty=format:%H "$GITID")
-   if [ "${GITID_NORMALIZE}" = "${TARID}" ]; then
+   if [ "${GITID}" = "${TARID}" ]; then
echo "$(basename "$TARBALL") unchanged..."
exit 0
fi
diff --git a/redhat/self-test/data/centos-2585cf9dfaad.el7 
b/redhat/self-test/data/centos-2585cf9dfaad.el7
index blahblah..blahblah 100644
--- a/redhat/self-test/data/centos-2585cf9dfaad.el7
+++ b/redhat/self-test/data/centos-2585cf9dfaad.el7
@@ -57,7 +57,6 @@ RPMKSUBLEVEL=0
 RPMKVERSION=5 
 RPMVERSION=5.16.0-0.rc5.6.test 
 SHELL=/bin/sh 
-SINGLE_TARBALL=1 
 SNAPSHOT=0 
 SOURCES=../redhat/rpm/SOURCES 
 SPECFILE=kernel.spec 
diff --git a/redhat/self-test/data/centos-2585cf9dfaad.fc25 
b/redhat/self-test/data/centos-2585cf9dfaad.fc25
index blahblah..blahblah 100644
--- a/redhat/self-test/data/centos-2585cf9dfaad.fc25
+++ b/redhat/self-test/data/centos-2585cf9dfaad.fc25
@@ -57,7 +57,6 @@ RPMKSUBLEVEL=0
 RPMKVERSION=5 
 RPMVERSION=5.16.0-0.rc5.6.test 
 SHELL=/bin/sh 
-SINGLE_TARBALL=1 
 SNAPSHOT=0 
 SOURCES=../redhat/rpm/SOURCES 
 SPECFILE=kernel.spec 
diff --git a/redhat/self-test/data/centos-78e36f3b0dae.el7 
b/redhat/self-test/data/centos-78e36f3b0dae.el7
index blahblah..blahblah 100644
--- a/redhat/self-test/data/centos-78e36f3b0dae.el7
+++ b/redhat/self-test/data/centos-78e36f3b0dae.el7
@@ -57,7 +57,6 @@ RPMKSUBLEVEL=0
 RPMKVERSION=5 
 RPMVERSION=5.17.0-0.rc0.78e36f3b0dae586.6.test 
 SHELL=/bin/sh 
-SINGLE_TARBALL=1 
 SNAPSHOT=1 
 SOURCES=../redhat/rpm/SOURCES 
 SPECFILE=kernel.spec 
diff --git 

[OS-BUILD PATCHv6 11/11] redhat/Makefile: Deprecate SINGLE_TARBALL

2022-04-15 Thread Prarit Bhargava (via Email Bridge)
From: Prarit Bhargava 

redhat/Makefile: Deprecate SINGLE_TARBALL

jforbes points out that the removal of the SINGLE_TARBALL may affect some
SIGs.  Since the users of the variable are unknown and maybe zero, mark it
as deprecated.  This commit can be reverted if anyone requests it be kept
in place.

Deprecate the SINGLE_TARBALL variable.

Signed-off-by: Prarit Bhargava 

diff --git a/redhat/Makefile b/redhat/Makefile
index blahblah..blahblah 100644
--- a/redhat/Makefile
+++ b/redhat/Makefile
@@ -18,6 +18,13 @@ ifdef TEST_FLAGS
   $(warning WARNING: TEST_FLAGS will be deprecated in a later release, use 
BUILD_FLAGS instead.)
 endif
 
+ifdef SINGLE_TARBALL
+  # The commit that introduced this code can be reverted if there are users of
+  # this variable.
+  # deprecated in 5.18.0
+  $(warning WARNING: SINGLE_TARBALL will be deprecated in a later release.)
+endif
+
 include Makefile.variables
 
 LANG=C
diff --git a/redhat/Makefile.variables b/redhat/Makefile.variables
index blahblah..blahblah 100644
--- a/redhat/Makefile.variables
+++ b/redhat/Makefile.variables
@@ -127,3 +127,8 @@ RHSELFTESTDATA ?=
 # This variable is used by the redhat/self-tests.  It should not be
 # considered stable and my be changed or removed without warning.
 RHDISTDATADIR ?=
+
+# This variable is used in redhat/genspec.sh.  It determines if all commits 
are rolled into
+# a single tarball, or if the commits are individually broken out into 
separate patches
+# and then included in the tarball.
+SINGLE_TARBALL ?=
diff --git a/redhat/genspec.sh b/redhat/genspec.sh
index blahblah..blahblah 100755
--- a/redhat/genspec.sh
+++ b/redhat/genspec.sh
@@ -162,7 +162,7 @@ mv -f "$clogf.full" "$SOURCES/$CHANGELOG"
 
 echo "MARKER is $MARKER"
 
-if [ "$DISTRO" == "fedora" ]; then
+if [ "$DISTRO" == "fedora" ] || [ -n "$SINGLE_TARBALL" ]; then
# The tarball in the SRPM contains only the upstream sources.
 
# May need to preserve word splitting in EXCLUDE_FILES

--
https://gitlab.com/cki-project/kernel-ark/-/merge_requests/1647
___
kernel mailing list -- kernel@lists.fedoraproject.org
To unsubscribe send an email to kernel-le...@lists.fedoraproject.org
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@lists.fedoraproject.org
Do not reply to spam on the list, report it: 
https://pagure.io/fedora-infrastructure


<    5   6   7   8   9   10   11   12   13   14   >