From: Prarit Bhargava <prarit(a)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(a)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%%
@@ -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.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/1706