From: Jan Stancek <jstancek(a)redhat.com>
redhat/kernel.spec.template: fix standalone tools build
Building only tools:
rpmbuild --rebuild --without doc --without cross_headers \
--without kabidw_base --without debuginfo --without debug \
--without up --without zfcpdump --without trace \
--without bpftool --without selftests --without pae kernel.src.rpm
at the moment fails with:
find:
'/root/rpmbuild/BUILDROOT/kernel-5.18.0-0.rc6.47.test.el9.x86_64/lib/modules/': No
such file or directory
xz: Compressed data cannot be written to a terminal
xz: Try `xz --help' for more information.
error: Bad exit status from /var/tmp/rpm-tmp.EaolzQ (%install)
Add "-r" to xargs to skip compression if no modules are built.
Signed-off-by: Jerome Marchand <jmarchan(a)redhat.com>
Signed-off-by: Jan Stancek <jstancek(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
@@ -2348,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${RPM_BUILD_NCPUS} xz; \
+ find $RPM_BUILD_ROOT/lib/modules/ -type f -name '*.ko' | xargs
-P${RPM_BUILD_NCPUS} -r xz; \
fi \
%{nil}
--
https://gitlab.com/cki-project/kernel-ark/-/merge_requests/1775