From: Prarit Bhargava <prarit@xxxxxxxxxx> 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@xxxxxxxxxx> 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} 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 _______________________________________________ kernel mailing list -- kernel@xxxxxxxxxxxxxxxxxxxxxxx To unsubscribe send an email to kernel-leave@xxxxxxxxxxxxxxxxxxxxxxx Fedora Code of Conduct: https://docs.fedoraproject.org/en-US/project/code-of-conduct/ List Guidelines: https://fedoraproject.org/wiki/Mailing_list_guidelines List Archives: https://lists.fedoraproject.org/archives/list/kernel@xxxxxxxxxxxxxxxxxxxxxxx Do not reply to spam on the list, report it: https://pagure.io/fedora-infrastructure