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 prarit@redhat.com
--- 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 | 1 - redhat/self-test/data/centos-2585cf9dfaad.el7.spec | 7 +- redhat/self-test/data/centos-2585cf9dfaad.fc25 | 1 - redhat/self-test/data/centos-2585cf9dfaad.fc25.spec | 7 +- redhat/self-test/data/centos-78e36f3b0dae.el7 | 1 - redhat/self-test/data/centos-78e36f3b0dae.el7.spec | 7 +- redhat/self-test/data/centos-78e36f3b0dae.fc25 | 1 - redhat/self-test/data/centos-78e36f3b0dae.fc25.spec | 7 +- redhat/self-test/data/centos-df0cc57e057f.el7 | 1 - redhat/self-test/data/centos-df0cc57e057f.el7.spec | 7 +- redhat/self-test/data/centos-df0cc57e057f.fc25 | 1 - redhat/self-test/data/centos-df0cc57e057f.fc25.spec | 7 +- redhat/self-test/data/centos-fce15c45d3fb.el7 | 1 - redhat/self-test/data/centos-fce15c45d3fb.el7.spec | 7 +- redhat/self-test/data/centos-fce15c45d3fb.fc25 | 1 - redhat/self-test/data/centos-fce15c45d3fb.fc25.spec | 7 +- redhat/self-test/data/fedora-2585cf9dfaad.el7 | 1 - redhat/self-test/data/fedora-2585cf9dfaad.el7.spec | 7 +- redhat/self-test/data/fedora-2585cf9dfaad.fc25 | 1 - redhat/self-test/data/fedora-2585cf9dfaad.fc25.spec | 7 +- redhat/self-test/data/fedora-78e36f3b0dae.el7 | 1 - redhat/self-test/data/fedora-78e36f3b0dae.el7.spec | 7 +- redhat/self-test/data/fedora-78e36f3b0dae.fc25 | 1 - redhat/self-test/data/fedora-78e36f3b0dae.fc25.spec | 7 +- redhat/self-test/data/fedora-df0cc57e057f.el7 | 1 - redhat/self-test/data/fedora-df0cc57e057f.el7.spec | 7 +- redhat/self-test/data/fedora-df0cc57e057f.fc25 | 1 - redhat/self-test/data/fedora-df0cc57e057f.fc25.spec | 7 +- redhat/self-test/data/fedora-fce15c45d3fb.el7 | 1 - redhat/self-test/data/fedora-fce15c45d3fb.el7.spec | 7 +- redhat/self-test/data/fedora-fce15c45d3fb.fc25 | 1 - redhat/self-test/data/fedora-fce15c45d3fb.fc25.spec | 7 +- redhat/self-test/data/rhel-2585cf9dfaad.el7 | 1 - redhat/self-test/data/rhel-2585cf9dfaad.el7.spec | 7 +- redhat/self-test/data/rhel-2585cf9dfaad.fc25 | 1 - redhat/self-test/data/rhel-2585cf9dfaad.fc25.spec | 7 +- redhat/self-test/data/rhel-78e36f3b0dae.el7 | 1 - redhat/self-test/data/rhel-78e36f3b0dae.el7.spec | 7 +- redhat/self-test/data/rhel-78e36f3b0dae.fc25 | 1 - redhat/self-test/data/rhel-78e36f3b0dae.fc25.spec | 7 +- redhat/self-test/data/rhel-df0cc57e057f.el7 | 1 - redhat/self-test/data/rhel-df0cc57e057f.el7.spec | 7 +- redhat/self-test/data/rhel-df0cc57e057f.fc25 | 1 - redhat/self-test/data/rhel-df0cc57e057f.fc25.spec | 7 +- redhat/self-test/data/rhel-fce15c45d3fb.el7 | 1 - redhat/self-test/data/rhel-fce15c45d3fb.el7.spec | 7 +- redhat/self-test/data/rhel-fce15c45d3fb.fc25 | 1 - redhat/self-test/data/rhel-fce15c45d3fb.fc25.spec | 7 +- redhat/Makefile | 43 +++++--------- redhat/genspec.sh | 8 ++- redhat/kernel.spec.template | 7 +- 56 files changed, 135 insertions(+), 232 deletions(-)
From: Prarit Bhargava prarit@redhat.com
redhat/configs/generate_all_configs.sh: Use Makefile variables
Use Makefile variables in generate_all_configs.sh.
Signed-off-by: Prarit Bhargava prarit@redhat.com
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} +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-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 @@ -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-df0cc57e057f.fc25.spec b/redhat/self-test/data/centos-df0cc57e057f.fc25.spec index blahblah..blahblah 100755 --- a/redhat/self-test/data/centos-df0cc57e057f.fc25.spec +++ b/redhat/self-test/data/centos-df0cc57e057f.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-fce15c45d3fb.el7.spec b/redhat/self-test/data/centos-fce15c45d3fb.el7.spec index blahblah..blahblah 100755 --- a/redhat/self-test/data/centos-fce15c45d3fb.el7.spec +++ b/redhat/self-test/data/centos-fce15c45d3fb.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-fce15c45d3fb.fc25.spec b/redhat/self-test/data/centos-fce15c45d3fb.fc25.spec index blahblah..blahblah 100755 --- a/redhat/self-test/data/centos-fce15c45d3fb.fc25.spec +++ b/redhat/self-test/data/centos-fce15c45d3fb.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/fedora-2585cf9dfaad.el7.spec b/redhat/self-test/data/fedora-2585cf9dfaad.el7.spec index blahblah..blahblah 100755 --- a/redhat/self-test/data/fedora-2585cf9dfaad.el7.spec +++ b/redhat/self-test/data/fedora-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/fedora-2585cf9dfaad.fc25.spec b/redhat/self-test/data/fedora-2585cf9dfaad.fc25.spec index blahblah..blahblah 100755 --- a/redhat/self-test/data/fedora-2585cf9dfaad.fc25.spec +++ b/redhat/self-test/data/fedora-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/fedora-78e36f3b0dae.el7.spec b/redhat/self-test/data/fedora-78e36f3b0dae.el7.spec index blahblah..blahblah 100755 --- a/redhat/self-test/data/fedora-78e36f3b0dae.el7.spec +++ b/redhat/self-test/data/fedora-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/fedora-78e36f3b0dae.fc25.spec b/redhat/self-test/data/fedora-78e36f3b0dae.fc25.spec index blahblah..blahblah 100755 --- a/redhat/self-test/data/fedora-78e36f3b0dae.fc25.spec +++ b/redhat/self-test/data/fedora-78e36f3b0dae.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/fedora-df0cc57e057f.el7.spec b/redhat/self-test/data/fedora-df0cc57e057f.el7.spec index blahblah..blahblah 100755 --- a/redhat/self-test/data/fedora-df0cc57e057f.el7.spec +++ b/redhat/self-test/data/fedora-df0cc57e057f.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/fedora-df0cc57e057f.fc25.spec b/redhat/self-test/data/fedora-df0cc57e057f.fc25.spec index blahblah..blahblah 100755 --- a/redhat/self-test/data/fedora-df0cc57e057f.fc25.spec +++ b/redhat/self-test/data/fedora-df0cc57e057f.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/fedora-fce15c45d3fb.el7.spec b/redhat/self-test/data/fedora-fce15c45d3fb.el7.spec index blahblah..blahblah 100755 --- a/redhat/self-test/data/fedora-fce15c45d3fb.el7.spec +++ b/redhat/self-test/data/fedora-fce15c45d3fb.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/fedora-fce15c45d3fb.fc25.spec b/redhat/self-test/data/fedora-fce15c45d3fb.fc25.spec index blahblah..blahblah 100755 --- a/redhat/self-test/data/fedora-fce15c45d3fb.fc25.spec +++ b/redhat/self-test/data/fedora-fce15c45d3fb.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/rhel-2585cf9dfaad.el7.spec b/redhat/self-test/data/rhel-2585cf9dfaad.el7.spec index blahblah..blahblah 100755 --- a/redhat/self-test/data/rhel-2585cf9dfaad.el7.spec +++ b/redhat/self-test/data/rhel-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
-- https://gitlab.com/cki-project/kernel-ark/-/merge_requests/1647
From: Prarit Bhargava prarit@redhat.com
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 prarit@redhat.com
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} 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.fc25.spec b/redhat/self-test/data/centos-df0cc57e057f.fc25.spec index blahblah..blahblah 100755 --- a/redhat/self-test/data/centos-df0cc57e057f.fc25.spec +++ b/redhat/self-test/data/centos-df0cc57e057f.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-fce15c45d3fb.el7.spec b/redhat/self-test/data/centos-fce15c45d3fb.el7.spec index blahblah..blahblah 100755 --- a/redhat/self-test/data/centos-fce15c45d3fb.el7.spec +++ b/redhat/self-test/data/centos-fce15c45d3fb.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-fce15c45d3fb.fc25.spec b/redhat/self-test/data/centos-fce15c45d3fb.fc25.spec index blahblah..blahblah 100755 --- a/redhat/self-test/data/centos-fce15c45d3fb.fc25.spec +++ b/redhat/self-test/data/centos-fce15c45d3fb.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/fedora-2585cf9dfaad.el7.spec b/redhat/self-test/data/fedora-2585cf9dfaad.el7.spec index blahblah..blahblah 100755 --- a/redhat/self-test/data/fedora-2585cf9dfaad.el7.spec +++ b/redhat/self-test/data/fedora-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/fedora-2585cf9dfaad.fc25.spec b/redhat/self-test/data/fedora-2585cf9dfaad.fc25.spec index blahblah..blahblah 100755 --- a/redhat/self-test/data/fedora-2585cf9dfaad.fc25.spec +++ b/redhat/self-test/data/fedora-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/fedora-78e36f3b0dae.el7.spec b/redhat/self-test/data/fedora-78e36f3b0dae.el7.spec index blahblah..blahblah 100755 --- a/redhat/self-test/data/fedora-78e36f3b0dae.el7.spec +++ b/redhat/self-test/data/fedora-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/fedora-78e36f3b0dae.fc25.spec b/redhat/self-test/data/fedora-78e36f3b0dae.fc25.spec index blahblah..blahblah 100755 --- a/redhat/self-test/data/fedora-78e36f3b0dae.fc25.spec +++ b/redhat/self-test/data/fedora-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/fedora-df0cc57e057f.el7.spec b/redhat/self-test/data/fedora-df0cc57e057f.el7.spec index blahblah..blahblah 100755 --- a/redhat/self-test/data/fedora-df0cc57e057f.el7.spec +++ b/redhat/self-test/data/fedora-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} 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/fedora-df0cc57e057f.fc25.spec b/redhat/self-test/data/fedora-df0cc57e057f.fc25.spec index blahblah..blahblah 100755 --- a/redhat/self-test/data/fedora-df0cc57e057f.fc25.spec +++ b/redhat/self-test/data/fedora-df0cc57e057f.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/fedora-fce15c45d3fb.el7.spec b/redhat/self-test/data/fedora-fce15c45d3fb.el7.spec index blahblah..blahblah 100755 --- a/redhat/self-test/data/fedora-fce15c45d3fb.el7.spec +++ b/redhat/self-test/data/fedora-fce15c45d3fb.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/fedora-fce15c45d3fb.fc25.spec b/redhat/self-test/data/fedora-fce15c45d3fb.fc25.spec index blahblah..blahblah 100755 --- a/redhat/self-test/data/fedora-fce15c45d3fb.fc25.spec +++ b/redhat/self-test/data/fedora-fce15c45d3fb.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/rhel-2585cf9dfaad.el7.spec b/redhat/self-test/data/rhel-2585cf9dfaad.el7.spec index blahblah..blahblah 100755 --- a/redhat/self-test/data/rhel-2585cf9dfaad.el7.spec +++ b/redhat/self-test/data/rhel-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/rhel-2585cf9dfaad.fc25.spec b/redhat/self-test/data/rhel-2585cf9dfaad.fc25.spec index blahblah..blahblah 100755 --- a/redhat/self-test/data/rhel-2585cf9dfaad.fc25.spec +++ b/redhat/self-test/data/rhel-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/rhel-78e36f3b0dae.el7.spec b/redhat/self-test/data/rhel-78e36f3b0dae.el7.spec index blahblah..blahblah 100755 --- a/redhat/self-test/data/rhel-78e36f3b0dae.el7.spec +++ b/redhat/self-test/data/rhel-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}
-- https://gitlab.com/cki-project/kernel-ark/-/merge_requests/1647
From: Prarit Bhargava prarit@redhat.com
redhat/configs/process_configs.sh: Use Makefile variables
Cleanup up parameters and use Makefile variables in process_config.sh.
Signed-off-by: Prarit Bhargava prarit@redhat.com
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 -./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.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 @@ -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-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 @@ -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-df0cc57e057f.fc25.spec b/redhat/self-test/data/centos-df0cc57e057f.fc25.spec index blahblah..blahblah 100755 --- a/redhat/self-test/data/centos-df0cc57e057f.fc25.spec +++ b/redhat/self-test/data/centos-df0cc57e057f.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-fce15c45d3fb.el7.spec b/redhat/self-test/data/centos-fce15c45d3fb.el7.spec index blahblah..blahblah 100755 --- a/redhat/self-test/data/centos-fce15c45d3fb.el7.spec +++ b/redhat/self-test/data/centos-fce15c45d3fb.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-fce15c45d3fb.fc25.spec b/redhat/self-test/data/centos-fce15c45d3fb.fc25.spec index blahblah..blahblah 100755 --- a/redhat/self-test/data/centos-fce15c45d3fb.fc25.spec +++ b/redhat/self-test/data/centos-fce15c45d3fb.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/fedora-2585cf9dfaad.el7.spec b/redhat/self-test/data/fedora-2585cf9dfaad.el7.spec index blahblah..blahblah 100755 --- a/redhat/self-test/data/fedora-2585cf9dfaad.el7.spec +++ b/redhat/self-test/data/fedora-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/fedora-2585cf9dfaad.fc25.spec b/redhat/self-test/data/fedora-2585cf9dfaad.fc25.spec index blahblah..blahblah 100755 --- a/redhat/self-test/data/fedora-2585cf9dfaad.fc25.spec +++ b/redhat/self-test/data/fedora-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/fedora-78e36f3b0dae.el7.spec b/redhat/self-test/data/fedora-78e36f3b0dae.el7.spec index blahblah..blahblah 100755 --- a/redhat/self-test/data/fedora-78e36f3b0dae.el7.spec +++ b/redhat/self-test/data/fedora-78e36f3b0dae.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/fedora-78e36f3b0dae.fc25.spec b/redhat/self-test/data/fedora-78e36f3b0dae.fc25.spec index blahblah..blahblah 100755 --- a/redhat/self-test/data/fedora-78e36f3b0dae.fc25.spec +++ b/redhat/self-test/data/fedora-78e36f3b0dae.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/fedora-df0cc57e057f.el7.spec b/redhat/self-test/data/fedora-df0cc57e057f.el7.spec index blahblah..blahblah 100755 --- a/redhat/self-test/data/fedora-df0cc57e057f.el7.spec +++ b/redhat/self-test/data/fedora-df0cc57e057f.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/fedora-df0cc57e057f.fc25.spec b/redhat/self-test/data/fedora-df0cc57e057f.fc25.spec index blahblah..blahblah 100755 --- a/redhat/self-test/data/fedora-df0cc57e057f.fc25.spec +++ b/redhat/self-test/data/fedora-df0cc57e057f.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/fedora-fce15c45d3fb.el7.spec b/redhat/self-test/data/fedora-fce15c45d3fb.el7.spec index blahblah..blahblah 100755 --- a/redhat/self-test/data/fedora-fce15c45d3fb.el7.spec +++ b/redhat/self-test/data/fedora-fce15c45d3fb.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/fedora-fce15c45d3fb.fc25.spec b/redhat/self-test/data/fedora-fce15c45d3fb.fc25.spec index blahblah..blahblah 100755 --- a/redhat/self-test/data/fedora-fce15c45d3fb.fc25.spec +++ b/redhat/self-test/data/fedora-fce15c45d3fb.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/rhel-2585cf9dfaad.el7.spec b/redhat/self-test/data/rhel-2585cf9dfaad.el7.spec index blahblah..blahblah 100755 --- a/redhat/self-test/data/rhel-2585cf9dfaad.el7.spec +++ b/redhat/self-test/data/rhel-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}
-- https://gitlab.com/cki-project/kernel-ark/-/merge_requests/1647
From: Prarit Bhargava prarit@redhat.com
redhat/configs/build_configs.sh: Use Makefile variables
Use Makefile variables in build_configs.sh.
Signed-off-by: Prarit Bhargava prarit@redhat.com
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
From: Prarit Bhargava prarit@redhat.com
redhat/scripts/rh-dist-git.sh: Use Makefile variables
Use Makefile variables in rh-dist-git.sh.
Signed-off-by: Prarit Bhargava prarit@redhat.com
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 <branch> [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 \ - "$rhdistgit_zstream_flag" "$package_name" >"$tmpdir"/changelog +"$REDHAT"/scripts/create_distgit_changelog.sh "$REDHAT/rpm/SOURCES/$PACKAGE_NAME".spec \ + "$__ZSTREAM" "$PACKAGE_NAME" >"$tmpdir"/changelog
# all done echo "$tmpdir"
-- https://gitlab.com/cki-project/kernel-ark/-/merge_requests/1647
From: Prarit Bhargava prarit@redhat.com
redhat/Makefile: Use RPMVERSION
Use RPMVERSION where appropriate in the Makefile.
Signed-off-by: Prarit Bhargava prarit@redhat.com
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
From: Prarit Bhargava prarit@redhat.com
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 prarit@redhat.com
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 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 @@ -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 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 @@ -57,7 +57,6 @@ RPMKSUBLEVEL=0 RPMKVERSION=5 RPMVERSION=5.16.0-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-df0cc57e057f.fc25 b/redhat/self-test/data/centos-df0cc57e057f.fc25 index blahblah..blahblah 100644 --- a/redhat/self-test/data/centos-df0cc57e057f.fc25 +++ b/redhat/self-test/data/centos-df0cc57e057f.fc25 @@ -57,7 +57,6 @@ RPMKSUBLEVEL=0 RPMKVERSION=5 RPMVERSION=5.16.0-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-fce15c45d3fb.el7 b/redhat/self-test/data/centos-fce15c45d3fb.el7 index blahblah..blahblah 100644 --- a/redhat/self-test/data/centos-fce15c45d3fb.el7 +++ b/redhat/self-test/data/centos-fce15c45d3fb.el7 @@ -57,7 +57,6 @@ RPMKSUBLEVEL=0 RPMKVERSION=5 RPMVERSION=5.16.0-0.rc5.fce15c45d3fbd9f.6.test SHELL=/bin/sh -SINGLE_TARBALL=1 SNAPSHOT=1 SOURCES=../redhat/rpm/SOURCES SPECFILE=kernel.spec diff --git a/redhat/self-test/data/centos-fce15c45d3fb.fc25 b/redhat/self-test/data/centos-fce15c45d3fb.fc25 index blahblah..blahblah 100644 --- a/redhat/self-test/data/centos-fce15c45d3fb.fc25 +++ b/redhat/self-test/data/centos-fce15c45d3fb.fc25 @@ -57,7 +57,6 @@ RPMKSUBLEVEL=0 RPMKVERSION=5 RPMVERSION=5.16.0-0.rc5.fce15c45d3fbd9f.6.test SHELL=/bin/sh -SINGLE_TARBALL=1 SNAPSHOT=1 SOURCES=../redhat/rpm/SOURCES SPECFILE=kernel.spec diff --git a/redhat/self-test/data/fedora-2585cf9dfaad.el7 b/redhat/self-test/data/fedora-2585cf9dfaad.el7 index blahblah..blahblah 100644 --- a/redhat/self-test/data/fedora-2585cf9dfaad.el7 +++ b/redhat/self-test/data/fedora-2585cf9dfaad.el7 @@ -55,7 +55,6 @@ RPMKSUBLEVEL=0 RPMKVERSION=5 RPMVERSION=5.16.0-0.rc5.6.test SHELL=/bin/sh -SINGLE_TARBALL=0 SNAPSHOT=0 SOURCES=../redhat/rpm/SOURCES SPECFILE=kernel.spec diff --git a/redhat/self-test/data/fedora-2585cf9dfaad.fc25 b/redhat/self-test/data/fedora-2585cf9dfaad.fc25 index blahblah..blahblah 100644 --- a/redhat/self-test/data/fedora-2585cf9dfaad.fc25 +++ b/redhat/self-test/data/fedora-2585cf9dfaad.fc25 @@ -55,7 +55,6 @@ RPMKSUBLEVEL=0 RPMKVERSION=5 RPMVERSION=5.16.0-0.rc5.6.test SHELL=/bin/sh -SINGLE_TARBALL=0 SNAPSHOT=0 SOURCES=../redhat/rpm/SOURCES SPECFILE=kernel.spec diff --git a/redhat/self-test/data/fedora-78e36f3b0dae.el7 b/redhat/self-test/data/fedora-78e36f3b0dae.el7 index blahblah..blahblah 100644 --- a/redhat/self-test/data/fedora-78e36f3b0dae.el7 +++ b/redhat/self-test/data/fedora-78e36f3b0dae.el7 @@ -55,7 +55,6 @@ RPMKSUBLEVEL=0 RPMKVERSION=5 RPMVERSION=5.17.0-0.rc0.78e36f3b0dae586.6.test SHELL=/bin/sh -SINGLE_TARBALL=0 SNAPSHOT=1 SOURCES=../redhat/rpm/SOURCES SPECFILE=kernel.spec diff --git a/redhat/self-test/data/fedora-78e36f3b0dae.fc25 b/redhat/self-test/data/fedora-78e36f3b0dae.fc25 index blahblah..blahblah 100644 --- a/redhat/self-test/data/fedora-78e36f3b0dae.fc25 +++ b/redhat/self-test/data/fedora-78e36f3b0dae.fc25 @@ -55,7 +55,6 @@ RPMKSUBLEVEL=0 RPMKVERSION=5 RPMVERSION=5.17.0-0.rc0.78e36f3b0dae586.6.test SHELL=/bin/sh -SINGLE_TARBALL=0 SNAPSHOT=1 SOURCES=../redhat/rpm/SOURCES SPECFILE=kernel.spec diff --git a/redhat/self-test/data/fedora-df0cc57e057f.el7 b/redhat/self-test/data/fedora-df0cc57e057f.el7 index blahblah..blahblah 100644 --- a/redhat/self-test/data/fedora-df0cc57e057f.el7 +++ b/redhat/self-test/data/fedora-df0cc57e057f.el7 @@ -55,7 +55,6 @@ RPMKSUBLEVEL=0 RPMKVERSION=5 RPMVERSION=5.16.0-6.test SHELL=/bin/sh -SINGLE_TARBALL=0 SNAPSHOT=0 SOURCES=../redhat/rpm/SOURCES SPECFILE=kernel.spec diff --git a/redhat/self-test/data/fedora-df0cc57e057f.fc25 b/redhat/self-test/data/fedora-df0cc57e057f.fc25 index blahblah..blahblah 100644 --- a/redhat/self-test/data/fedora-df0cc57e057f.fc25 +++ b/redhat/self-test/data/fedora-df0cc57e057f.fc25 @@ -55,7 +55,6 @@ RPMKSUBLEVEL=0 RPMKVERSION=5 RPMVERSION=5.16.0-6.test SHELL=/bin/sh -SINGLE_TARBALL=0 SNAPSHOT=0 SOURCES=../redhat/rpm/SOURCES SPECFILE=kernel.spec diff --git a/redhat/self-test/data/fedora-fce15c45d3fb.el7 b/redhat/self-test/data/fedora-fce15c45d3fb.el7 index blahblah..blahblah 100644 --- a/redhat/self-test/data/fedora-fce15c45d3fb.el7 +++ b/redhat/self-test/data/fedora-fce15c45d3fb.el7 @@ -55,7 +55,6 @@ RPMKSUBLEVEL=0 RPMKVERSION=5 RPMVERSION=5.16.0-0.rc5.fce15c45d3fbd9f.6.test SHELL=/bin/sh -SINGLE_TARBALL=0 SNAPSHOT=1 SOURCES=../redhat/rpm/SOURCES SPECFILE=kernel.spec diff --git a/redhat/self-test/data/fedora-fce15c45d3fb.fc25 b/redhat/self-test/data/fedora-fce15c45d3fb.fc25 index blahblah..blahblah 100644 --- a/redhat/self-test/data/fedora-fce15c45d3fb.fc25 +++ b/redhat/self-test/data/fedora-fce15c45d3fb.fc25 @@ -55,7 +55,6 @@ RPMKSUBLEVEL=0 RPMKVERSION=5 RPMVERSION=5.16.0-0.rc5.fce15c45d3fbd9f.6.test SHELL=/bin/sh -SINGLE_TARBALL=0 SNAPSHOT=1 SOURCES=../redhat/rpm/SOURCES SPECFILE=kernel.spec diff --git a/redhat/self-test/data/rhel-2585cf9dfaad.el7 b/redhat/self-test/data/rhel-2585cf9dfaad.el7 index blahblah..blahblah 100644 --- a/redhat/self-test/data/rhel-2585cf9dfaad.el7 +++ b/redhat/self-test/data/rhel-2585cf9dfaad.el7 @@ -55,7 +55,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
-- https://gitlab.com/cki-project/kernel-ark/-/merge_requests/1647
From: Prarit Bhargava prarit@redhat.com
redhat/scripts/create-tarball.sh: Use Makefile variables
Use Makefile variables is redhat/scripts/create-tarball.sh.
Signed-off-by: Prarit Bhargava prarit@redhat.com
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
From: Prarit Bhargava on gitlab.com https://gitlab.com/cki-project/kernel-ark/-/merge_requests/1647#note_9052153...
@jwilsonrh @jmflinuxtx @ptalbert, reviews please.
kernel@lists.fedoraproject.org