From: Prarit Bhargava prarit@redhat.com
kernel.spec.template: Fix --without bpftool
The selftests turn bpftool on unconditionally. If a user has specified --without bpftool it means the user really wants to disable bpftool. In this case the selftest should be disabled.
Disable selftests and output a message to the user disabled when --without bpftool is specified.
Signed-off-by: Prarit Bhargava prarit@redhat.com
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 @@ -447,8 +447,13 @@ Summary: The Linux kernel
# selftests require bpftool to be built %if %{with_selftests} +%if %{with_bpftool} == 0 +%{echo:Disabling selftests build: '--without bpftool' specified} +%define with_selftests 0 +%else %define with_bpftool 1 %endif +%endif
%ifnarch noarch %define with_kernel_abi_stablelists 0
-- https://gitlab.com/cki-project/kernel-ark/-/merge_requests/2720
From: Jan Stancek on gitlab.com https://gitlab.com/cki-project/kernel-ark/-/merge_requests/2720#note_1567490...
Yes, we discussed this on slack with Michael. I think this is right approach, just want to see how pipelines/builds turn out first.
From: Jan Stancek on gitlab.com https://gitlab.com/cki-project/kernel-ark/-/merge_requests/2720#note_1567686...
The %else branch can be dropped, because you only get there if with_bpftool is already 1
From: Prarit Bhargava on gitlab.com https://gitlab.com/cki-project/kernel-ark/-/merge_requests/2720#note_1567706...
Yeah, TBH, I was thinking this might be better?
``` # selftests require bpftool to be built %if %{with_bpftool} == 0 %{echo:Disabling selftests build: '--without bpftool' specified} %define with_selftests 0 %endif ```
@jstancek what do you think?
From: Jan Stancek on gitlab.com https://gitlab.com/cki-project/kernel-ark/-/merge_requests/2720#note_1567715...
That should work, it's simpler, there just will be a message about disabling selftests even when selftests were already disabled. I'm leaning slightly towards extra message, since it removes one %if block :smile:
kernel@lists.fedoraproject.org