From: Orgad Shaneh <orgad.shaneh@xxxxxxxxxxxxxx> spec: Respect rpmbuild --without debuginfo The build (x86_64) uses 25G, while without CONFIG_DEBUG_INFO it uses 3GB. Originally pushed in https://git.centos.org/rpms/kernel/pull-request/1 Signed-off-by: Orgad Shaneh <orgad.shaneh@xxxxxxxxxxxxxx> Signed-off-by: Jan Stancek <jstancek@xxxxxxxxxx> diff --git a/redhat/kernel.spec.template b/redhat/kernel.spec.template index blahblah..blahblah 100644 --- a/redhat/kernel.spec.template +++ b/redhat/kernel.spec.template @@ -449,6 +449,11 @@ Summary: The Linux kernel %define with_selftests 0 %endif +# bpftool needs debuginfo to work +%if %{with_debuginfo} == 0 +%define with_bpftool 0 +%endif + %ifnarch noarch %define with_kernel_abi_stablelists 0 %endif @@ -2104,6 +2109,10 @@ InitBuildVars() { cp configs/x509.genkey certs/. %endif +%if %{with_debuginfo} == 0 + sed -i 's/^\(CONFIG_DEBUG_INFO.*\)=y/# \1 is not set/' .config +%endif + Arch=`head -1 .config | cut -b 3-` %{log_msg "InitBuildVars: USING ARCH=$Arch"} @@ -2835,6 +2844,7 @@ BuildKernel() { # the F17 UsrMove feature. ln -sf $DevelDir $RPM_BUILD_ROOT/lib/modules/$KernelVer/build +%if %{with_debuginfo} # Generate vmlinux.h and put it to kernel-devel path # zfcpdump build does not have btf anymore if [ "$Variant" != "zfcpdump" ]; then @@ -2846,6 +2856,7 @@ BuildKernel() { tools/bpf/bpftool/bootstrap/bpftool btf dump file vmlinux format c > $RPM_BUILD_ROOT/$DevelDir/vmlinux.h fi +%endif %{log_msg "Cleanup kernel-devel and kernel-debuginfo files"} # prune junk from kernel-devel -- https://gitlab.com/cki-project/kernel-ark/-/merge_requests/3344 -- _______________________________________________ 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, report it: https://pagure.io/fedora-infrastructure/new_issue